Repository navigation
ci: fail the build on high-severity dependency advisories - #405
Open
IanoNjuguna wants to merge 2 commits into
Open
IanoNjuguna wants to merge 2 commits into
IanoNjuguna wants to merge 2 commits into
Conversation
The repo defined npm run audit:ci and never ran it: no workflow mentioned npm audit, so a dependency with a known high advisory could merge and the first signal was a Dependabot alert afterwards. Runs it in both gates, after npm ci and before the build, so the same check runs on the way in (pr-build-website.yml) and on the way to production (deploy.yml). The script takes --omit=dev and --audit-level=high, which is the scope agreed in IntersectMBO#338: high and critical findings fail, moderate and low are reported, and findings that only affect build-time tooling do not gate a release. Verified the gate passes on main's lock at 973801b: npm audit --omit=dev --audit-level=high -> found 0 vulnerabilities, exit 0 Refs IntersectMBO#338
TRIAGE.md documents both scanning setups but nothing said what happens on the way in, or when a finding may be dismissed. Adds the gate itself, and extends the dismissal section so it covers Dependabot advisories as well as CodeQL alerts, with the extra requirement for a dependency finding: name the condition that reopens it. Fixes IntersectMBO#338
3 tasks
This branch has not been deployed
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.
Description
Adds the dependency advisory gate that #338 asked for, and documents it in
TRIAGE.md.website/package.jsonhas definedaudit:cisince before this change, and no workflow ran it: grepping.github/workflows/fornpm auditreturned nothing. A dependency with a known high-severity advisory could therefore merge, and the first signal would be a Dependabot alert after the fact.The step now runs in both gates, after
npm ciand before the build:pr-build-website.yml, so it fails the PR that introduces the findingdeploy.yml, so it also guards the path to productionScope, as agreed on #338:
--audit-level=high, so high and critical fail and moderate or low are reported only. A gate that reddens on findings nobody can fix gets bypassed.--omit=dev, so advisories that only affect build-time tooling do not block a release.npm run auditstill reports the full tree locally.Fixes #338. Also carries the third box from #339, which was closed when its alerts resolved themselves:
TRIAGE.mdnow states the dismissal bar, and the existing code-scanning dismissal section is widened to cover Dependabot advisories, with the extra requirement that a dependency dismissal names the condition that reopens it.Type of Change
Testing
Checklist
Verification
The gate passes on today's tree, so this does not redden
mainor any open PR on merge. Againstmainat 973801b:Both workflow files parse as YAML, and the step list for the
buildjob is unchanged apart from the new step between install and build.The new step runs on this PR itself, since
pr-build-website.ymltriggers on changes topr-build-website.yml. The check on this PR is the evidence that the gate works on the way in.deploy.yml's copy only runs on a push tomain.Notes
TRIAGE.mdwrite-up. Splitting them keeps the CI change reviewable without the doc noise.js/indirect-command-line-injection, is not touched here.