Skip to content

Commit 028f639

Browse files
authored
Update wazuh.rst to better explain how to use TLS
1 parent f4d30a9 commit 028f639

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

doc/source/configuration/wazuh.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,37 @@ You will need to create two files matching the following pattern:
317317
- ``{{ dashboard_node_name }}-key.pem`` for the private key
318318
- ``{{ dashboard_node_name }}.pem`` for the certificate
319319

320-
Drop these files into ``$KAYOBE_CONFIG_PATH/environments/<environment>/wazuh/wazuh-certificates/`` if
321-
using the kayobe environments feature, or ``$KAYOBE_CONFIG_PATH/wazuh/wazuh-certificates/`` if not.
322-
The key for the external certificate should be in PKCS#8 format (in its header it may have BEGIN
320+
In order to utilise externally generated certificates, you must first deploy Wazuh Ansible as normal in order to generate the aforementioned certificates; this is because it is unlikely that every Wazuh service will be getting its own custom certificate, especially the ``root`` and ``admin`` certificates. Therefore the ``<...>/wazuh/wazuh-certificates`` directory cannot be manually created as this will result in the Wazuh playbook and ``wazuh-cert-tool.sh`` not generating the remaining non custom certificates.
321+
Custom certificates for Wazuh ``indexer`` may be also be added in a similar way as Wazuh ``dashboard`` by changing the ``indexer_node_name`` such that it's going to match the custom certificate's name.
322+
Once the certificates have been generated a number of steps are required, depending on which set of custom certificates are required to be added or substituted. Regardless, you must ``SSH`` into the ``infra VM`` in which the Wazuh services have been deployed to and, with admin privileges, remove any of the certificates from ``/etc/wazuh-{dashboard | indexer}/certs/`` which are due to be replaced with custom ones. Following this, return to the ``seed`` VM and drop the custom new ``pem`` certificates into ``$KAYOBE_CONFIG_PATH/environments/<environment>/wazuh/wazuh-certificates/`` if
323+
using a kayobe environment, or ``$KAYOBE_CONFIG_PATH/wazuh/wazuh-certificates/`` if not. Finally, rerun the Wazuh Ansible playbook and now the custom certificates should be copied over to their respective directories in the ``infra VM``.
324+
325+
Following this, the ``sudo systemctl status`` for the three Wazuh services should be checked to make sure they are up and running with no errors. Additionally, testing ``sudo filebeat test output`` and trying to ``curl`` the service's IP will also signify if the certificates are working correctly.
326+
327+
It should also be noted that the key for the external certificate should be in PKCS#8 format (in its header it may have BEGIN
323328
PRIVATE KEY instead of BEGIN RSA PRIVATE KEY or BEGIN OPENSSH PRIVATE KEY).
324329

325330
Example OpenSSL rune to convert to PKCS#8:
326331

327332
``openssl pkcs8 -topk8 -nocrypt -in wazuh.key -out wazuh.key.pkcs8``
328333

329-
TODO: document how to use a local certificate. Do we need to override all certificates?
334+
.. note::
335+
336+
If you find that your Wazuh playbook isn't generating some of the non custom certificates,
337+
namely the ``indexer`` or ``dashboard`` certificates, it is likely that they aren't being
338+
templated correctly in ``wazuh-cert-tool.sh`` and this could be due to a few reasons but
339+
the variable used to templated into ``wazuh-cert-tool.sh`` is:
340+
341+
.. code-block:: bash
342+
343+
instances:
344+
wazuh:
345+
name: "{{ inventory_hostname }}"
346+
ip: "{{ wazuh_manager_ip }}"
347+
role: indexer
348+
349+
Where ``role`` defines the service which ``wazuh-cert-tool.sh`` will create a certificate for.
350+
This should be defined in ``$KAYOBE_CONFIG_PATH/environments/<environment>/inventory/group_vars/wazuh-manager/wazuh-manager.yml``.
330351

331352
Custom SCA Policies (optional)
332353
------------------------------

0 commit comments

Comments
 (0)