Fix wazuh.yml persistence

This commit is contained in:
vcerenu
2022-03-03 14:15:20 -03:00
parent 24de834599
commit 01ce184cd0
8 changed files with 71 additions and 7 deletions
+9 -1
View File
@@ -5,9 +5,14 @@ wazuh_url="${WAZUH_API_URL:-https://wazuh}"
wazuh_port="${API_PORT:-55000}"
api_username="${API_USERNAME:-wazuh-wui}"
api_password="${API_PASSWORD:-wazuh-wui}"
api_run_as="${RUN_AS:-false}"
dashboard_config_file="/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml"
grep -q 1513629884013 $dashboard_config_file
_config_exists=$?
if [[ $_config_exists -ne 0 ]]; then
cat << EOF > $dashboard_config_file
hosts:
- 1513629884013:
@@ -15,6 +20,9 @@ hosts:
port: $wazuh_port
username: $api_username
password: $api_password
run_as: $api_run_as
EOF
else
echo "Wazuh APP already configured"
fi