Skip to content

feat(security): read and answer GHSA reports through the advisory comments API - #1964

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:ghsa-comments-api
Nov 2, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:ghsa-comments-api

Conversation

@potiuk

@potiuk potiuk commented Nov 2, 2026

Copy link
Copy Markdown
Member

GitHub's repository security advisory comments API (public preview since 2026-10-02) lists, reads, posts and edits comments on repository security advisories, including the ones private vulnerability reporting creates.
Until now the security skills treated the advisory discussion as web-UI only: sync opened the advisory in the browser and printed a reply to paste, and nothing read the reporter's follow-ups.

What changes

  • security-issue-sync reads the advisory discussion on every GHSA-sourced tracker.
    A new security-management issue-sync ghsa-discussion command returns the comments new or edited since the ghsa-discussion rollup marker, each with its author's role (reporter, team, other), plus awaiting_team_reply and the next marker timestamp.
    The team is the tracker collaborator roster only: an author_association of MEMBER means any member of the org.
    Non-team bodies come back as body_untrusted and go through the Step 1d signal table like a <security-list> message.
  • The reporter reply is posted through the API after confirmation (ghsa-route action api-post).
    It is claimed as posted only on a 201, and the proposal says it is a regular comment the reporter sees.
    The browser paste stays as the fallback where the comments API does not answer (private repositories, which the preview does not cover), and the email relay where the operator has no access to the advisory.
  • security-issue-import reads the reporter's follow-up comments when it imports a GHSA report, and seeds the marker.
  • security-issue-invalidate posts its closing comment through the API.
  • vetted-ops gains advisory-comments (read, paginated) and advisory-comment (write, body from a workspace file).

The API cannot delete comments or reach confidential (write-access-only) comments, so the docs keep those in the web UI and warn that the API's view of a thread can be missing team-only notes.

Testing

  • New unit tests for ghsa-route (API post, and the browser fallback on a missing, 403 or 404 comments read) and ghsa-discussion (first read, since-marker, edits, roster-only team, untrusted bodies), plus the two vetted ops.
  • security-issue-sync/step-1d-signals eval: 7/7 pass.
  • The list endpoint was checked against a live advisory (comment metadata only).

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Claude Opus 5)

🤖 Generated with Claude Code

…ments API

GitHub's repository security advisory comments API (public preview since
2026-10-02) lists, reads, posts and edits comments on repository security
advisories, including ones created from private vulnerability reports.

- security-issue-sync reads the advisory discussion on every GHSA-sourced
  tracker: a new `ghsa-discussion` command returns the comments new or edited
  since the `ghsa-discussion` rollup marker, each with its author's role
  (reporter, team, other) and whether the reporter is waiting for a reply.
  The team is the tracker collaborator roster only: `author_association`
  MEMBER means any member of the org. Non-team bodies come back as
  `body_untrusted`.
- The reporter reply is posted through the API after confirmation
  (`ghsa-route` action `api-post`), claimed as posted only on a 201, and
  shown as a regular comment the reporter sees. The browser paste remains
  the fallback where the API does not answer (private repositories), and
  the email relay where the operator has no advisory access.
- security-issue-import reads the reporter's follow-up comments when it
  imports a GHSA report; security-issue-invalidate posts its closing comment
  through the API.
- vetted-ops gains `advisory-comments` (read) and `advisory-comment` (write,
  body from a workspace file).

The API cannot delete comments or reach confidential (write-access-only)
comments; those stay in the web UI, and the docs say so.

Generated-by: Claude Opus 5
@github-actions github-actions Bot added family:security security-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json labels Nov 2, 2026
@potiuk
potiuk merged commit 78be994 into apache:main Nov 2, 2026
13 checks passed
potiuk added a commit that referenced this pull request Nov 2, 2026
…nc and backfill (#1968)

Builds on the advisory comments API support (#1964).

- `ghsa-fields` computes the smallest PATCH that mirrors a tracker onto its
  GitHub repository security advisory: cve_id, the team's severity, cwe_ids,
  the affected range and patched version, credits (existing ones kept, plus
  the fix PR's author as remediation_developer and its approvers as
  remediation_reviewer, bots left out) and the CVE title as summary. It never
  writes state or collaborators, and never overwrites a different CVE.
  In the other direction it proposes advisory values for tracker fields that
  are still empty (CVE, CWE, affected range), never the severity, and shows
  drift where both sides differ. With `resolution` it appends a Resolution
  block below the reporter's text once the public advisory URL is captured.
- `ghsa-backfill` returns one plan per advisory for the "sync ghsa backfill"
  sweep over trackers reconciled before the mirror existed.
- `ghsa-mirror` syncs comments both ways: every advisory comment is copied
  into the tracker (idempotent by a hidden marker, rewritten when edited,
  author named without an @-mention); only team comments marked
  `To reporter:` or `<!-- to-reporter -->` are proposed for the advisory,
  each confirmed, never re-posted or copied back.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement family:dev Repo dev: .asf.yaml, spec-loop specs, Node manifests, .claude/settings.json family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant