|
1 |
| -One of methods for deploying and maintaining Wazuh is with the use of the official Ansible playbooks, integrated into a Kayobe Config. |
| 1 | +One method for deploying and maintaining Wazuh is the `official |
| 2 | +Ansible playbooks <https://github.com/wazuh/wazuh-ansible>`_. These |
| 3 | +can be integrated into |kayobe_config| as a custom playbook. |
2 | 4 |
|
3 | 5 | Configuring Wazuh Manager
|
4 | 6 | -------------------------
|
5 | 7 |
|
6 |
| -Wazuh manager can easily be configured by editing the ``wazuh-manager.yml`` groups vars file found at ``etc/kayobe/inventory/group_vars/wazuh-master/``. |
7 |
| -This file gives you control over various important aspects of the Wazuh manager. |
8 |
| -Most notably; |
| 8 | +Wazuh Manager is configured by editing the ``wazuh-manager.yml`` |
| 9 | +groups vars file found at |
| 10 | +``etc/kayobe/inventory/group_vars/wazuh-manager/``. This file |
| 11 | +controls various aspects of Wazuh Manager configuration. |
| 12 | +Most notably: |
9 | 13 |
|
10 | 14 | *domain_name*:
|
11 |
| - the domain used by Search Guard CE when generating certificates. |
| 15 | + The domain used by Search Guard CE when generating certificates. |
12 | 16 |
|
13 | 17 | *wazuh_manager_ip*:
|
14 |
| - the IP address that the wazuh manager shall reside on for communicating with the agents. |
| 18 | + The IP address that the Wazuh Manager shall reside on for communicating with the agents. |
15 | 19 |
|
16 | 20 | *wazuh_manager_connection*:
|
17 |
| - used to define port and protocol for the manager to be listening on. |
| 21 | + Used to define port and protocol for the manager to be listening on. |
18 | 22 |
|
19 | 23 | *wazuh_manager_authd*:
|
20 |
| - connection settings for the daemon responsible for registering new agents. |
| 24 | + Connection settings for the daemon responsible for registering new agents. |
21 | 25 |
|
22 |
| -Running ``kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` will deploy these changes. |
| 26 | +Running ``kayobe playbook run |
| 27 | +$KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` will deploy these |
| 28 | +changes. |
23 | 29 |
|
24 | 30 | Secrets
|
25 | 31 | -------
|
26 | 32 |
|
27 |
| -Wazuh requires that secrets or passwords are set for itself and the services it communiticates with. |
28 |
| -The playbook ``etc/kayobe/ansible/wazuh-secrets.yml`` automates the creation of these secrets which can then be encrypted with Ansible Vault. |
| 33 | +Wazuh requires that secrets or passwords are set for itself and the services with which it communiticates. |
| 34 | +The playbook ``etc/kayobe/ansible/wazuh-secrets.yml`` automates the creation of these secrets, which should then be encrypted with Ansible Vault. |
29 | 35 |
|
30 | 36 | To update the secrets you can execute the following two commands
|
31 | 37 |
|
32 |
| -.. code-block:: console |
| 38 | +.. code-block:: shell |
33 | 39 | :substitutions:
|
34 | 40 |
|
35 |
| - kayobe# kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-secrets.yml -e wazuh_user_pass=$(uuidgen) -e wazuh_admin_pass=$(uuidgen) |
36 |
| - kayobe# ansible-vault encrypt --vault-password-file |vault_password_file_path| $KAYOBE_CONFIG_PATH/inventory/group_vars/wazuh-master/wazuh-secrets.yml |
| 41 | + kayobe# kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-secrets.yml \ |
| 42 | + -e wazuh_user_pass=$(uuidgen) \ |
| 43 | + -e wazuh_admin_pass=$(uuidgen) |
| 44 | + kayobe# ansible-vault encrypt --vault-password-file |vault_password_file_path| \ |
| 45 | + $KAYOBE_CONFIG_PATH/inventory/group_vars/wazuh-manager/wazuh-secrets.yml |
37 | 46 |
|
38 |
| -Once generated you can run ``kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` which shall copy the secrets into place. |
| 47 | +Once generated, run ``kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` which copies the secrets into place. |
39 | 48 |
|
40 |
| -.. note:: If you need to view the secrets it is recommended you use ``ansible-vault view --vault-password-file ~/vault.password`` |
| 49 | +.. note:: Use ``ansible-vault`` to view the secrets: |
| 50 | + |
| 51 | + ``ansible-vault view --vault-password-file ~/vault.password $KAYOBE_CONFIG_PATH/inventory/group_vars/wazuh-manager/wazuh-secrets.yml`` |
41 | 52 |
|
42 | 53 | Adding a New Agent
|
43 | 54 | ------------------
|
44 |
| -When adding a new host it should be automically picked up by the ``wazuh-agent:children`` group in ``etc/kayobe/inventory/groups`` as it would be included in the ``overcloud`` member. |
| 55 | +The Wazuh Agent is deployed to all hosts in the ``wazuh-agent`` |
| 56 | +inventory group, comprising the ``seed`` group (containing |seed_name|) |
| 57 | +plus the ``overcloud`` group (containing all hosts in the |
| 58 | +OpenStack control plane). |
45 | 59 |
|
46 | 60 | .. code-block:: ini
|
47 | 61 |
|
48 | 62 | [wazuh-agent:children]
|
49 | 63 | seed
|
50 | 64 | overcloud
|
51 | 65 |
|
52 |
| -Running the follow playbook ``kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-agent.yml`` will deploy the agent to the new host. |
53 |
| -This should automatically be registered and accessible within the Wazuh manager dashboard. |
| 66 | +The following playbook deploys the Wazuh Agent to all hosts in the |
| 67 | +``wazuh-agent`` group: |
| 68 | + |
| 69 | +.. code-block:: shell |
| 70 | +
|
| 71 | + kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-agent.yml |
54 | 72 |
|
55 |
| -The playbook ``wazuh-agent.yml`` can be setup as a hook within kayobe, which will automatically run either pre or post a given kayobe command. |
56 |
| -See `here <https://docs.openstack.org/kayobe/wallaby/custom-ansible-playbooks.html#hooks>`_ for more details. |
| 73 | +The hosts running Wazuh Agent should automatically be registered |
| 74 | +and visible within the Wazuh Manager dashboard. |
| 75 | + |
| 76 | +.. note:: It is good practice to use a `Kayobe deploy hook |
| 77 | + <https://docs.openstack.org/kayobe/wallaby/custom-ansible-playbooks.html#hooks>`_ |
| 78 | + to automate deployment and configuration of the Wazuh Agent |
| 79 | + following a run of ``kayobe overcloud host configure``. |
57 | 80 |
|
58 | 81 | Accessing Wazuh Manager
|
59 | 82 | -----------------------
|
60 | 83 |
|
61 |
| -To access the Wazuh manager dashboard, navigate to the ip address of the |wazuh_master_name| (|wazuh_master_url|). |
| 84 | +To access the Wazuh Manager dashboard, navigate to the ip address |
| 85 | +of |wazuh_manager_name| (|wazuh_manager_url|). |
| 86 | + |
| 87 | +You can login to the dashboard with the username ``admin``. The |
| 88 | +password for ``admin`` is defined in the secret |
| 89 | +``opendistro_admin_password`` which can be found within |
| 90 | +``etc/kayobe/inventory/group_vars/wazuh-manager/wazuh-secrets.yml``. |
62 | 91 |
|
63 |
| -You can login to the dashboard with the username ``admin`` and the password for ``opendistro_admin_password`` which can be found within ``etc/kayobe/inventory/group_vars/wazuh-master/wazuh-secrets.yml``. |
| 92 | +.. note:: Use ``ansible-vault`` to view Wazuh secrets: |
64 | 93 |
|
65 |
| -.. note:: If you need to view the secrets it is recommended you use ``ansible-vault view --vault-password-file ~/vault.password`` |
| 94 | + ``ansible-vault view --vault-password-file ~/vault.password $KAYOBE_CONFIG_PATH/inventory/group_vars/wazuh-manager/wazuh-secrets.yml`` |
0 commit comments