Skip to content

ci: scan every manifest against OSV on pull requests - #5301

Closed
ReneWerner87 wants to merge 2 commits into
masterfrom
claude/osv-scanner-guard
Closed

ci: scan every manifest against OSV on pull requests#5301
ReneWerner87 wants to merge 2 commits into
masterfrom
claude/osv-scanner-guard

Conversation

@ReneWerner87

@ReneWerner87 ReneWerner87 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Stacked on #5297. Base is claude/cloudflare-workers-bun-security, so this diff shows only the CI change. Merging #5297 first retargets this to master automatically.

Stacking is what makes this check meaningful here: on master alone it fails on the four cloudflare-workers/bun.lock packages #5297 fixes. On top of #5297 it passes clean, so the check is green from the moment it lands.

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:

Nothing 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.json and bun.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-scanner is pinned to v2.4.0 and installed via go install, so the version is reproducible and there is no action tag to drift.

Accepted findings

osv-scanner.toml holds the exceptions, currently exactly one:

ID Reason
GO-2026-5932 "golang.org/x/crypto/openpgp is unmaintained." No fixed version (covers all releases, v0.54.0 is latest), no GHSA identifier, and scoped to import paths nothing here uses.

Keeping 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:

It 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.

Copilot AI review requested due to automatic review settings August 1, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.yml to run osv-scanner scan source -r on PRs, pushes, and a weekly schedule.
  • Add osv-scanner.toml to 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-go is 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.

Comment thread .github/workflows/osv-scanner.yml
Copilot AI review requested due to automatic review settings August 1, 2026 10:56
@ReneWerner87
ReneWerner87 force-pushed the claude/osv-scanner-guard branch from 3d60aea to 50b0a1c Compare August 1, 2026 10:56
@ReneWerner87
ReneWerner87 changed the base branch from master to claude/cloudflare-workers-bun-security August 1, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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:

Base automatically changed from claude/cloudflare-workers-bun-security to master August 1, 2026 11:05
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
@ReneWerner87
ReneWerner87 force-pushed the claude/osv-scanner-guard branch from 50b0a1c to 65b6806 Compare August 1, 2026 11:16
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.
Copilot AI review requested due to automatic review settings August 1, 2026 11:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Member Author

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 .github/dependabot.yml, and both are already on master:

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

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.

3 participants