Wazuh Indexer Installation

Note : You need root user privileges to run all the commands described below.

The installation process is divided into three stages.

  1. Certificates creation

  2. Nodes installation

  3. Cluster initialization

We are going to install the wazuh v4.10 in the single Ubuntu sever instance so the installation covers the installation based on ubuntu or debian systems. To any other distributions we can follow.


Certificates Creation

Download the wazuh-certs-tool.sh script and the config.yml configuration file. This creates the certificates that encrypt communications between the Wazuh central components.

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

Now edit the config file to create the certificates needed for the deployment

sudo nano config.yml

Now we will rename the components name and enter the IP Address of the components to initialize the deployment.

nodes:
  # Wazuh indexer nodes
  indexer:
    - name: indexer-node-1 <--CHANGE THIS -->
      ip: "192.168.146.157"<--CHANGE THIS -->
    #- name: node-2
    #  ip: "<indexer-node-ip>"
    #- name: node-3
    #  ip: "<indexer-node-ip>"

  # Wazuh server nodes
  # If there is more than one Wazuh server
  # node, each one must have a node_type
  server:
    - name: server-node-1 <--CHANGE THIS -->
      ip: "192.168.146.157"<--CHANGE THIS -->
    #  node_type: master  
    #- name: wazuh-2
    #  ip: "<wazuh-manager-ip>"
    #  node_type: worker  
    #- name: wazuh-3
    #  ip: "<wazuh-manager-ip>"
    #  node_type: worker  

  # Wazuh dashboard nodes
  dashboard:
    - name: dashboard-node-1 <--CHANGE THIS -->
      ip: "192.168.146.157" <--CHANGE THIS -->

The lines with <--CHANGE THIS--> are lines that wil change during each deployment

Run ./wazuh-certs-tool.sh to create the certificates. For a multi-node cluster, these certificates need to be later deployed to all Wazuh instances in your cluster.

The output should look like :

Now we will see that the certificates folder is created in the current directory & Now Compress all the necessary files.

Copy the wazuh-certificates.tar file to all the nodes, including the Wazuh indexer, Wazuh server, and Wazuh dashboard nodes. This can be done by using the scp utility. In case all the components of wazuh are distributed over different instances


Nodes Installation

We will install the necessary dependencies and the repositories to install the wazuh indexer on the ubuntu instance.

Installing the GPG keys and adding the repository

Now we will install the wazuh indexer node using

Configuring the Wazuh Indexer node

We will make some changes in the config file which are as follows :

  1. network.host: Sets the address of this node for both HTTP and transport traffic. The node will bind to this address and use it as its publish address. Accepts an IP address or a hostname.

    Use the same node address set in config.yml to create the SSL certificates.

  2. node.name: Name of the Wazuh indexer node as defined in the config.yml file. For example, node-1.

  3. cluster.initial_master_nodes: List of the names of the master-eligible nodes. These names are defined in the config.yml file. Uncomment the node-2 and node-3 lines, change the names, or add more lines, according to your config.yml definitions.

  4. discovery.seed_hosts: List of the addresses of the master-eligible nodes. Each element can be either an IP address or a hostname. You may leave this setting commented if you are configuring the Wazuh indexer as a single node. For multi-node configurations, uncomment this setting and set the IP addresses of each master-eligible node.

  5. plugins.security.nodes_dn: List of the Distinguished Names of the certificates of all the Wazuh indexer cluster nodes. Uncomment the lines for node-2 and node-3 and change the common names (CN) and values according to your settings and your config.yml definitions.

Making the changes in the config file now we will move into certificates deployment section

Run the following commands replacing <INDEXER_NODE_NAME> with the name of the Wazuh indexer node you are configuring as defined in config.yml. For example, node-1. This deploys the SSL certificates to encrypt communications between the Wazuh central components.

Starting the services and if every config is right then the service might start successfully.

It is recommended to stop wazuh upgrades during updates to ensure all the components are running same versions across the systems.


Cluster Initialization

Run the Wazuh indexer indexer-security-init.sh script on any Wazuh indexer node to load the new certificates information and start the single-node or multi-node cluster.

The output should look like :

Testing the cluster :

The output should look like :

Replace <WAZUH_INDEXER_IP_ADDRESS> and run the following command to check if the single-node or multi-node cluster is working correctly.

If nothing is displayed as error we have deployed the indexer node successfully now we will move into installation of wazuh server.

Last updated