Table des matières

ElasticSearch - LogStash - Kibana

Installation sur VM Debian

Prérequis

apt install nmap wget curl htop gpg apt-transport-https 

Installation ElasticSearch

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch |  gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" |  tee /etc/apt/sources.list.d/elastic-8.x.list
apt update &&  apt install elasticsearch

L'installation d'Elasticsearch est terminée, les fonctionnalités de sécurité sont activées et configurées par défaut. Elles s'articulent comme suit:

Le mot de passe, le certificat et les clés sont affichés dans le terminal.

systemctl enable elasticsearch.service
systemctl  start elasticsearch


On teste si le service est bien à l'écoute:

export ELASTIC_PASSWORD="your_password"
curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200 

-p = mot de passe
-r = role

/usr/share/elasticsearch/bin/elasticsearch-users metribeat -p metribe@tPWD -r monitoring

Installation de Kibana

apt install kibana

/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
systemctl daemon-reload
systemctl enable kibana.service

Installation LogStash

apt install logstash

Installation Agent MetricBeat

Installation de l'agent sur un windows server 2019 core edition

New-Item -Type directory -path 'C:\Program Files\MetricBeat'
Copy-Item -Path 'C:\temp\metricbeat-8.11.3-windows-x86_64\metricbeat-8.11.3-windows-x86_64\*' -Destination  'C:\Program Files\M
etricbeat\' -Recurse
Set-ExecutionPolicy unrestricted
cd 'C:\Program Files\Metricbeat'
.\install-service-metricbeat.ps1