forked from wazuh/wazuh-docker
Ordening code, disable xpack ml feature at elastic. Also the features disabled at kibana are modified
This commit is contained in:
@@ -47,48 +47,4 @@ sleep 5
|
||||
# Do not ask user to help providing usage statistics to Elastic
|
||||
curl -POST "http://kibana:5601/api/telemetry/v1/optIn" -H "Content-Type: application/json" -H "kbn-xsrf: true" -d '{"enabled":false}'
|
||||
|
||||
|
||||
kibana_config_file="/usr/share/kibana/plugins/wazuh/config.yml"
|
||||
if grep -vq "#xpack features" "$kibana_config_file";
|
||||
then
|
||||
|
||||
echo "
|
||||
#xpack features
|
||||
xpack.apm.ui.enabled: false
|
||||
xpack.grokdebugger.enabled: false
|
||||
xpack.searchprofiler.enabled: false
|
||||
xpack.security.enabled: false
|
||||
xpack.graph.enabled: false
|
||||
xpack.ml.enabled: false
|
||||
xpack.monitoring.enabled: false
|
||||
xpack.reporting.enabled: false
|
||||
xpack.watcher.enabled: false
|
||||
" >> /usr/share/kibana/config/kibana.yml
|
||||
|
||||
else
|
||||
|
||||
|
||||
declare -A CONFIG_MAP=(
|
||||
|
||||
[xpack.apm.ui.enabled]= $XPACK_APM
|
||||
[xpack.grokdebugger.enabled]= $XPACK_DEVTOOLS
|
||||
[xpack.searchprofiler.enabled]= $XPACK_DEVTOOLS
|
||||
[xpack.security.enable]= $XPACK_SECURITY
|
||||
[xpack.graph.enabled]= $XPACK_GRAPHS
|
||||
[xpack.ml.enabled]=$XPACK_MACHINELEARNING
|
||||
[xpack.monitoring.enabled]= $XPACK_MONITORING
|
||||
[xpack.reporting.enable]= $XPACK_REPORTING
|
||||
[xpack.watcher.enabled]= $XPACK_WATCHER
|
||||
)
|
||||
|
||||
for i in "${!CONFIG_MAP[@]}"
|
||||
do
|
||||
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||
sed -i 's/.*'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $kibana_config_file
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
|
||||
echo "End settings"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
kibana_config_file="/usr/share/kibana/config/kibana.yml"
|
||||
if grep -Fq "#xpack features" "$kibana_config_file";
|
||||
then
|
||||
declare -A CONFIG_MAP=(
|
||||
[xpack.apm.ui.enabled]=$XPACK_APM
|
||||
[xpack.grokdebugger.enabled]=$XPACK_DEVTOOLS
|
||||
[xpack.searchprofiler.enabled]=$XPACK_DEVTOOLS
|
||||
[xpack.ml.enabled]=$XPACK_ML
|
||||
[xpack.canvas.enabled]=$XPACK_CANVAS
|
||||
[xpack.logstash.enabled]=$XPACK_LOGS
|
||||
[xpack.infra.enabled]=$XPACK_INFRA
|
||||
)
|
||||
for i in "${!CONFIG_MAP[@]}"
|
||||
do
|
||||
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||
sed -i 's/.'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $kibana_config_file
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "
|
||||
#xpack features
|
||||
xpack.apm.ui.enabled: $XPACK_APM
|
||||
xpack.grokdebugger.enabled: $XPACK_DEVTOOLS
|
||||
xpack.searchprofiler.enabled: $XPACK_DEVTOOLS
|
||||
xpack.ml.enabled: $XPACK_ML
|
||||
xpack.canvas.enabled: $XPACK_CANVAS
|
||||
xpack.logstash.enabled: $XPACK_LOGS
|
||||
xpack.infra.enabled: $XPACK_INFRA
|
||||
console.enabled: $XPACK_INFRA
|
||||
" >> $kibana_config_file
|
||||
fi
|
||||
Reference in New Issue
Block a user