Skip to content

feat: PagerDuty ingress, platform coverage matrix and runbook templates (Fixes #17) - #216

Merged
OkiriGabriel merged 1 commit into
mainfrom
feat/platform-coverage-17
Nov 26, 2026
Merged

OkiriGabriel merged 1 commit into
mainfrom
feat/platform-coverage-17

Conversation

@OkiriGabriel

Copy link
Copy Markdown
Collaborator

Fixes #17.

The issue's checklist

  • Decide per platform (implement, webhook, or out of scope): docs/PLATFORM_SUPPORT.md has a new Coverage status table that marks each platform Built-in, Manual (planned in #NN) or Out of scope, linked to Infra mutations still out of scope: Terraform apply, config management, cluster destroy #74–Security identity: secret rotation, IAM/SSO, pentest, fleet CIS, compliance product #77.

  • PagerDuty webhook for alert ingress: POST /webhook/pagerduty (below).

  • Accurate PLATFORM_SUPPORT matrix: the PagerDuty row no longer says ingress isn't implemented. TLS is marked built-in for certbot (renew_certificates already handles DNS-01 and wildcard certificates, so that part of the issue was out of date) and manual everywhere else.

  • A runbook template per gap category: docs/runbooks/ (in the docs nav) has templates ready to upload as org docs:

    • CircleCI / Bitbucket Pipelines
    • DNS (Route 53 / Cloudflare)
    • TLS outside certbot (ACM, cert-manager, Cloudflare)
    • Vault / secrets rotation

    Each covers how incidents arrive, environment placeholders, diagnosis order, allowed actions and when to escalate.

POST /webhook/pagerduty

  • Events: PagerDuty V3 subscriptions. incident.triggered and incident.reopened are queued; all other events get 200 {"status": "ignored"}, so PagerDuty doesn't retry or disable the subscription.
  • Context: title, severity (high urgency → critical, otherwise warning), PagerDuty incident ID, number and priority, service, URL, and the body details. The type is classified the same way as Alertmanager alerts.
  • Auth:
    • X-PagerDuty-Signature: v1=<HMAC-SHA256>, which accepts a comma-separated list while a secret rotates, against PAGERDUTY_WEBHOOK_SECRET.
    • Per org: a PAGERDUTY_WEBHOOK_SECRET stored for the org, plus X-Org-ID, binds the request to that org, and the platform secret is refused for it (the same model as [SECURITY] Per-org webhook secrets and tenant binding for multi-API-key deployments #61).
    • Without a PagerDuty secret, the usual Authorization: Bearer <WEBHOOK_SECRET> applies.
    • Missing or wrong signatures get 401.
  • No loops: the agent escalates into PagerDuty (incident_key=<agent incident id> on PAGERDUTY_SERVICE_ID). Incidents with an agent incident key, or on that service, are ignored. If that service also gets real alerts, set PAGERDUTY_INGEST_AGENT_SERVICE=true.
  • Retries: redelivered triggers are deduplicated through the alert deduper and return "status": "duplicate".
  • PAGERDUTY_WEBHOOK_SECRET is added to the org credential keys and documented in .env.example, the API reference and the PagerDuty setup steps.

Not in this PR (tracked)

API clients for CircleCI and Bitbucket Pipelines (#76), DNS tools (#75), and a Vault integration (#77).

Tests

tests/test_pagerduty_webhook.py, 19 tests:

  • Queued context, the urgency mapping and a rotating signature header.
  • Four bad-signature cases, four ignored event types and reopened incidents.
  • Three loop guards, the opt-in, and redelivery dedupe.
  • Per-org binding (the platform secret is refused for the org), and the bearer fallback.

Full suite: 1448 passed, 4 skipped. mkdocs build --strict and check_docs_links.py pass (43 pages, 0 errors). Flake8 (CI selection) and bandit are clean.

… templates (#17)

- POST /webhook/pagerduty: PagerDuty V3 subscriptions. incident.triggered and
  incident.reopened become agent incidents (severity from urgency, PD id,
  number, priority, service, URL); other events are acknowledged and ignored.
  Signed with PAGERDUTY_WEBHOOK_SECRET (v1= HMAC, rotation-friendly), per org
  via org config + X-Org-ID, or the usual bearer WEBHOOK_SECRET. Incidents on
  PAGERDUTY_SERVICE_ID or keyed with an agent incident ID are ignored so
  escalations never loop back; redeliveries are deduplicated.
- docs/PLATFORM_SUPPORT.md: coverage status per platform (built-in / manual /
  planned / out of scope, linked to #74-#77) and PagerDuty setup.
- docs/runbooks/: uploadable templates for CircleCI/Bitbucket Pipelines, DNS
  (Route 53/Cloudflare), TLS outside certbot, and Vault/secrets rotation.
- COVERAGE_GAPS, API reference, .env.example and mkdocs nav updated.

Fixes #17
@OkiriGabriel
OkiriGabriel merged commit 794a30f into main Nov 26, 2026
16 checks passed
@OkiriGabriel
OkiriGabriel deleted the feat/platform-coverage-17 branch November 26, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add coverage for documented but unsupported platforms

1 participant