feat: CrowdSec journald-Acquisition + Alarm-Quittieren/Löschen — v1.3.5

- fix(crowdsec/packaging): postinst setzt die HAProxy-Acquisition deterministisch
  auf die journald-Unit (haproxy.service) statt der cscli-setup-Datei-Default
  (/var/log/haproxy.log existiert nicht → CrowdSec las nichts → HTTP/CVE-Szenarien
  liefen leer). Self-healing auf jedem configure; admin-Custom bleibt unangetastet.
- feat(alerts): Alarme (alert_events) bulk quittieren + löschen. Migration 0045
  (acknowledged_at + Teil-Index). Dashboard-Karte zählt nur noch OFFENE (open=true)
  → Quittieren lässt die "Aktuelle Alerts"-Meldung verschwinden, History bleibt.
  Events-Tab: Row-Selection, Quittieren/Löschen (Auswahl) + "Alle quittieren",
  Status-Spalte (offen/quittiert). Audit-geloggt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-07-31 10:58:27 +02:00
parent 0ac91a7c59
commit dca40761a4
10 changed files with 279 additions and 42 deletions

View File

@@ -823,6 +823,37 @@ EOSQL
fi
fi
# ── CrowdSec HAProxy-Acquisition auf journald zeigen ──────────
# EdgeGuards HAProxy loggt nach journald (log /dev/log local0/1) —
# es gibt KEINE /var/log/haproxy.log. `cscli setup` rät aber auf eine
# datei-basierte Quelle → CrowdSec liest nichts → die HTTP-/CVE-
# Szenarien laufen leer (WAF-artiger Web-Schutz tot). Wir setzen die
# Acquisition deterministisch auf die haproxy.service-Journal-Unit
# (analog zur sshd-Quelle). Läuft auf JEDEM configure (self-healing
# auch für Bestandsinstalls). Admin-Custom bleibt unangetastet: nur
# überschreiben, wenn Datei fehlt / noch die kaputte Datei-Default
# (/var/log/haproxy.log) enthält / von uns stammt.
if command -v cscli >/dev/null 2>&1; then
CS_HAPROXY_ACQUIS="/etc/crowdsec/acquis.d/setup.haproxy.yaml"
if [ ! -f "$CS_HAPROXY_ACQUIS" ] \
|| grep -q '/var/log/haproxy.log' "$CS_HAPROXY_ACQUIS" 2>/dev/null \
|| grep -q 'Managed by EdgeGuard' "$CS_HAPROXY_ACQUIS" 2>/dev/null; then
install -d -m 0755 /etc/crowdsec/acquis.d
cat > "$CS_HAPROXY_ACQUIS" <<'ACQUIS'
# Managed by EdgeGuard. HAProxy loggt nach journald (log /dev/log local0/1),
# es gibt keine /var/log/haproxy.log. journalctl-Quelle analog zur sshd-Acquis.
source: journalctl
journalctl_filter:
- "_SYSTEMD_UNIT=haproxy.service"
labels:
type: haproxy
ACQUIS
# SIGHUP-Reload lädt die Acquisition neu; Restart als Fallback.
systemctl reload crowdsec 2>/dev/null \
|| systemctl restart crowdsec 2>/dev/null || true
fi
fi
# ── Render initial service configs ───────────────────────────
# Writes /etc/edgeguard/haproxy/haproxy.cfg + nftables.d/
# ruleset.nft from the (just-migrated, empty) PG state.