This guide no longer works, a rewrite is planned
Installation
The Elastic stack has several components that each have their own installation guides.
Install Elasticsearch
This guide is adapted from the official guide and the guide written by Frankline Bett.
Install from APT repository
The elastic APT repository is installed by default on Kali Purple, run the following command to install elasticsearch
Configure Elasticsearch
Open the configuration file…
And set the following options:
Set the default user’s password:
sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic -i
Start Elasticsearch
Test that Elasticsearch is running
This result means that Elasticsearch is fully functional
Install Logstash
Install from APT repository
Configure Logstash
Create the config file /etc/logstash/conf.d/beats.conf
with the following content.
input {
beats {
port => 5044
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGLINE}" }
}
date {
match => [ "timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
}
}
Start Logstash service
Install Beats
To gather data, we will set up Filebeat, Metricbeat, and Packetbeat.
Filebeat
Install from APT repository
Configure Filebeat
Open /etc/filebeat/filebeat.yml
and make the following changes:
- Comment out all lines in the “Elasticsearch output” section
- Uncomment the lines for “Logstash output”
- Set the “Filebeat inputs” section ‘enabled’ flag to
true
- Save and close the file
Start Filebeat service
Metricbeat
Install from APT repository
Configure Metricbeat
Open /etc/metricbeat/metricbeat.yml
and make the following changes:
- Comment out all lines in the “Elasticsearch output” section
- Uncomment the lines for “Logstash output”
Start Metricbeat service
Packetbeat (TODO: Reassess)
Install from APT repository
Configure Packetbeat
Open /etc/packetbeat/packetbeat.yml
and make the following changes:
- Comment out all lines in the “Elasticsearch output” section
- Uncomment the lines for “Logstash output”
Start Packetbeat Service
Install Kibana
Install from APT repository
Configure Kibana
Open the configuration file /etc/kibana/kibana.yml
and ensure the following configuration values are set:
Start Kibana Service
Access Kibana Web Interface
- Get the Kibana enrollment token:
- Copy the output of the command
- Open the Kibana web interface at http://localhost:5601
- Paste the enrollment token and click “Configure Elastic”
- To get the code from the verification code run:
6. Wait for the configurations to complete 7. Select “Explore on my own” 8. Enable beats modules