Skip to content

Changing default password for 'admin' and 'kibanaserver' - documentation refers to incorrect folder. #2256

Description

@ativey-ops

Following the official documentation carefully, password changes fail due to the "config" directory being referred to when it appears to no longer exist.

Using the documented variable assignments below:

export INSTALLATION_DIR=/usr/share/wazuh-indexer
export CONFIG_DIR=$INSTALLATION_DIR/config
CACERT=$CONFIG_DIR/certs/root-ca.pem
KEY=$CONFIG_DIR/certs/admin-key.pem
CERT=$CONFIG_DIR/certs/admin.pem
export JAVA_HOME=/usr/share/wazuh-indexer/jdk

Results in the following error:

Security Admin v7
Will connect to localhost:9200 ... done
ERR: An unexpected IllegalArgumentException occured: Could not find certificate file /usr/share/wazuh-indexer/config/certs/root-ca.pem
Trace:
java.lang.IllegalArgumentException: Could not find certificate file /usr/share/wazuh-indexer/config/certs/root-ca.pem
	at org.opensearch.security.tools.SecurityAdmin.sslContext(SecurityAdmin.java:1815)
	at org.opensearch.security.tools.SecurityAdmin.execute(SecurityAdmin.java:559)
	at org.opensearch.security.tools.SecurityAdmin.main(SecurityAdmin.java:162)
Caused by: java.io.FileNotFoundException: /usr/share/wazuh-indexer/config/certs/root-ca.pem (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
	at org.opensearch.security.tools.SecurityAdmin.sslContext(SecurityAdmin.java:1810)
	... 2 more

On a fresh setup of Wazuh, the folder "config" does not exist at /user/share/wazuh-indexer within the container. Running with the following set of commands, however, results in successful password changes:

export INSTALLATION_DIR=/usr/share/wazuh-indexer
export CONFIG_DIR=$INSTALLATION_DIR
CACERT=$CONFIG_DIR/certs/root-ca.pem
KEY=$CONFIG_DIR/certs/admin-key.pem
CERT=$CONFIG_DIR/certs/admin.pem
export JAVA_HOME=/usr/share/wazuh-indexer/jdk

Since I am not familiar with the securityadmin.sh script itself, I just adjusted the assignment of CONFIG_DIR rather than removing it entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions