Let me explain the process and a few concepts then onto the recommended solution at the end. We will create new certificates for all of the services in order to avoid issues and possible errors, with this guide you should be able to have it running quickly. In this example I used an all-in-one, the process is the same for any distribution, the difference relies on the location of said services. In the installation guide you may see it too:
Here is the link for a single-node elasticsearch in 4.2: Single-Node 4.2
Concepts:
ca local certificate authority (CA). Which holds the CA certificate and the private key for the CA.
cert X.509 certificates and keys. All certificates that are generated by this command are signed by a CA.
systemctl status -l kibana the -l option gives you more information about the log. You can also use which is more flexible: journalctl, check this:
journalctl -u kibana --no-pager, it is like cat, it will show you all the log lines.
journalctl -u kibana --no-pager -f, it is like tail -f, it will show you all the log lines and wait for new lines.
journalctl -u kibana -f -n 100, it is like tail -f -n 100, it will show you the last 100 log lines and wait for changes.
Requirements:
instances.yml this file you already have from the installation process. It contains information about the node name, ips, etc..
wazuh-cert-tool.sh this file you already have from the installation process, if not run the following command: curl -so ~/wazuh-cert-tool.sh https://packages.wazuh.com/resources/4.2/open-distro/tools/certificate-utility/wazuh-cert-tool.sh
We will follow the steps from the installation process but with new certificates:
Stop the following services Elasticsearch, Kibana and Filebeat with:
systemctl stop elasticsearch.service
systemctl stop kibana.service
systemctl stop filebeat.service
Move all the current certs into another directory, the certs are located in the following paths:
/etc/elasticsearch/certs/
/etc/kibana/certs/
/etc/filebeat/certs/
Create new directories in each path mentioned before with: mkdir backup then move them with mv <files-name> backup
Run the wazuh-cert-tool.sh it will create a new directory ~/certs/ which contains all the certs that we are going to use.
Taking this guide into consideration All-In-One Certificates we will configure the certs:
Elasticsearch:
Once the certs were moved:
Run the Elasticsearch securityadmin script to load the new certificates information and start the cluster:
The -cd option specifies where the security plugin configuration files to upload to the cluster can be found.
The -icl (--ignore-clustername) option tells the security plugin to upload the configuration regardless of the cluster name. As an alternative, you can also specify the cluster name with the -cn (--clustername) option.
Because the demo certificates are self-signed, we also disable hostname verification with the -nhnv (--disable-host-name-verification) option.
The -cacert, -cert and -key options define the location of your root CA certificate, the admin certificate, and the private key for the admin certificate. If the private key has a password, specify it with the -keypass option.
With this command you should get the following output: curl -XGET https://localhost:9200 -u admin:admin -k the admin:admin is user:password from your environment
Filebeat:
Start the service:
To ensure that Filebeat is successfully installed, run the following command: filebeat test output
An example response should look as follows:
Kibana:
Start the Kibana service:
Upon the first access to Kibana, the browser shows a warning message stating that the certificate was not issued by a trusted authority. An exception can be added in the advanced options of the web browser or, for increased security, the root-ca.pem file previously generated can be imported to the certificate manager of the browser.
Importing a Certificate into Mozilla Firefox
In Firefox, go to Tools > Options.
Go to the Advanced tab and the Security sub-tab and click View Certificates.
Go to the Authorities tab and click Import.
Importing a Certificate into Google Chrome:
Go to Chrome Settings.
Click on "advanced settings"
Under HTTPS/SSL click to "Manage Certificates"
Go to "Trusted Root Certificate Authorities"
Click to "Import"
There will be a pop up window that will ask you if you want to install this certificate. Click "yes".
Remember to delete the cache and cookies from the browser. This is because you now have new certificates.
Let me know if you find this helpful and if you have any problems, if so, we can schedule a call, let me know of your schedule and we will work something out,
Cheers,
Roman from Wazuh!.