-
Notifications
You must be signed in to change notification settings - Fork 23
Update wazuh.rst to better explain how to use TLS #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MaxBed4d
wants to merge
3
commits into
stackhpc/2023.1
Choose a base branch
from
Wazuh-Docs-TLS
base: stackhpc/2023.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -317,16 +317,37 @@ You will need to create two files matching the following pattern: | |||||
- ``{{ dashboard_node_name }}-key.pem`` for the private key | ||||||
- ``{{ dashboard_node_name }}.pem`` for the certificate | ||||||
|
||||||
Drop these files into ``$KAYOBE_CONFIG_PATH/environments/<environment>/wazuh/wazuh-certificates/`` if | ||||||
using the kayobe environments feature, or ``$KAYOBE_CONFIG_PATH/wazuh/wazuh-certificates/`` if not. | ||||||
The key for the external certificate should be in PKCS#8 format (in its header it may have BEGIN | ||||||
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. | ||||||
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. | ||||||
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 | ||||||
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``. | ||||||
|
||||||
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. | ||||||
MoteHue marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
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 | ||||||
PRIVATE KEY instead of BEGIN RSA PRIVATE KEY or BEGIN OPENSSH PRIVATE KEY). | ||||||
|
||||||
Example OpenSSL rune to convert to PKCS#8: | ||||||
|
||||||
``openssl pkcs8 -topk8 -nocrypt -in wazuh.key -out wazuh.key.pkcs8`` | ||||||
|
||||||
TODO: document how to use a local certificate. Do we need to override all certificates? | ||||||
.. note:: | ||||||
|
||||||
If you find that your Wazuh playbook isn't generating some of the non custom certificates, | ||||||
namely the ``indexer`` or ``dashboard`` certificates, it is likely that they aren't being | ||||||
templated correctly in ``wazuh-cert-tool.sh`` and this could be due to a few reasons but | ||||||
the variable used to templated into ``wazuh-cert-tool.sh`` is: | ||||||
|
||||||
.. code-block:: bash | ||||||
|
||||||
instances: | ||||||
wazuh: | ||||||
name: "{{ inventory_hostname }}" | ||||||
ip: "{{ wazuh_manager_ip }}" | ||||||
role: indexer | ||||||
|
||||||
Where ``role`` defines the service which ``wazuh-cert-tool.sh`` will create a certificate for. | ||||||
This should be defined in ``$KAYOBE_CONFIG_PATH/environments/<environment>/inventory/group_vars/wazuh-manager/wazuh-manager.yml``. | ||||||
|
||||||
Custom SCA Policies (optional) | ||||||
------------------------------ | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.