diff --git a/build-docker-images/wazuh-dashboard/Dockerfile b/build-docker-images/wazuh-dashboard/Dockerfile index e53f84c7..6822025a 100644 --- a/build-docker-images/wazuh-dashboard/Dockerfile +++ b/build-docker-images/wazuh-dashboard/Dockerfile @@ -19,11 +19,6 @@ COPY config/config.sh . COPY config/config.yml / RUN bash config.sh -# Create and configure Wazuh dashboard keystore -RUN $INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \ - echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \ - echo kibanaserver | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root - # Install Wazuh App RUN $INSTALL_DIR/bin/opensearch-dashboards-plugin install https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}.zip --allow-root diff --git a/build-docker-images/wazuh-dashboard/config/entrypoint.sh b/build-docker-images/wazuh-dashboard/config/entrypoint.sh index d25432fa..6d6b1932 100644 --- a/build-docker-images/wazuh-dashboard/config/entrypoint.sh +++ b/build-docker-images/wazuh-dashboard/config/entrypoint.sh @@ -1,6 +1,16 @@ #!/bin/bash # Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) +INSTALL_DIR=/usr/share/wazuh-dashboard +DASHBOARD_USERNAME="${DASHBOARD_USERNAME:-kibanaserver}" +DASHBOARD_PASSWORD="${DASHBOARD_PASSWORD:-kibanaserver}" + +# Create and configure Wazuh dashboard keystore + +$INSTALL_DIR/bin/opensearch-dashboards-keystore create --allow-root && \ +echo $DASHBOARD_USERNAME | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.username --stdin --allow-root && \ +echo $DASHBOARD_PASSWORD | $INSTALL_DIR/bin/opensearch-dashboards-keystore add opensearch.password --stdin --allow-root + ############################################################################## # Start Wazuh dashboard ##############################################################################