ci: post new security advisories to the security discord channel

Merged
RE
7d ago
+538-0

Context & Requests for Reviewers

Part of #1520 (item 7).

We have pretty poor visibility on security advisory sumissions right now, so we should ping the (private) #security-incidents Discord channel, just like we do for PRs in #coop and #osprey.

When a triage or draft advisory is created, pings #security-incidents with GHSA ID, state (triage or draft), severity and a link to the advisory. Titles are left out, since reporters write them and they can reveal the vulnerability.

Uses @cassidyjames's roostorg/discord-bot action, extended in roostorg/discord-bot#19 with a repository_advisory event.

GitHub Actions has no advisory event, so the workflow polls the REST API every 15 minutes (security-advisories?state=triage and state=draft).

Notes for reviewers:

  • Public logs: logs and caches on this repository are public. The script intentionally prints nothing about advisories in CI, and its errors show only HTTP status codes.
  • State: the list of advisories already posted lives in the Actions cache and is never committed. It's saved only after posting succeeds, so a failed post is retried on the next run. It holds HMAC-SHA256 hashes of GHSA IDs keyed by the webhook URL, because PR runs can read caches saved on main. Changing the webhook URL reposts the open advisories (once)
  • Other safeguards: permissions: {}, actions pinned by SHA, and a concurrency group without cancel-in-progress to avoid double posts. Mentions are disabled in Discord messages.
  • Missing secrets: if either secret is missing, every step skips with no output.

Requests for reviewers:

  • Should a small CI job run the stdlib tests in .github/scripts/?
  • Fine-grained PAT now, or a GitHub App (not tied to one person, no PAT expiry, one install could also cover osprey)?

Tests

Ran manual test against fake repo (https://github.com/reitblatt/advisory-notify-test/), saw notifications in channel w/o sensitive info (as expected):
Screenshot 2026-11-03 at 13 17 06

(Optional) Rollout Plan

  • Need to merge roostorg/discord-bot#19 first, and then update the pin to the real commit on main.
  • Create the environment security-advisory-notify with deployment branches limited to main, and in it the secrets SECURITY_DISCORD_WEBHOOK (the private security channel's webhook URL) and ADVISORY_READ_TOKEN. Don't create them as repository secrets, which every branch's workflows can read. The token is a fine-grained PAT with resource owner roostorg, limited to this repository, with "Repository security advisories: Read-only". Its owner must be a repository admin or security manager, or triage advisories aren't listed. Until both exist, the workflow skips silently. After creating them, run the workflow manually once to confirm it posts.

Release notes

Checklist

Only check items that apply to this PR; leave the rest unchecked.

  • If you changed anything user-facing (i.e. user interface or APIs):
    Did you update related docs?

  • If the change is notable (refer to Keep a Changelog conventions):
    Did you fill in the Release notes section above?

  • If you changed db/src/scripts/** and used CREATE TABLE, ADD COLUMN, or ALTER COLUMN:
    Are as many columns marked NOT NULL as possible? If some columns can sometimes be null depending on other columns, are there CHECK constraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?

  • If you added a new signal in server/services/signalsService/signals/**:
    Did you classify every error case as a permanent error (SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be a SignalPermanentError.