monitoring: CVE-Pipeline v1 (gitops#47) - Scanner, Exporter, Regeln, Routing, Dashboard
- cve-scan: Trivy-Loop ueber die 29 real deployten Images (Cluster-Inventur 2026-08-01 + Prod-Web-Image); 24h-Intervall, Fehler einzelner Images blockieren nicht - cve-exporter: Stdlib-Exporter mit first_seen-State (Zeitstrahl), Schema trivy_vuln_info/_count/_first_seen/_last_scan gemaess Pflichtfeldern - 3 Alertregeln (CRITICAL sofort, HIGH mit 24h-Daempfung, Scan-Frische) - promtool SUCCESS 9 rules; alle mit room=security - matrix-alerts: Label-basiertes Raum-Routing (MATRIX_ROOM_<NAME>), Edits landen im richtigen Raum via State - Grafana-Dashboard cve-overview: Severity-Stats, CVE-Tabelle mit NVD-Link/Fix-Version/first-seen, Zeitstrahl, Verlauf UNGETESTET bis zum Deploy auf CFGMON (compose up -d). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKhFj1S3UdD6xL2fbWPeYj
This commit is contained in:
co-authored by
Claude Fable 5
parent
f45e01219b
commit
b6007c50fd
@@ -45,6 +45,8 @@ services:
|
||||
- MATRIX_HOMESERVER=${MATRIX_ALERT_HOMESERVER}
|
||||
- MATRIX_ROOM_ID=${MATRIX_ALERT_ROOM_ID}
|
||||
- MATRIX_TOKEN=${MATRIX_ALERT_TOKEN}
|
||||
# Raum-Routing (gitops#47): Alerts mit Label room=security -> Security-Raum
|
||||
- MATRIX_ROOM_SECURITY=${MATRIX_RELEASE_ROOM_ID:-}
|
||||
# Ohne das liegt der State unter /tmp im Writable Layer: der ueberlebt
|
||||
# zwar ein "compose restart", aber kein "up -d", das den Container neu
|
||||
# baut -- also genau jeden Deploy. Dann verlieren offene Alarme ihre
|
||||
@@ -78,6 +80,36 @@ services:
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
# CVE-Pipeline (gitops#47), Teil 1: Trivy scannt die real deployten Images
|
||||
# (cve/images.txt - Inventur aus dem Cluster, bei Stack-Aenderungen nachziehen)
|
||||
cve-scan:
|
||||
image: aquasec/trivy:0.58.2
|
||||
container_name: cve-scan
|
||||
restart: unless-stopped
|
||||
entrypoint: ["/bin/sh", "/config/scan-loop.sh"]
|
||||
volumes:
|
||||
- ./cve:/config:ro
|
||||
- cve_results:/results
|
||||
- cve_trivy_cache:/root/.cache
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
# Teil 2: Reports -> Prometheus-Metriken (Schema + Pflichtfelder siehe gitops#47)
|
||||
cve-exporter:
|
||||
image: python:3.13-slim
|
||||
container_name: cve-exporter
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- RESULTS_DIR=/results
|
||||
- STATE_FILE=/state/first-seen.json
|
||||
volumes:
|
||||
- ./cve/cve-exporter.py:/app/cve-exporter.py:ro
|
||||
- cve_results:/results:ro
|
||||
- cve_exporter_state:/state
|
||||
command: python3 /app/cve-exporter.py
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
loki:
|
||||
image: grafana/loki:3.7.1
|
||||
container_name: loki
|
||||
@@ -166,6 +198,9 @@ volumes:
|
||||
alertmanager_data:
|
||||
matrix_alerts_data:
|
||||
release_watch_data:
|
||||
cve_results:
|
||||
cve_trivy_cache:
|
||||
cve_exporter_state:
|
||||
grafana_data:
|
||||
loki_data:
|
||||
alloy_data:
|
||||
|
||||
Reference in New Issue
Block a user