Files
vulncheck/app/services
vulncheck 4683f203b3 feat(notifications): SLA-breach digest mode
Mirrors the new-vulnerability digest done in commit e12f111. Hourly
SLA-breach check now collects all overdue findings into per-recipient
buckets and sends one summary mail per person instead of one mail per
(vuln, recipient). Toggled by the existing notification_mode setting
(no separate switch — same dropdown in Settings).

100 overdue vulns × 3 recipients used to fan out to 300 mails per
hour; in digest mode that collapses to 3.

Implementation:
- email_service.send_sla_breach_digest() + render_sla_digest_rows():
  styled red HTML table with severity counts, CVE/severity/host/
  detected/overdue columns, dashboard CTA. Custom template via setting
  email_template_sla_breach_digest.
- scheduler.check_sla_breaches() refactored into two phases:
    1) classify breaches, resolve recipients via the same cascade as
       new-vuln digests, bucket per email
    2) dispatch via send_sla_breach_digest (mode='digest') or fall back
       to per-vuln send_email (mode='single', legacy)
- Per-vuln 24h throttle preserved by writing one NotificationLog row
  per vuln per recipient in both modes — so an hourly tick can't repeat
  the same finding inside the same recipient's digest.
- Mode comes from email_service.get_notification_mode() (reused). No
  new env vars, no migration.
2026-05-13 23:24:45 +02:00
..
2026-02-08 10:15:20 +01:00