Skip to content

ci: post new security advisories to the security discord channel - #1523

Merged
reitblatt merged 7 commits into
mainfrom
reitblatt/advisory-notifications
Nov 9, 2026
Merged

reitblatt merged 7 commits into
mainfrom
reitblatt/advisory-notifications

Conversation

@reitblatt

@reitblatt reitblatt commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 feat: post repository security advisories 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.

Poll the repository security advisories API every 15 minutes and post each
new triage or draft advisory once (GHSA ID, title, severity, link) to the
private security channel. Skips silently until SECURITY_DISCORD_WEBHOOK and
ADVISORY_READ_TOKEN are configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci Deals with GitHub Actions, workflows, or continuous integration label Nov 2, 2026
List new triage and draft advisories in a script and post them with the
shared discord-bot action's repository_advisory event instead of calling
the Discord webhook directly. State is saved only after posting succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reitblatt
reitblatt marked this pull request as ready for review November 3, 2026 21:18
@reitblatt
reitblatt requested a review from a team as a code owner November 3, 2026 21:18

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

claude-agent and others added 3 commits November 3, 2026 22:02
Address review: skip manual dispatches from other branches, document the
duplicate-post behaviour on a partial batch failure, and use a single
import style for unittest in the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Advisory titles are written by reporters and can reveal the vulnerability.
Pin roostorg/discord-bot to the matching commit on #19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reitblatt

Copy link
Copy Markdown
Contributor Author

@cassidyjames Dropped titles and added advisory state (i.e. triaging or draft).

@taobojlen @juanmrad can I get a stamp here?

@taobojlen taobojlen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

claude-agent and others added 2 commits November 9, 2026 20:37
@reitblatt
reitblatt merged commit 8152218 into main Nov 9, 2026
27 checks passed
@reitblatt
reitblatt deleted the reitblatt/advisory-notifications branch November 9, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Deals with GitHub Actions, workflows, or continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants