add ism policies

This commit is contained in:
vcerenu
2023-11-14 05:49:35 -03:00
parent a68da465d3
commit b55cfaa9a0
6 changed files with 24 additions and 3 deletions
+5 -1
View File
@@ -35,6 +35,8 @@ ENV USER="wazuh-indexer" \
NAME="wazuh-indexer" \
INSTALL_DIR="/usr/share/wazuh-indexer"
RUN apt-get update -y && apt-get install curl -y
RUN getent group $GROUP || groupadd -r -g 1000 $GROUP
RUN useradd --system \
@@ -52,7 +54,9 @@ COPY config/entrypoint.sh /
COPY config/securityadmin.sh /
RUN chmod 700 /entrypoint.sh && chmod 700 /securityadmin.sh
COPY config/ism-check.sh /
RUN chmod 700 /entrypoint.sh && chmod 700 /securityadmin.sh && chmod 700 /ism-check.sh
RUN chown 1000:1000 /*.sh
@@ -90,4 +90,6 @@ fi
# touch "/var/lib/wazuh-indexer/.flag"
#fi
nohup /ism-check.sh &
run_as_other_user_if_needed /usr/share/wazuh-indexer/bin/opensearch <<<"$KEYSTORE_PASSWORD"
@@ -0,0 +1,10 @@
#!/bin/bash
if [[ -n "$INDEXER_PASSWORD" ]]; then
until [[ `curl -XGET https://0.0.0.0:9200/_cat/indices -u admin:SecretPassword -k -s | grep .opendistro_security | wc -l` -eq 1 ]]
do
echo "Wazuh indexer Security is not initiaized";
sleep 30
done
bash /usr/share/wazuh-indexer/bin/indexer-ism-init.sh -i 127.0.0.1 -p $INDEXER_PASSWORD
fi