Xpack configuration in ELK stack
What is Xpack?
Elastic Stack, often known as ELK (Elasticsearch, Logstash, and Kibana), is a collection of extensions known as X-Pack. The Elastic Stack’s functionality is improved by X-Pack’s new features and capabilities, increasing its adaptability to a wider range of use scenarios
How to enable minimal security in ELK using xpack
Stop elasticsearch and kibana
systemctl stop elasticsearch
systemctl stop kibana
Edit elasticsearch.yml in /etc/elasticsearch and add,
xpack.security.enabled: true as shown below
nano /etc/elasticserach/elasticsearch.yml
Start elasticsearch and check status using,
systemctl start elasticsearch
systemctl status elasticsearch
Try to connect to elasticsearch from the browser using http://<IP>:9200, as note that a login page will be prompted.
Now change the directory to /usr/share/elasticsearch/bin
cd /usr/share/elasticsearch/bin
To generate random passwords for all usernames, we can use auto or else if we want to set own passwords we can use interactive command.
For the current scenario let’s use auto for generating random password, using
./elasticsearch-setup-passwords auto
Save the generated passwords with the usernames in a text file.
Now let’s change the directory to /etc/kibana and add elasticsearch.username and elasticsearch.password in kibana.yml file.
nano /etc/kibana/kibana.yml
Don’t change the username let it be the default one, copy and paste the password of the username.
Now start and check the status kibana service.
systemctl start kibana
systemctl status kibana
Now go to the browser and access the kibana dashboard using,
http://<IP>:5601 there will be a login page displayed once Kibana server is ready.
Supply the username as “elastic” and password as the generated password.
With this we complete our xpack minimal security configuration.
You can find the step-by-step video:
Subscribe to our YouTube channel. https://www.youtube.com/@CyberToolGuardian/featured
Follow us on Instagram.
https://instagram.com/cybertoolguardian
Comments
Post a Comment