Cluster Configuration

Clusters A & Cluster B will have the same configuration so we will cover the installation & configuration of Cluster A & we can follow the same for other clusters in the node.


This remote Wazuh cluster collects, analyzes, and stores logs from Wazuh agents within the customer A environment. It consists of a Wazuh server that collects and analyzes log data from Wazuh agents and a Wazuh indexer that stores the Wazuh alerts. It can be configured as a single-node or multi-node Wazuh cluster.

The Wazuh indexer node in cluster A trusts only the Wazuh indexer node in the CCS environment, allowing it to query its data. Alerts and log data reside in cluster A, but the CCS environment can only query the data but not store it.

Generating certificates

Note: Make sure that a copy of the root-ca.key and root-ca.pem files created during the CCS generating certificatesarrow-up-right step are in your working directory.

Download the wazuh-certs-tool.sh script and the config.yml configuration file. The wazuh-certs-tool.sh script is used to generate certificates for the cluster.

curl -sO https://packages.wazuh.com/4.9/wazuh-certs-tool.sh
curl -sO https://packages.wazuh.com/4.9/config.yml

Edit the config.yml file and replace the name and IP values with the corresponding node name and IP address for the Wazuh server and indexer:

nodes:
  # Wazuh indexer nodes
  indexer:
    - name: ca-wazuh-indexer-1
      ip: "192.168.146.155"

  # Wazuh server nodes
  server:
    - name: ca-wazuh-server-1
      ip: "192.168.146.155"

Note: Comment out or remove the Wazuh dashboard configuration since it is not in use.

Run the wazuh-certs-tool.sh script with option -A and indicate the root-ca certificate and key created earlier to create the admin, and node certificates:

Compress all the certificate files and remove the uncompressed version to allow for easier transfer to other component nodes within cluster A:


Wazuh indexer installation

Adding GPG Keys

Adding Repository

Edit the /etc/wazuh-indexer/opensearch.yml configuration file and replace the following values.

  • network.host with the IP address of the Wazuh indexer node.

  • node.name with the name of the Wazuh indexer node set in the config.yml file.

  • cluster.initial_master_nodes with the name of the Wazuh indexer node(s) in cluster A.

  • cluster.name with the name of the cluster. For example, ca-cluster.

  • plugins.security.nodes_dn with the distinguished name (DN) of the certificate for the cluster A Wazuh indexer node(s) and the CCS Wazuh indexer node. The common names (CN) will be replaced with the node names of the cluster A Wazuh indexer node and the CCS Wazuh indexer node.

Run the following commands, replacing <INDEXER_NODE_NAME> with the value of node.name configured in the /etc/wazuh-indexer/opensearch.yml file:

Enable and start the Wazuh indexer service:

Run the Wazuh indexer indexer-security-init.sh script on the Wazuh indexer node to load the new certificate information and initialize the Wazuh indexer:

Check that the Wazuh indexer is initialized and correctly set up by running the following command:

The output should look like :


Wazuh server installation

Installing wazuh manager & filebeat

Download the preconfigured Filebeat configuration file.

Edit the /etc/filebeat/filebeat.yml configuration file and enter the IP address of the cluster A Wazuh indexer node(s) in the hosts section:

Create a Filebeat keystore to securely store authentication credentials and add the default username and password admin:admin to the secrets keystore:

Download the alerts template for the Wazuh indexer and grant appropriate read permissions:

Install the Wazuh module for Filebeat:

Replace <SERVER_NODE_NAME> with the cluster A Wazuh server node name set in config.yml when creating the certificates, and move the certificates to their corresponding directories:

Save the Wazuh indexer username and password into the Wazuh manager keystore using the wazuh-keystore tool:

Edit /var/ossec/etc/ossec.conf file to configure the indexer connection by adding the Wazuh indexer IP address to the <host> section of the <indexer> block:

Enable and start the Wazuh manager service and Filebeat service:

Run the following command to verify that Filebeat is successfully installed:


Here we ve successfully configured the Cluster A , Similiarly we can configure other clusters with the same method

In the next section we will configure the basic index patterns eo enable clusters in the centralized wazuh dashboard

Last updated