Helm Charts / Detect changed charts (push) Successful in 11s
Helm Charts / Library charts tool (push) Skipped
Helm Charts / Application charts alloy (push) Skipped
Helm Charts / Application charts chart (push) Skipped
Helm Charts / Application charts grafana (push) Skipped
Helm Charts / Application charts hashicorp-vault (push) Skipped
Helm Charts / Application charts loki (push) Skipped
Helm Charts / Application charts minio (push) Skipped
Helm Charts / Application charts pgbouncer (push) Skipped
Helm Charts / Application charts pgcat (push) Skipped
Helm Charts / Application charts prometheus (push) Skipped
Helm Charts / Application charts redis (push) Skipped
Helm Charts / Application charts crowdsec (push) Successful in 29s
Co-authored-by: Gabriel Radureau <[email protected]>
138 lines
5.3 KiB
YAML
138 lines
5.3 KiB
YAML
crowdsec: &crowdsec_config
|
|
# for raw logs format: json or cri (docker|containerd)
|
|
container_runtime: docker
|
|
agent:
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: node-role.kubernetes.io/control-plane
|
|
operator: Exists
|
|
# Specify each pod whose logs you want to process
|
|
acquisition:
|
|
# The namespace where the pod is located
|
|
- namespace: kube-system
|
|
# The pod name
|
|
podName: traefik-*
|
|
# as in crowdsec configuration, we need to specify the program name to find a matching parser
|
|
program: traefik
|
|
env:
|
|
- name: COLLECTIONS
|
|
value: "crowdsecurity/traefik crowdsecurity/http-cve"
|
|
- name: TZ
|
|
value: Europe/Paris
|
|
lapi:
|
|
strategy:
|
|
type: Recreate
|
|
env:
|
|
- name: TZ
|
|
value: Europe/Paris
|
|
# ⚠ NOM DE MACHINE STABLE — NE PAS REVENIR AU NOM DU POD.
|
|
#
|
|
# Le chart amont code en dur `CUSTOM_HOSTNAME` sur `metadata.name`
|
|
# (templates/lapi-deployment.yaml). L'entrypoint s'en sert pour
|
|
# enregistrer la LAPI en base :
|
|
# si .login du fichier d'identifiants == CUSTOM_HOSTNAME et que la
|
|
# machine existe déjà → « Local agent already registered », rien à faire ;
|
|
# sinon → cscli machines delete <CUSTOM_HOSTNAME> puis add.
|
|
# Le `delete` ne porte QUE sur le nom courant : l'enregistrement de
|
|
# l'ancien pod, lui, n'est jamais supprimé.
|
|
#
|
|
# Or le pod change de nom bien plus souvent qu'on ne le croit. Ce n'est pas
|
|
# une histoire de redémarrages — un redémarrage garde le nom. C'est le
|
|
# `rolloutRestartTargets` du VaultDynamicSecret (templates/
|
|
# vaultdynamicsecret.yaml) : à chaque rotation de l'identifiant Postgres,
|
|
# VSO force un rollout, ce qui change le pod template, donc le hash du
|
|
# ReplicaSet, donc le nom du pod.
|
|
#
|
|
# Mesuré le 2026-09-20 : 594 enregistrements `crowdsec-lapi-*` en base
|
|
# depuis le 2025-12-05, pour 571 hashes de ReplicaSet distincts — soit
|
|
# 2,05 par jour, sur 290 jours, et une seule LAPI vivante à la fois.
|
|
# Ils s'entassent dans le PostgreSQL externe de pi2, celui-là même qui a
|
|
# refusé des connexions le 2026-09-20 (SQLSTATE 53300) et fait crasher la
|
|
# LAPI 3 fois.
|
|
#
|
|
# Avec un nom fixe, le premier démarrage fait delete+add sur CE nom, et
|
|
# tous les suivants tombent sur « already registered » — plus aucune
|
|
# écriture. Le fichier d'identifiants survit d'ailleurs aux redémarrages
|
|
# (/etc/crowdsec est un lien vers le PVC crowdsec-config), donc la
|
|
# comparaison sur `.login` tient dans le temps.
|
|
#
|
|
# ⚠ Cette entrée DOIT rester dans `lapi.env` : le chart émet sa propre
|
|
# définition de CUSTOM_HOSTNAME AVANT d'injecter `.Values.lapi.env`, et en
|
|
# cas de doublon Kubernetes retient la DERNIÈRE. C'est ce qui permet de
|
|
# surcharger un champ que le chart n'expose pas. `kubectl apply` avertit
|
|
# « hides previous definition », c'est attendu.
|
|
#
|
|
# Ne pas « corriger » en supprimant le rolloutRestartTargets : les
|
|
# identifiants arrivent par secretKeyRef, qui ne se recharge pas à chaud.
|
|
# Sans rollout, la LAPI garderait des identifiants révoqués par Vault.
|
|
- name: CUSTOM_HOSTNAME
|
|
value: crowdsec-lapi
|
|
# To enroll the Security Engine to the console
|
|
- name: ENROLL_KEY
|
|
value: "cmieq72i3000802jr1wx8kply"
|
|
- name: ENROLL_INSTANCE_NAME
|
|
value: "homelab"
|
|
- name: ENROLL_TAGS
|
|
value: "k3s rpi test"
|
|
- name: DB_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: crowdsec-db-credentials
|
|
key: username
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: crowdsec-db-credentials
|
|
key: password
|
|
appsec:
|
|
enabled: true
|
|
acquisitions:
|
|
- appsec_config: crowdsecurity/appsec-default
|
|
labels:
|
|
type: appsec
|
|
listen_addr: 0.0.0.0:7422
|
|
path: /
|
|
source: appsec
|
|
env:
|
|
- name: TZ
|
|
value: Europe/Paris
|
|
- name: COLLECTIONS
|
|
value: "crowdsecurity/appsec-virtual-patching crowdsecurity/appsec-generic-rules"
|
|
resources:
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "300Mi"
|
|
requests:
|
|
cpu: "100m"
|
|
memory: "200Mi"
|
|
config:
|
|
config.yaml.local: |
|
|
db_config:
|
|
type: postgresql
|
|
user: ${DB_USER}
|
|
password: ${DB_PASSWORD}
|
|
db_name: crowdsec
|
|
host: pgbouncer.tools
|
|
port: 5432
|
|
api:
|
|
server:
|
|
auto_registration: # Activate if not using TLS for authentication
|
|
enabled: true
|
|
token: "${REGISTRATION_TOKEN}" # /!\ do not change
|
|
allowed_ranges: # /!\ adapt to the pod IP ranges used by your cluster
|
|
- "127.0.0.1/32"
|
|
- "192.168.0.0/16"
|
|
- "10.42.0.0/16"
|
|
- "172.16.0.0/12"
|
|
|
|
tool:
|
|
# kind: 'SubChart' or 'HelmChart', if subchart then uncomment Chart.yaml dependency, else comment and use tool library with helm chart template
|
|
kind: 'SubChart'
|
|
repo: https://crowdsecurity.github.io/helm-charts
|
|
chart: crowdsec
|
|
version: 0.20.1
|
|
values: *crowdsec_config
|