Skip to content

Commit d821ede

Browse files
authored
Merge pull request #31 from stackhpc/wazuh
Wazuh admin guide
2 parents 21769b9 + 5514216 commit d821ede

File tree

5 files changed

+135
-0
lines changed

5 files changed

+135
-0
lines changed

source/data/deployment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ ironic_automated_cleaning: true
1616

1717
# Whether Kayobe manages physical network devices.
1818
kayobe_manages_physical_network: true
19+
20+
# Whether the deployment includes Wazuh.
21+
wazuh: true
22+
23+
# Whether the Wazuh deployment is managed via StackHPC.
24+
wazuh_managed: true
25+
26+
# Whether the Wazuh deployment is handled via Ansible.
27+
wazuh_ansible: true

source/include/wazuh_ansible.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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.
4+
5+
Configuring Wazuh Manager
6+
-------------------------
7+
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:
13+
14+
*domain_name*:
15+
The domain used by Search Guard CE when generating certificates.
16+
17+
*wazuh_manager_ip*:
18+
The IP address that the Wazuh Manager shall reside on for communicating with the agents.
19+
20+
*wazuh_manager_connection*:
21+
Used to define port and protocol for the manager to be listening on.
22+
23+
*wazuh_manager_authd*:
24+
Connection settings for the daemon responsible for registering new agents.
25+
26+
Running ``kayobe playbook run
27+
$KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` will deploy these
28+
changes.
29+
30+
Secrets
31+
-------
32+
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.
35+
36+
To update the secrets you can execute the following two commands
37+
38+
.. code-block:: shell
39+
:substitutions:
40+
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
46+
47+
Once generated, run ``kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/wazuh-manager.yml`` which copies the secrets into place.
48+
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``
52+
53+
Adding a New Agent
54+
------------------
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).
59+
60+
.. code-block:: ini
61+
62+
[wazuh-agent:children]
63+
seed
64+
overcloud
65+
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
72+
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``.
80+
81+
Accessing Wazuh Manager
82+
-----------------------
83+
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``.
91+
92+
.. note:: Use ``ansible-vault`` to view Wazuh secrets:
93+
94+
``ansible-vault view --vault-password-file ~/vault.password $KAYOBE_CONFIG_PATH/inventory/group_vars/wazuh-manager/wazuh-secrets.yml``

source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Contents
2424
ceph_storage
2525
managing_users_and_projects
2626
operations_and_monitoring
27+
wazuh
2728
customising_deployment
2829
gpus_in_openstack
2930
baremetal_management

source/vars.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@
4949
.. |tempest_recipes| replace:: https://github.com/acme-openstack/tempest-recipes.git
5050
.. |tls_setup| replace:: TLS is implemented using a wildcard certificate available for ``*.acme.example``.
5151
.. |vault_password_file_path| replace:: ~/vault-password
52+
.. |wazuh_manager_url| replace:: https://172.168.0.10:5601
53+
.. |wazuh_manager_ip| replace:: 172.168.0.10:5601
54+
.. |wazuh_manager_name| replace:: wazuh-manager01

source/wazuh.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. include:: vars.rst
2+
3+
=======================
4+
Wazuh Security Platform
5+
=======================
6+
7+
.. ifconfig:: deployment['wazuh']
8+
9+
The |project_name| deployment uses `Wazuh <https://wazuh.com>`_ as security monitoring platform. Among other things, Wazuh monitors for:
10+
11+
* Security-related system events.
12+
* Known vulnerabilities (CVEs) in versions of installed software.
13+
* Misconfigurations in system security.
14+
15+
.. ifconfig:: deployment['wazuh_managed']
16+
17+
The Wazuh deployment is managed by StackHPC Ltd.
18+
19+
.. ifconfig:: not deployment['wazuh_managed']
20+
21+
The Wazuh deployment is not managed by StackHPC Ltd.
22+
23+
.. ifconfig:: deployment ['wazuh_ansible']
24+
25+
Wazuh deployment via Ansible
26+
============================
27+
28+
.. include:: include/wazuh_ansible.rst

0 commit comments

Comments
 (0)