3 Commits
Author SHA1 Message Date
Thore Cimbal b989987d69 cve: four rules and three panels guard the derivation (#0106)
Gate 3 planned three rules; there are four. The fourth covers a case the others
miss entirely: every source answers cleanly but empty. Then nothing is missing,
because the desired set is empty, the freshness stamps are current, and nothing
is scanned at all. The Python suite already carries that case as "an empty set
is not the same as success", so the rule belongs with it.

These are the first rule unit tests in this stack. Each rule has a case where it
must fire and one where it must stay silent, because a rule that always fires
cannot be told from a correct one otherwise. Two sabotages confirm the tests
bite: an unreachable threshold on the source-freshness rule makes the expected
alert vanish, and removing the six hour grace period makes the missing-targets
rule fire at five hours where the test demands silence.

The grace period is not padding. A full round over roughly 65 images takes time,
so right after a deploy the gap is real rather than wrong.

The dashboard gains coverage and unscanned-image counters in the two free slots
of the top row, and a source-freshness bar at the bottom, so no existing panel
moves. That bar is the only place where a failed derivation can be told apart
from success.
2026-08-21 12:00:00 +00:00
Thore Cimbal 7ee42f90e6 monitoring: Dashboard fuer blockierte ClamAV-Inhalte (management #0077)
Sichtbar machen, wie oft ClamAV tatsaechlich etwas blockiert - bisher nur in
Logzeilen zu finden.

Zwei Abweichungen vom Issue-Text, beide gemessen statt angenommen:

1. Das Issue schlaegt {app="synapse-main"} vor. Das Label app existiert in
   dieser Loki nicht - Cluster-Logs liegen unter
   job="loki.source.kubernetes.k8s_logs" mit instance="<ns>/<pod>:<container>".
   Die vorgeschlagene Query haette dauerhaft ein leeres Panel ergeben.

2. Das Issue kennt nur das Synapse-Modul. Seit dem Client-seitigen Scannen gibt
   es eine zweite Quelle (clamav-http-scanner), und die ist die wichtigere: Sie
   greift beim Senden UND beim Empfangen und deckt damit auch verschluesselte
   Raeume ab. Das Synapse-Modul sieht nur unverschluesselte Uploads - deshalb
   steht es dort auf null, waehrend der Client sieben Treffer zeigt.

Drittes Panel zeigt Fail-open-Faelle: Ist clamd nicht erreichbar, laesst der
Scanner Dateien bewusst durch. Ohne dieses Panel bliebe genau das unsichtbar -
rot ab dem ersten Fall.

Alle acht Queries gegen die laufende Loki geprueft, nicht nur geschrieben.
2026-08-20 12:00:00 +00:00
Thore CimbalandClaude Fable 5 b6007c50fd 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
2026-08-01 13:42:07 +02:00