2. Installing OpenDistro for Elasticsearch Plugins
The Opendistro allows us to add plugins to our elastic stack, in particular the security plugin which will allow us to secure our stack and add further features like users and roles management, the alerting plugins which will allow us to create rules and send alerts via slack, webhooks and lately they added Email.
If you are using a cluster of nodes installing a plugin would only be successfully operational if it is installed on all nodes.
Disable XPACK security
First lets disable xpack security on both Elasticsearch and Kibana and add this line to their configuration files
xpack.security.enabled: falseInstalling Security plugin for Elasticsearch
Navigate to the Elasticsearch home directory (most likely, it is /usr/share/elasticsearch), and run the install command for each plugin.
$ sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-security/opendistro_security-1.9.0.0.zipInstalling Alerting plugin for Elasticsearch
Before installing alerting plugin, the job scheduler plugin is required to be able to send alerts and take data snapshots.
Job Scheduler Plugin
$ sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-job-scheduler/opendistro-job-scheduler-1.9.0.0.zipAlerting Plugin
Installing Security Plugin for Kibana
Elasticsearch security plugin has a corresponding Kibana plugin which would be a great addition in order to make management tasks easy from a UI.
Navigate to the Kibana home directory (likely /usr/share/kibana) and run the install command for each plugin.
This plugin provides a user interface for managing users, roles, mappings, action groups, and tenants.
Installing Alerting Plugin for Kibana
This plugin provides a user interface for creating monitors and managing alerts.
Setting up default certificates
After installing the modules we must restart Elasticsearch and Kibana to take into account the installed plugins but before restarting them we must run the following script to generate the default certificates of opendistro
If you have a cluster, this step must be done on all Elasticsearch instances before restarting the Elasticsearch service
Default credentials are admin:admin to test if everything is working check Elasticsearch response by running the following command
Generating our own certificates is not within the scope of this blog. so make sure you modify these certificates before putting this on production.
After restart you would notice some changes to Elasticsearch configuration file.
Changing Logstash and Kibana's configuration
Since we installed security plugin all communication now to our node is in https so we need to change their configurations accordingly.
Copy demo certificates to accessible locations for kibana and logstash and change, if necessary, the owner and group of the files.
Kibana.yml
Logstash.yml

Last updated