thank you for using Wazuh.
The internal_users.yml file is used when the Wazuh indexer cluster is started for the first time and the security was initiated. This means, that if you do some changes after the cluster security was already configured, these will not apply directly. If you want to apply your changes after the security was initiated, take a look at this
https://opensearch.org/docs/1.2/security-plugin/configuration/security-admin/#a-word-of-caution.
Some possibilities:
1. If you don't care about the generated data, you could destroy the environment a create a new one by modifying previously the user password in the file.
1.1 Destroy the current environment
docker-compose down -v-v flag will remove the volumes. This is important if you have the data volume from the Wazuh indexer container
1.2 Ensure you edited the password hash of the user in the internal_config.yml
You could generate one new with:
docker run --rm -ti wazuh/wazuh-indexer:4.3.9 bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh
Type in a secure password when prompted and replace the hash in internal_users.yml.
1.3 Start the environment
docker-compose up -d
2. Use the securityadmin.sh script in the current environment to change the user password
2.1 Ensure you edited the password hash of the user in the internal_config.yml file
2.2 Run the securityadmin.sh script to apply the password change
JAVA_HOME="/usr/share/wazuh-indexer/jdk" bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -f /usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/internal_users.yml -t internalusers -icl -nhnv -cacert /usr/share/wazuh-indexer/config/certs/root-ca.pem -cert /usr/share/wazuh-indexer/config/certs/admin.pem -key /usr/share/wazuh-indexer/config/certs/admin-key.pem
This was tested on single node Wazuh deployment v4.3.9 through Docker. If you are using another deployment type, you could have to adjust it.
More information about the securityadmin.sh script:
https://opensearch.org/docs/1.2/security-plugin/configuration/security-admin/