-
Notifications
You must be signed in to change notification settings - Fork 5
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
Manager check service fails in distributed deployment #51
Labels
Comments
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
While working on #20, I found a problem when checking the Wazuh manager service, specifically when executing the
manager_checkService
command. This new check was added in wazuh/wazuh-packages#3059, and improved in #28 and #44.Now, I encountered that this check fails when performing a distributed installation, specifically when installing a Wazuh manager cluster. This is causing the GHA migration is failing:
The problem is that the Wazuh worker node fails with the
Invalid credentials
response of the Wazuh API when obtaining a token:However, in the Wazuh manager master node, this is not reproduced:
Investigation
To understand what is happening, we must take into account that:
Important
Notice that the used credentials to get the API are
wazuh-wui:wazuh-wui
, the default credentials before changing the passwords.The execution order of the functions when installing the Wazuh manager on a distributed installation (this means installing the Wazuh manager with the
-ws
option, not the-a
option) is the following:As you can see, among other things, the Wazuh manager master node is checking the Wazuh manager service (and it passes correctly), and it changes the passwords long after, including the API password.
Then, when the Wazuh manager worker node performs its installation, the API credentials are not the default ones anymore, because the Wazuh manager master node has changed them. Thus, when the worker node tries to get the token with the default credentials, it fails:
If we use the password specified in the wazuh-passwords.txt file, the TOKEN is fetched correctly:
Caution
This error could have been avoided if distributed testing was performed in wazuh/wazuh-packages#3059, #28, and #44. We should perform this kind of test when developing new code. This will be much easier when the GHAs are finished in #20.
Tasks
The text was updated successfully, but these errors were encountered: