ci: fail the nightly vulnerable-packages scan when vulnerabilities are found - #5513
Open
jamescrosswell wants to merge 1 commit into
Open
ci: fail the nightly vulnerable-packages scan when vulnerabilities are found#5513jamescrosswell wants to merge 1 commit into
jamescrosswell wants to merge 1 commit into
Conversation
…e found The `List vulnerable packages` workflow has never been able to fail: `dotnet package list` doesn't set an exit code on detection, and the grep that was meant to compensate has been commented out since #2814 (closed 2025-11-26). The job prints its findings into logs nobody reads and always exits 0. Enable the check, and drop the `pull_request` trigger so it runs on the nightly schedule only. `--vulnerable` consults live advisory data, so keeping it on PRs means a GHSA published overnight can turn every open PR red and halt unrelated work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5513 +/- ##
==========================================
- Coverage 74.74% 74.73% -0.02%
==========================================
Files 513 513
Lines 18829 18829
Branches 3682 3682
==========================================
- Hits 14074 14071 -3
- Misses 3875 3877 +2
- Partials 880 881 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5275
#skip-changelog
Summary
The
List vulnerable packagesworkflow has never been able to fail.dotnet package listdoesn't set an exit code on detection, and thegrepthat was meant to compensate has been commented out since #2814 — which was closed as completed on 2025-11-26, so the original blocker is gone. Today the job prints its findings into logs nobody reads and always exits 0.This enables the check, and drops the
pull_requesttrigger so it runs on the nightly schedule (andworkflow_dispatch) only.Why not run the gate on PRs
--vulnerableconsults live advisory data rather than anything in the diff. Leaving it onpull_requestmeans a GHSA published overnight against one of our transitive dependencies turns every open PR red until the dependency is updated — halting unrelated work over what is routine maintenance, not a defect in the PR.The tradeoff is that a PR which introduces a vulnerable dependency is caught by the next nightly rather than on the PR itself. That seems like the right trade given the alternative is a repo-wide stop-the-world on someone else's advisory.
I checked both repo rulesets (
Default branch,Default production ruleset [don't modify]) — neither has arequired_status_checksrule, and classic branch protection isn't configured, so removing the trigger won't leave PRs waiting on a check that no longer reports.Heads-up: the first nightly after this merges will be red
I dispatched this workflow against the branch to check end-to-end: run 33036863576 fails at the
List vulnerable packagesstep with exit code 1, as intended. 16 projects currently report vulnerable transitive packages, including four shipped ones:Sentry.HangfireSentry.Log4NetSentry.OpenTelemetrySentry.OpenTelemetry.ExporterThe rest are samples and tests (plus
SQLitePCLRaw.lib.e_sqlite3— High — inSentry.DiagnosticSource.Tests).These are all minimum-version floors inherited from our direct dependencies, not versions we picked. Clearing them means adding explicit references that raise the floor, which for the four shipped packages raises our published minimums — consistent with the
Breaking Change/Next Majorlabels already on #5275.So this PR makes the signal real but does not clear the backlog. Worth deciding before merge whether we'd rather land the floor bumps first so the nightly goes green immediately, or land this now and accept a red nightly while they're worked through. Happy to do either.