From 22ad4360f548e54bb0c5e929f8c84a186ad2ab88 Mon Sep 17 00:00:00 2001 From: manuasir Date: Mon, 3 Jun 2019 17:20:11 +0200 Subject: [PATCH] Add XPACK_SECURITY_ENABLED and KIBANA_INDEX options to Kibana container. --- kibana/config/kibana_settings.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kibana/config/kibana_settings.sh b/kibana/config/kibana_settings.sh index 96e5f35b..fb5768e5 100644 --- a/kibana/config/kibana_settings.sh +++ b/kibana/config/kibana_settings.sh @@ -20,7 +20,22 @@ WAZUH_MAJOR=3 ############################################################################## if [ "$ELASTICSEARCH_KIBANA_IP" != "" ]; then sed -i 's|http://elasticsearch:9200|'$ELASTICSEARCH_KIBANA_IP'|g' /usr/share/kibana/config/kibana.yml +fi + +# If KIBANA_INDEX was set, then change the default index in kibana.yml configuration file. If there was an index, then delete it and recreate. +if [ "$KIBANA_INDEX" != "" ]; then + if grep -q 'kibana.index' /usr/share/kibana/config/kibana.yml; then + sed -i '/kibana.index/d' /usr/share/kibana/config/kibana.yml + fi + echo "kibana.index: $KIBANA_INDEX" >> /usr/share/kibana/config/kibana.yml +fi +# If XPACK_SECURITY_ENABLED was set, then change the xpack.security.enabled option from true (default) to false. +if [ "$XPACK_SECURITY_ENABLED" != "" ]; then + if grep -q 'xpack.security.enabled' /usr/share/kibana/config/kibana.yml; then + sed -i '/xpack.security.enabled/d' /usr/share/kibana/config/kibana.yml + fi + echo "xpack.security.enabled: $XPACK_SECURITY_ENABLED" >> /usr/share/kibana/config/kibana.yml fi if [ "$KIBANA_IP" != "" ]; then