auth key
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 39s

This commit is contained in:
Your Name
2025-09-20 09:16:27 +12:00
parent 47a51ec176
commit 9d8088a156
7 changed files with 243 additions and 66 deletions

View File

@@ -31,10 +31,12 @@ docker pull docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION} || _die
docker pull docker.elastic.co/logstash/logstash:${LS_VERSION} || _die "Failed to pull Logstash"
docker pull docker.elastic.co/kibana/kibana:${KIBANA_VERSION} || _die "Failed to pull Kibana"
# Generate certificates if using mTLS
if [ "$AUTH_MODE" = "mtls" ]; then
bash ./scripts/generate-ca.sh || _die "Failed to generate CA certificate"
bash ./scripts/generate-server-cert.sh || _die "Failed to generate server certificate"
# Initialize API keys file if it doesn't exist
if [ ! -f "${CONFIG_PATH}/api-keys.yml" ]; then
echo "No API keys configured yet."
echo "Run ./generate-api-key.sh to add client keys"
mkdir -p "${CONFIG_PATH}"
echo "api_keys:" > "${CONFIG_PATH}/api-keys.yml"
fi
# Start the ELK stack
@@ -55,8 +57,6 @@ echo "Username: elastic"
echo "Password: ${KIBANA_PASSWORD}"
echo ""
echo "Logstash listening on port ${LOGSTASH_BEATS_PORT} for Filebeat clients"
if [ "$AUTH_MODE" = "mtls" ]; then
echo "Authentication: mTLS (generate client certs with ./scripts/generate-client-cert.sh)"
elif [ "$AUTH_MODE" = "apikey" ]; then
echo "Authentication: API Keys (generate with ./scripts/generate-api-key.sh)"
fi
echo ""
echo "To add client authentication:"
echo " ./generate-api-key.sh"