forked from wazuh/wazuh-docker
Fix PR
This commit is contained in:
@@ -55,8 +55,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 443:443
|
- 443:443
|
||||||
environment:
|
environment:
|
||||||
- ELASTICSEARCH_USERNAME=admin
|
- INDEXER_USERNAME=admin
|
||||||
- ELASTICSEARCH_PASSWORD=admin
|
- INDEXER_PASSWORD=admin
|
||||||
- SERVER_SSL_ENABLED=false
|
- SERVER_SSL_ENABLED=false
|
||||||
- WAZUH_API_URL=https://wazuh.manager
|
- WAZUH_API_URL=https://wazuh.manager
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
+2
-2
@@ -52,8 +52,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 443:443
|
- 443:443
|
||||||
environment:
|
environment:
|
||||||
- ELASTICSEARCH_USERNAME=admin
|
- INDEXER_USERNAME=admin
|
||||||
- ELASTICSEARCH_PASSWORD=admin
|
- INDEXER_PASSWORD=admin
|
||||||
- WAZUH_API_URL=https://wazuh.manager
|
- WAZUH_API_URL=https://wazuh.manager
|
||||||
depends_on:
|
depends_on:
|
||||||
- wazuh1.indexer
|
- wazuh1.indexer
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2)
|
# Wazuh Docker Copyright (C) 2021 Wazuh Inc. (License GPLv2)
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Files created by Elasticsearch should always be group writable too
|
|
||||||
umask 0002
|
umask 0002
|
||||||
|
|
||||||
export USER=wazuh-indexer
|
export USER=wazuh-indexer
|
||||||
@@ -52,29 +51,29 @@ fi
|
|||||||
# the values being specified explicitly when running the container.
|
# the values being specified explicitly when running the container.
|
||||||
#
|
#
|
||||||
# This is also sourced in opensearch-env, and is only needed here
|
# 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.
|
# is idempotent.
|
||||||
source /usr/share/wazuh-indexer/bin/opensearch-env-from-file
|
source /usr/share/wazuh-indexer/bin/opensearch-env-from-file
|
||||||
|
|
||||||
if [[ -f bin/opensearch-users ]]; then
|
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.
|
# bootstrap password for Security.
|
||||||
#
|
#
|
||||||
# This is only required for the first node in a cluster with 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
|
# enabled, but we have no way of knowing which node we are yet. We'll just
|
||||||
# honor the variable if it's present.
|
# 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)
|
[[ -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
|
if ! (run_as_other_user_if_needed opensearch-keystore has-passwd --silent) ; then
|
||||||
# keystore is unencrypted
|
# keystore is unencrypted
|
||||||
if ! (run_as_other_user_if_needed opensearch-keystore list | grep -q '^bootstrap.password$'); then
|
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
|
fi
|
||||||
else
|
else
|
||||||
# keystore requires password
|
# keystore requires password
|
||||||
if ! (run_as_other_user_if_needed echo "$KEYSTORE_PASSWORD" \
|
if ! (run_as_other_user_if_needed echo "$KEYSTORE_PASSWORD" \
|
||||||
| opensearch-keystore list | grep -q '^bootstrap.password$') ; then
|
| 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')
|
(run_as_other_user_if_needed echo "$COMMANDS" | opensearch-keystore add -x 'bootstrap.password')
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -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/gcloud.py"
|
||||||
PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/gcloud/integration.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/gcloud/tools.py"
|
||||||
PERMANENT_DATA_EXCP[((i++))]="/var/ossec/wodles/utils.py"
|
|
||||||
export PERMANENT_DATA_EXCP
|
export PERMANENT_DATA_EXCP
|
||||||
|
|
||||||
# Files mounted in a volume that should be deleted
|
# Files mounted in a volume that should be deleted
|
||||||
|
|||||||
Reference in New Issue
Block a user