ci: scan every manifest against OSV on pull requests - #5301
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new CI workflow that runs osv-scanner against all dependency manifests/lockfiles on pull requests (and weekly) to catch vulnerable/stale lockfiles early, plus a repository-scoped exceptions file for accepted findings.
Changes:
- Add
.github/workflows/osv-scanner.ymlto runosv-scanner scan source -ron PRs, pushes, and a weekly schedule. - Add
osv-scanner.tomlto centrally track accepted/ignored findings with documented rationale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/osv-scanner.yml |
Introduces an OSV scanning workflow for PR-time and scheduled dependency vulnerability detection. |
osv-scanner.toml |
Defines the ignore list and rationale for accepted OSV findings used by the workflow. |
Suppressed comments (1)
.github/workflows/osv-scanner.yml:50
- Similarly,
actions/setup-gois pinned by SHA elsewhere in this repo. Pinning here (and aligning to the same version) avoids unreviewed changes to the Go toolchain setup action.
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable
cache: false
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3d60aea to
50b0a1c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/workflows/osv-scanner.yml:48
- This workflow uses floating action tags (
actions/checkout@v6,actions/setup-go@v6). Elsewhere in this repo the same actions are pinned to a commit SHA (e.g. .github/workflows/codeql.yml and gobuild.yml), which avoids supply-chain risk and prevents unexpected changes from landing in CI. Please pin these actions to the same SHAs used elsewhere (or update consistently if you intend a newer version).
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
Dependabot alerts are necessary but not sufficient for this repository. They only report drift after an advisory lands, and only for the ecosystems and manifests Dependabot is configured to see -- which is exactly how the recent round of alerts went unnoticed: cloudflare-workers/bun.lock had no matching package-ecosystem entry at all, and an `allow: dependency-type: "direct"` filter hid every transitive npm advisory. This adds a check that resolves every manifest in the tree -- go.mod, pnpm-lock.yaml, package-lock.json and bun.lock -- against OSV.dev on each pull request, so a lockfile that quietly falls behind fails a check instead of accumulating alerts nobody sees. It also runs weekly, so advisories published against unchanged manifests surface on their own rather than waiting for the next unrelated pull request. osv-scanner is pinned to v2.4.0 and installed with `go install`, which keeps the version reproducible. Accepted findings live in osv-scanner.toml, currently one entry: GO-2026-5932, the "golang.org/x/crypto/openpgp is unmaintained" notice. It has no fixed version, no GHSA identifier, and is scoped to import paths nothing in this repository uses. Documenting it in a file that has to be edited to grow makes each accepted risk a deliberate decision rather than an alert that silently stays open. Verified locally: the scan reports the four cloudflare-workers packages on current master, and exits clean once the fixes from the bun.lock PR are applied. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ea7bWcx58vqScAQoerh2Go
50b0a1c to
65b6806
Compare
Raised by Copilot on review. gobuild.yml and codeql.yml pin actions to a commit SHA with a version comment; this workflow used floating tags, which can change behaviour without a code change. Uses the same SHAs the existing workflows already reference, so Dependabot updates all of them together.
|
Closing at the maintainer's request, not merging. Worth recording for anyone reading this later: the structural fix for the recurring alerts does not depend on this PR. Both causes were configuration problems in
With those in place Dependabot can reach the packages it previously could not, which is what let the alerts accumulate in the first place. This PR would have added a second, independent check on top: a weekly scan catching advisories published against manifests that have not changed, which is the case Dependabot handles least well. That is defence in depth rather than a missing piece. Generated by Claude Code |
Follow-up to #5290. This is the piece that stops the alerts from coming back rather than fixing another round of them.
Why alerts kept reappearing
Dependabot alerts are necessary but not sufficient here. They report drift after an advisory lands, and only for the ecosystems and manifests Dependabot is configured to see. Both limits bit this repository:
cloudflare-workers/bun.lockhad no matchingpackage-ecosystementry at all, invisible for months (fix(security): update cloudflare-workers dependencies and add bun ecosystem #5297)allow: dependency-type: "direct"filter hid every transitive npm advisory (fixed in fix(security): resolve recurring Dependabot alerts in npm templates #5290)esbuild,yaml,@sveltejs/vite-plugin-svelte) were never re-resolved once pinnedNothing in CI would have caught any of those. The manifests sat frozen while the advisory database moved.
What this adds
A check that resolves every manifest in the tree (
go.mod,pnpm-lock.yaml,package-lock.jsonandbun.lock) against OSV.dev on each pull request. A lockfile that quietly falls behind now fails a check instead of accumulating alerts nobody looks at.It also runs weekly, so advisories published against unchanged manifests surface on their own rather than waiting for the next unrelated PR. That case is the one Dependabot handles worst and the one that produced most of the recent noise.
osv-scanneris pinned to v2.4.0 and installed viago install, so the version is reproducible and there is no action tag to drift.Accepted findings
osv-scanner.tomlholds the exceptions, currently exactly one:GO-2026-5932Keeping exceptions in a file that has to be edited to grow makes each accepted risk a deliberate decision, rather than an alert that silently stays open. The file's header asks for a reason and warns against ignoring anything that could simply be upgraded.
Verification
Run locally against this tree:
masteralone: reportshono@4.11.9(28),undici@7.18.2(11),ws@8.18.0(2),sharp@0.34.5(1), exit 1No issues found, 88 filtered (the x/crypto entry across 88 modules), exit 0It independently reproduced the findings from #5290 and #5297 without being given them, and correctly does not flag the Fiber v2 module-graph entry from #5300, since that one never reaches the build list.