From bfff9d13907b26cfc5dbf2bf254873b71ac410f5 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 22 Feb 2022 12:21:33 -0300 Subject: [PATCH] Fix PR --- build-wazuh-images.yml | 4 ++-- docker-compose.yml | 4 ++-- wazuh-indexer/config/entrypoint.sh | 11 +++++------ wazuh-manager/config/permanent_data.env | 1 - 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/build-wazuh-images.yml b/build-wazuh-images.yml index cad9c561..e5af8246 100644 --- a/build-wazuh-images.yml +++ b/build-wazuh-images.yml @@ -55,8 +55,8 @@ services: ports: - 443:443 environment: - - ELASTICSEARCH_USERNAME=admin - - ELASTICSEARCH_PASSWORD=admin + - INDEXER_USERNAME=admin + - INDEXER_PASSWORD=admin - SERVER_SSL_ENABLED=false - WAZUH_API_URL=https://wazuh.manager depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index fd767315..f0fc7f15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,8 +52,8 @@ services: ports: - 443:443 environment: - - ELASTICSEARCH_USERNAME=admin - - ELASTICSEARCH_PASSWORD=admin + - INDEXER_USERNAME=admin + - INDEXER_PASSWORD=admin - WAZUH_API_URL=https://wazuh.manager depends_on: - wazuh1.indexer diff --git a/wazuh-indexer/config/entrypoint.sh b/wazuh-indexer/config/entrypoint.sh index 14062a13..d16fd5c4 100644 --- a/wazuh-indexer/config/entrypoint.sh +++ b/wazuh-indexer/config/entrypoint.sh @@ -2,7 +2,6 @@ # Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2) set -e -# Files created by Elasticsearch should always be group writable too umask 0002 export USER=wazuh-indexer @@ -52,29 +51,29 @@ fi # the values being specified explicitly when running the container. # # This is also sourced in opensearch-env, and is only needed here -# as well because we use ELASTIC_PASSWORD below. Sourcing this script +# as well because we use INDEXER_PASSWORD below. Sourcing this script # is idempotent. source /usr/share/wazuh-indexer/bin/opensearch-env-from-file if [[ -f bin/opensearch-users ]]; then - # Check for the ELASTIC_PASSWORD environment variable to set the + # Check for the INDEXER_PASSWORD environment variable to set the # bootstrap password for Security. # # This is only required for the first node in a cluster with Security # enabled, but we have no way of knowing which node we are yet. We'll just # honor the variable if it's present. - if [[ -n "$ELASTIC_PASSWORD" ]]; then + if [[ -n "$INDEXER_PASSWORD" ]]; then [[ -f /usr/share/wazuh-indexer/config/opensearch.keystore ]] || (run_as_other_user_if_needed opensearch-keystore create) if ! (run_as_other_user_if_needed opensearch-keystore has-passwd --silent) ; then # keystore is unencrypted if ! (run_as_other_user_if_needed opensearch-keystore list | grep -q '^bootstrap.password$'); then - (run_as_other_user_if_needed echo "$ELASTIC_PASSWORD" | opensearch-keystore add -x 'bootstrap.password') + (run_as_other_user_if_needed echo "$INDEXER_PASSWORD" | opensearch-keystore add -x 'bootstrap.password') fi else # keystore requires password if ! (run_as_other_user_if_needed echo "$KEYSTORE_PASSWORD" \ | opensearch-keystore list | grep -q '^bootstrap.password$') ; then - COMMANDS="$(printf "%s\n%s" "$KEYSTORE_PASSWORD" "$ELASTIC_PASSWORD")" + COMMANDS="$(printf "%s\n%s" "$KEYSTORE_PASSWORD" "$INDEXER_PASSWORD")" (run_as_other_user_if_needed echo "$COMMANDS" | opensearch-keystore add -x 'bootstrap.password') fi fi diff --git a/wazuh-manager/config/permanent_data.env b/wazuh-manager/config/permanent_data.env index 34f646c3..0a3ebd35 100644 --- a/wazuh-manager/config/permanent_data.env +++ b/wazuh-manager/config/permanent_data.env @@ -59,7 +59,6 @@ PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/gcloud/gcloud" PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/gcloud/gcloud.py" PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/gcloud/integration.py" PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/gcloud/tools.py" -PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/utils.py" export PERMANENT_DATA_EXCP # Files mounted in a volume that should be deleted