Files
computer-playbook/roles/web-app-wazuh/files/shell/indexer-entrypoint.sh
Prageeth Panicker 4b07cc7999 fix(web-app-wazuh): require CA_TRUST_NAME instead of falling back to a dev CA name
The platform always sets CA_TRUST_NAME together with CA_TRUST_CERT, so the infinito-dev-ca default was dead code that could hide a missing setting. The entrypoint now fails with a clear message instead.
2026-10-09 08:12:12 +00:00

12 lines
526 B
Bash
Executable File

#!/usr/bin/env bash
if [ -n "${CA_TRUST_CERT:-}" ] && [ -r "${CA_TRUST_CERT}" ]; then
CACERTS="/usr/share/wazuh-indexer/jdk/lib/security/cacerts"
ALIAS="${CA_TRUST_NAME:?CA_TRUST_NAME must accompany CA_TRUST_CERT}"
KEYTOOL="/usr/share/wazuh-indexer/jdk/bin/keytool"
if ! "$KEYTOOL" -list -keystore "$CACERTS" -storepass changeit -alias "$ALIAS" >/dev/null 2>&1; then
"$KEYTOOL" -importcert -noprompt -alias "$ALIAS" -file "$CA_TRUST_CERT" -keystore "$CACERTS" -storepass changeit
fi
fi
exec /entrypoint.sh "$@"