Skip to content

Upload the weekly Grype scan under the PR gate's SARIF category - #1502

Merged
bradflaugher merged 1 commit into
mainfrom
fix/grype-sarif-category
Sep 14, 2026
Merged

bradflaugher merged 1 commit into
mainfrom
fix/grype-sarif-category

Conversation

@bradflaugher

Copy link
Copy Markdown
Contributor

What changed, and why

The weekly Grype scan (.github/workflows/grype-scheduled.yml) uploaded its SARIF under its own code-scanning category, grype-scheduled, while the per-PR grype-scan job in ci.yml uploads under grype-sandbox-image. GitHub Advanced Security remembers every category it has seen on the default branch and expects each one to report on every PR; the weekly workflow runs only on its cron and on workflow_dispatch, so every PR has shown a skipped "grype" check with "1 configuration not found" since the weekly lane first ran. The weekly upload now uses grype-sandbox-image, the same category as the PR gate, with a comment recording why a distinct category is the wrong shape here. docs/TESTING.md no longer names a grype-scheduled category and records the shared-category semantics (one result set per tool, category and commit, so the weekly upload for the tip of main replaces the push run's) plus the one-time cleanup below. SECURITY.md already named only grype-sandbox-image and the workflow file, so it needed no change.

Nothing about the scans themselves changes: the per-PR gate and its policy are untouched, the weekly scan still runs, still reports all findings including unfixed ones, and still uploads SARIF. govulncheck-scheduled.yml is deliberately left alone.

How you verified it

  • make lint (includes actionlint and shellcheck over the workflows): clean.
  • go test -tags fleet_host_executor -count=1 ./scripts/ (docs-index and pinned-docs checks): PASS.
  • grep -rn grype-scheduled docs SECURITY.md .github shows only the workflow's file name and job name, no category.
  • Reviewed locally by Codex before opening; its two documentation asks (shared-category semantics, the one-time cleanup) are in the diff.
  • The stale analyses can only be removed after this merges (GitHub deletes by analysis id on the default branch); the follow-up step is listed below.

Scope and deviations

Scoped to the category string, its comment, and the two doc mentions. After merge, the four existing grype-scheduled analyses on refs/heads/main are deleted through the code-scanning API, newest first, the last with confirm_delete=true; until then PRs keep showing the missing-config check. grype-sandbox-image and CodeQL analyses are not touched. govulncheck-scheduled.yml has the same shape (its own govulncheck-scheduled category, four analyses on main) and is out of scope here by request.


  • The title and "What changed, and why" are written for the release notes they become
  • A design note (docs/<FEATURE>.md) added, if this ships a feature — not a feature; the change is recorded in docs/TESTING.md
  • An ADR added or superseded in docs/adr/, if this adds, weakens or reverses an invariant — none touched
  • The diff is scoped to one change (no unrelated refactors)

🤖 Generated with Claude Code

The weekly scan published its SARIF under its own code-scanning category,
grype-scheduled, while ci.yml's grype-scan uploads under grype-sandbox-image.
GitHub Advanced Security expects every category it has seen on the default
branch to report on every PR, and the weekly workflow runs only on its cron
and on workflow_dispatch, so each PR has shown a skipped "grype" check with
"1 configuration not found" since the weekly lane first ran. The weekly
upload now shares grype-sandbox-image; the workflow comment says why, and
docs/TESTING.md records the shared-category semantics (one result set per
tool, category and commit, so the weekly upload for the tip of main replaces
the push run's) and the one-time deletion of the recorded grype-scheduled
analyses that has to follow, since renaming the category does not retire a
configuration GitHub already knows.

The scans themselves are unchanged: the per-PR gate and its policy, the
weekly rebuild, its report-all posture and its SARIF upload all stay.
govulncheck-scheduled.yml is deliberately untouched. SECURITY.md already
named only the shared category and the workflow file, so it needed no change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T22:27:45.885397Z 402e082 PR opened
🔒 Security Review Completed 2026-09-14T22:28:03.489227Z 402e082 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bradflaugher
bradflaugher merged commit 011da52 into main Sep 14, 2026
21 checks passed
@bradflaugher
bradflaugher deleted the fix/grype-sarif-category branch September 14, 2026 22:33
bradflaugher added a commit that referenced this pull request Sep 14, 2026
… keeps its cron-only SARIF category (#1503)

## What changed, and why

Two leftovers from #1501 and #1502.

**`GET /tasks/tags` in `docs/openapi.yaml`** still described a global
catalogue. Since #1501 the endpoint requires `view_tasks` and is scoped
by the same own-rows rule as `GET /tasks` (#1082): a non-admin user or
scoped API key gets only the tags on tasks it created, with counts over
those tasks, while the admin key, `PermissionAdmin` carriers and
`view_all_logs` holders get the fleet-wide catalogue. The summary now
says so in the same words the `/tasks` entry uses, so an API consumer
does not mistake an omitted tag for a nonexistent one.

**The govulncheck cron category is correct and now says why.** #1502
moved the weekly Grype upload onto the PR gate's category because GitHub
expected the cron-only `grype-scheduled` configuration on every PR.
`govulncheck-scheduled.yml` looks like the same shape, but is not: the
per-PR govulncheck step in `ci.yml` runs the scan and uploads no SARIF,
so this lane is the only govulncheck upload, there is no PR-side
category to share, and GitHub shows no missing-configuration check for
it (confirmed on #1501 and #1502, where only the Grype phantom
appeared). The workflow comment and `docs/TESTING.md` record that so the
category is not renamed by analogy. No scan command, schedule or alarm
changed.

## How you verified it

- `make lint` including actionlint over the edited workflow: clean.
- `go test -tags fleet_host_executor -count=1 ./scripts/`: PASS.
- Checked `gh pr checks` on #1501 and #1502: no "govulncheck"
configuration-not-found check, only the Grype one that #1502 removed.
- Reviewed once locally by Codex before opening.

## Scope and deviations

Docs and one workflow comment only; no runtime, gate or schedule change.
The alternative of making the PR gate emit SARIF under a shared category
was not taken: it would change the per-PR gate for no visible defect.

---

- [x] The title and "What changed, and why" are written for the release
notes they become
- [x] A design note (`docs/<FEATURE>.md`) added, if this ships a feature
— not a feature
- [x] An ADR added or superseded in `docs/adr/`, if this adds, weakens
or reverses an invariant — none touched
- [x] The diff is scoped to one change (no unrelated refactors)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant