Notification Channels
Admins can send the notification events to a generic webhook, a Slack channel or a Microsoft Teams channel: new findings above a threshold, known exploited vulnerabilities and SLA breaches, with retries and a delivery log.
Channel Types
Channels are managed by admins in Settings > Notification channels (managers and viewers do not see the card; the API answers 403). Three types are available:
- Webhook: a versioned JSON document POSTed to any HTTP(S) endpoint, signed with HMAC-SHA256
- Slack: a Block Kit message for a Slack incoming webhook URL
- Microsoft Teams: an Adaptive Card (version 1.4) for a Teams incoming webhook / Workflows URL
Note: Each channel has a name, a type, a URL, the events it receives, a minimum severity (default High), the environments in scope (empty: all environments) and an Active switch. An inactive channel receives nothing (Send test still works).

Events
The events come from the same registry as the notification preferences (/docs/notifications/preferences): an event type registered in the backend (apps/notifications/events.py) is listed automatically by GET /api/v1/notifications/event-types/ and can be selected for channels and preferences.
- finding.created: at the end of a matcher run, one event per CVE with at least one new open finding in the channel scope at or above the minimum severity (event key cve:<id>)
- finding.kev: a CVE with new findings in scope that is in the CISA KEV catalog, whatever its severity (sent when finding.created does not apply)
- finding.sla_breached: every hour at minute 10 (beat dispatch-sla-breach-notifications), one event per open or acknowledged finding whose due date passed in the last 7 days, at or above the minimum severity and in scope (event key sla:<finding id>:<due date>); at most 50 per channel per run, the oldest first
- service.critical: after every health computation of the business services (about every 5 minutes), a service of a notified tier (SERVICE_NOTIFY_TIERS, default tier-1) whose environment is in the channel scope, critical and not already sent to the channel as critical (event key svc:<service id>:critical:<since>)
- service.recovered: the same service healthy again after a critical event (event key svc:<service id>:recovered:<since>); degraded and unknown are not sent
- coverage.source_stalled: every 10 minutes (beat detect-stalled-sources), one event per new stall episode of a zone, relay, agent scan or feed (event key stall:<episode id>); at most 50 per channel per run, the oldest first; the channel scope does not apply
Note: A CVE event lists every open finding of the CVE in the channel scope (first 20 hosts, then "more_hosts"). Each event is sent at most once per channel. The minimum severity does not apply to the service and source events. A service that flaps is sent at most once every SERVICE_NOTIFY_COOLDOWN_MINUTES (default 15) per channel, and its final state is always sent. Channels created before these events existed do not include them: edit the channel to select them. Service events carry data {service_id, service, tier, status, reason, since, link}, source events {kind, source_id, source, cause, started_at, link}; Slack and Teams render them with the generic layout (one fact per value). Email is not used for these events.
Burst Protection
When one matcher run produces more than NOTIFICATION_BURST_LIMIT (default 10) CVE events for a channel, the channel receives ONE finding.created event instead of one event per CVE. Its data has cve_count and cves (each {cve_id, severity, kev, host_count, priority_band, link}, most severe first) instead of cve_id, and link points to /dashboard/security?status=open. The event key is burst:<time of the dispatch>.
- Slack and Teams render it as "AsPeekIt: <N> new vulnerabilities" with one fact per CVE (severity, hosts, "Known exploited") for the first 10 CVEs, then "More: <N> more CVEs in the queue"
- A webhook receives the full cves list in the JSON body
- CVEs already sent to the channel are not counted
{
"version": "1",
"event": "finding.created",
"event_key": "burst:2026-12-01T12:00:00+00:00",
"test": false,
"sent_at": "2026-12-01T12:00:05+00:00",
"data": {
"cve_count": 42,
"cves": [{"cve_id": "CVE-2026-0001", "severity": "critical", "kev": true, "host_count": 3,
"priority_band": "P1", "link": "https://aspeekit.example.com/dashboard/security?cve=CVE-2026-0001&status=open"}],
"link": "https://aspeekit.example.com/dashboard/security?status=open"
}
}Scope
A channel scope is a list of deployment environments: a finding matches when its asset belongs to one of them. An empty scope matches every environment; an asset without environment matches only an empty scope. Channels have no team scope.
URL Safety (SSRF)
The URL is validated when the channel is created or edited (400 on the url field) and again before every delivery. Only http and https are accepted; private and loopback addresses are rejected, also when the hostname resolves to them. Requests do not follow redirects and time out after 10 s.
- NOTIFICATION_CHANNEL_PRIVATE_ALLOWLIST (environment variable, comma separated, default empty) lists exact hostnames and CIDR networks allowed even if private, for example hooks.internal,10.20.0.0/16
- Cloud metadata and link-local targets (169.254.0.0/16, metadata.google.internal, ...) are always blocked, allowlisted or not
Encryption
The URL (which often embeds a token) and the webhook secret are stored encrypted at rest with Fernet. After creation the API never returns them: the list shows url_display (scheme and host, the rest masked) and has_secret.
- NOTIFICATION_CHANNEL_ENCRYPTION_KEY: a Fernet key, recommended in production
- when it is empty, a key derived from SECRET_KEY (SHA-256) is used: changing SECRET_KEY then makes the stored channels undecryptable, and their deliveries fail with "Cannot decrypt the channel URL or secret"; set the URL again to fix it
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"Webhook Format and Signature
A webhook receives a POST with Content-Type: application/json, the header X-AsPeekIt-Event (the event type) and the header X-AsPeekIt-Signature: sha256=<hex HMAC-SHA256 of the raw body with the channel secret>. The header is omitted when the channel has no secret. A webhook created without a secret gets a generated one, shown only once after creation: copy it then.
Note: Verify the signature on the exact bytes received, before parsing the JSON, with a constant-time comparison. An SLA event carries data {finding_id, title, cve_id, severity, asset, due_at, link} with the link /dashboard/security?sla=overdue (&cve=<id> for a CVE finding).
{
"version": "1",
"event": "finding.created",
"event_key": "cve:CVE-2026-0001",
"test": false,
"sent_at": "2026-11-28T10:00:00+00:00",
"data": {
"cve_id": "CVE-2026-0001", "severity": "critical", "cvss_score": 9.8,
"published_at": "...", "description": "...", "kev": true,
"epss_score": 0.42, "has_exploit": true, "priority_band": "P1",
"priority_score": 97.0, "host_count": 2,
"hosts": [{"name": "web-01", "components": [{"package": "openssl", "version": "3.0.1", "kind": "deb", "path": "/usr/lib"}]}],
"more_hosts": 0,
"link": "https://aspeekit.example.com/dashboard/security?cve=CVE-2026-0001&status=open"
}
}Verifying the Signature
Example receiver check in Python:
import hashlib, hmac
def is_valid(secret: str, body: bytes, header: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, header)Slack and Microsoft Teams
Slack receives a Block Kit message: a header with the CVE and severity, a section with severity, CVSS, KEV/EPSS/exploit, priority and hosts, a context line and an "Open in AsPeekIt" button. Teams receives a message with an Adaptive Card 1.4: title, description, a fact set with the same facts and an Action.OpenUrl "Open in AsPeekIt". Texts are in English.
Retries and Delivery Log
Each event is delivered by its own Celery task, outside the request and outside any transaction. A network error, a timeout, 408, 429 or a 5xx response is retried with an exponential backoff of 30, 60, 120 and 240 seconds: at most 5 attempts. Any other 4xx, an unsafe URL or an encryption error stops at once.
- every attempt is a row in NotificationLog (channel = the channel type), sent or failed with a readable error; the URL and secret never appear in it
- the card shows the last delivery of each channel (status, time, error)
- an event is enqueued once per channel: its own task owns the retries, and a non-retryable failure is final; only a delivery interrupted by a lost worker (a pending row older than 1 hour, marked failed) is enqueued again, up to 5 attempts in total
Send Test
The Send test button of a channel sends a test message of the channel type (webhook JSON with "test": true and event "test", or a Slack / Teams message marked as test) and shows the outcome inline: delivered with the HTTP status, or the error and the status. It is a single synchronous attempt, never retried, recorded in NotificationLog with the key test:<uuid>, and it works on inactive channels too.
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://aspeekit.example.com/api/v1/notifications/channels/<id>/test/
# {"ok": true, "status_code": 200, "error": ""}API
All endpoints require an admin:
- GET / POST /api/v1/notifications/channels/ (paginated list, create)
- GET / PATCH / PUT / DELETE /api/v1/notifications/channels/<id>/ (on update an omitted url or secret is kept; secret "" removes it)
- POST /api/v1/notifications/channels/<id>/test/