From 62cbd2ef1ef55086ce8ae8b68fe3cca1dfea336c Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Mon, 27 Jul 2026 14:36:19 +0200 Subject: [PATCH] fix: Crowdsec lookup chart workaround --- infrastructure/crowdsec/helm-release.yaml | 10 ++++-- .../external-secrets/resources/crowdsec.yaml | 31 +++---------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/infrastructure/crowdsec/helm-release.yaml b/infrastructure/crowdsec/helm-release.yaml index 5c0d364..952ef42 100644 --- a/infrastructure/crowdsec/helm-release.yaml +++ b/infrastructure/crowdsec/helm-release.yaml @@ -28,6 +28,12 @@ spec: - name: COLLECTIONS value: "crowdsecurity/traefik" + secrets: + externalSecret: + name: crowdsec-lapi-secret + csLapiSecretKey: "CS_LAPI_SECRET" + registrationTokenKey: "REGISTRATION_TOKEN" + lapi: replicas: 2 storeCAPICredentialsInSecret: true @@ -52,7 +58,7 @@ spec: server: auto_registration: # Activate if not using TLS for authentication enabled: true - token: "${REGISTRATION_TOKEN}" # /!\ Do not modify this variable (auto-generated and handled by the chart) + token: "${CROWDSEC_REGISTRATION_TOKEN}" # /!\ Do not modify this variable (Cluster K8S gitlab var) allowed_ranges: # /!\ Make sure to adapt to the pod IP ranges used by your cluster - "127.0.0.1/32" - "192.168.0.0/16" @@ -61,7 +67,7 @@ spec: db_config: type: mysql user: crowdsec - password: ${DB_PWD} + password: ${CROWDSEC_DB_PWD} db_name: crowdsec host: ${DB_HOST} port: ${DB_PORT} diff --git a/infrastructure/hashicorp-vault/external-secrets/resources/crowdsec.yaml b/infrastructure/hashicorp-vault/external-secrets/resources/crowdsec.yaml index 6440cef..bc00467 100644 --- a/infrastructure/hashicorp-vault/external-secrets/resources/crowdsec.yaml +++ b/infrastructure/hashicorp-vault/external-secrets/resources/crowdsec.yaml @@ -12,6 +12,10 @@ spec: name: crowdsec-lapi-secret creationPolicy: Owner data: + - secretKey: CS_LAPI_SECRET + remoteRef: + key: secret/data/crowdsec/lapi + property: CS_LAPI_SECRET - secretKey: REGISTRATION_TOKEN remoteRef: key: secret/data/crowdsec/lapi @@ -32,30 +36,3 @@ spec: remoteRef: key: secret/data/crowdsec/lapi property: BOUNCER_KEY_traefik ---- -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: crowdsec-db-secret - namespace: common-services -spec: - refreshInterval: 15s - secretStoreRef: - name: vault-secret-store - kind: ClusterSecretStore - target: - name: crowdsec-db-secret - creationPolicy: Owner - data: - - secretKey: DB_HOST - remoteRef: - key: secret/data/crowdsec/db - property: DB_HOST - - secretKey: DB_PORT - remoteRef: - key: secret/data/crowdsec/db - property: DB_PORT - - secretKey: DB_PWD - remoteRef: - key: secret/data/crowdsec/db - property: DB_PWD