clusev/lang/de
boban 0472b3531a feat(alerts): threshold alerting + notifications (feature 2/8)
Turns the existing metrics into an ops tool: rules that fire when a server crosses a
threshold and resolve when it recovers, with e-mail + webhook notifications. The event
sink later features (cert-expiry, uptime-down, patch-available, posture-drop) plug into.

- alert_rules (metric cpu|mem|disk|load|offline, comparator gt|lt, threshold, scope
  all|group|server) + alert_incidents (firing|resolved, FK cascade).
- AlertEvaluator — per-server state machine: opens ONE firing incident on a fresh breach
  (notifies), resolves on recovery (notifies), dedups a sustained breach (one breach = one
  alert). Numeric metrics skip a truly-offline server (stale reading); the `offline` rule
  fires only on offline, not a reachable "warning".
- AlertNotifier — best-effort e-mail (queued Mailable to configured recipients, falls back
  to admin e-mails) + generic webhook JSON POST (Slack/Discord/Mattermost/custom; only http(s)
  URLs). Every channel is wrapped so a broken SMTP/unreachable hook is logged, never thrown.
- PollMetrics evaluates after each poll (online, fresh status) and on a failed poll (offline),
  each guarded so an alerting error can never kill the poll loop.
- Alerts\Index page, manage-panel (admin): route can:-mw + mount() + per-method gate() on every
  mutation. Rule delete via signed ConfirmToken + R5 modal (no double audit). Scope group/server
  resolves a client UUID to an id server-side (never trusts a client id). Channels saved to
  Settings. Sidebar "Alarme" nav + firing-incident badge (cached 60s).
- lang/{de,en}/alerts.php + audit.php alert.* + shell.nav_alerts (de/en parity). No emoji.

Codex review raised three MEDIUMs, all fixed here:
- Webhook SSRF: strict http(s) scheme + reject hosts resolving to loopback/private/link-local/
  reserved ranges (blocks the 169.254.169.254 cloud-metadata classic), validated at save AND send,
  redirects disabled — so an admin-configured hook can't be pointed at an internal service.
- Incident dedup is now a DB invariant: a unique `firing_key` ("{rule}:{server}" while firing,
  null on resolve) means two concurrent poll ticks can't both open a duplicate incident (the loser
  hits a unique violation, caught → no-op).
- `load` is float-safe: threshold + incident value are decimal, compared as floats, so load 1.5 vs
  threshold 1 fires (it used to truncate to 1 > 1 = false).

31 new tests: evaluator (fire/resolve/dedup, offline vs warning, scope all/group/server, disabled,
fractional-load, firing_key unique, key-freed-on-resolve), notifier (email/fallback/webhook/
non-http-ignored/failure-swallowed/SSRF-reject/public-accept), component (RBAC route gating, rule
CRUD, uuid→id scope resolve, offline→threshold 0, toggle, delete via token, channels, unsafe-webhook
rejected, incidents render). 669 tests green, Pint, lang parity, Codex-reviewed (fixes applied).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 20:07:54 +02:00
..
accounts.php feat(rbac): user-management roles UI — role badge, selector, role-change with last-admin guard 2026-07-05 01:15:32 +02:00
alerts.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
audit.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
auth.php docs: fix stale first-login copy (random initial password, rotation optional) 2026-07-02 22:50:35 +02:00
backend.php fix(hardening): guard against root-login self-lockout 2026-06-25 00:41:50 +02:00
common.php chore: remove dead code — sidecar host-PTY path, node-pty, unused lang keys + component 2026-06-26 07:16:11 +02:00
dashboard.php perf(fleet,wg) + i18n(dashboard,update) + a11y(btn): re-audit design/perf cleanups 2026-07-05 17:10:19 +02:00
errors.php feat(auth): guests-only BlockBannedIp middleware + 403 page 2026-06-20 17:45:16 +02:00
files.php feat(branding): favicons + PWA manifest, and custom branded error pages 2026-06-14 15:27:49 +02:00
groups.php feat(fleet): server groups — organise the fleet + filter (feature 1/8) 2026-07-05 19:36:17 +02:00
help.php feat(wg): WireGuard help topic (registration + DE/EN content + test) 2026-06-20 22:46:04 +02:00
mail.php fix(security): harden brute-force, rate-limiting and auth-DoS (audit follow-up) 2026-06-17 17:59:45 +02:00
modals.php fix(security): keep internal IPs out of shipped code and docs/ out of the public image 2026-07-04 10:25:10 +02:00
onboarding.php feat(onboarding): first-run spotlight tour — dimmed backdrop, sidebar highlights, relaunchable 2026-07-02 20:00:19 +02:00
release.php refactor(release): single stable channel — cut internal release candidates (-rc), remove all beta wording 2026-07-05 13:13:09 +02:00
roles.php feat(rbac): role enum + column + gates foundation (admin>operator>viewer) 2026-07-05 00:42:16 +02:00
servers.php chore: remove dead code — sidecar host-PTY path, node-pty, unused lang keys + component 2026-06-26 07:16:11 +02:00
services.php fix(services): live journal poll + command-palette server search 2026-06-14 20:13:08 +02:00
sessions.php feat(sessions): database sessions + list/revoke (other devices, per-user, global) with remember-token rotation 2026-06-14 23:34:00 +02:00
settings.php harden(opsec): disguise the honeypot naming on the Threats + settings pages too 2026-07-05 19:06:46 +02:00
shell.php feat(alerts): threshold alerting + notifications (feature 2/8) 2026-07-05 20:07:54 +02:00
system.php feat(release): remove the no-op channel selector + dead beta→stable promotion (single stable channel) 2026-07-03 20:43:15 +02:00
terminal.php feat(ui): shield-only 2FA indicator in the sidebar + terminal search from 2 servers 2026-06-25 20:20:46 +02:00
threats.php harden(opsec): disguise the honeypot naming on the Threats + settings pages too 2026-07-05 19:06:46 +02:00
update.php perf(fleet,wg) + i18n(dashboard,update) + a11y(btn): re-audit design/perf cleanups 2026-07-05 17:10:19 +02:00
validation.php feat(i18n): custom bilingual validation messages (DE + EN) 2026-06-14 15:45:02 +02:00
versions.php feat(versions): show the available release's changelog before updating (v0.9.49) 2026-06-21 23:48:37 +02:00
wireguard.php fix(security): keep internal IPs out of shipped code and docs/ out of the public image 2026-07-04 10:25:10 +02:00