-
Notifications
You must be signed in to change notification settings - Fork 97
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
Fixed API password change to match the user in wazuh.yml #2946
Fixed API password change to match the user in wazuh.yml #2946
Conversation
Update ReportDescriptionI realized by doing more tests that the variable took on more values than expected. In fact, it took all the occurrences of
TestsI attach more tests in AIO installation. With wazuh configured as userThe password generated by the Passwords Tool:
The updated Password in the
With wazuh-wui configured as userThe password generated by the Passwords Tool:
The updated Password in the
|
Related: wazuh/wazuh#22751
Description
The problem was that the Password Tool modified the password on
wazuh.yml
always to the one used by the userwazuh-wui
.Now, the fix done is that the Password Tool takes into account which user appears on
wazuh.yml
and updates the password to match the user.Logs example
These changes have been done by storing a variable with the username on the wazuh.yml with the following line:
Then, the condition to update the Api Password has been changed for matching the user recovered from the file:
Tests
To test the changes I used a VM with Ubuntu 22.04 and updated the Password Tool with the changes mentioned above. Then I ran the script with the username on
/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml
equal towazuh
and checked that the password on the file is the one correspondent towazuh
user and not towazuh-wui
like it was before.I ran the Password Tool with the user
wazuh
in thewazuh.yml
file. The output was the following:And the
wazuh.yml
file contains the password matching the userwazuh
:I did the same verification with the
wazuh-wui
user. I ran the Password Tool. The output was this:And the
wazuh.yml
file contains the password matching the userwazuh-wui
: