Repository navigation
ci(main): standard dependency audit - #396
Merged
Merged
Conversation
- ci-v2: add `Dependency Audit`, which runs the checked-out branch's .github/scripts/v2/npm-audit.sh (npm audit --audit-level=high); the Required Checks job now fails when it fails. - ci-v3: rename Security Audit to `Dependency Audit` and drop the push-only `if:` (and the run-audit input), so it gates pull requests; Required Checks and Status now fail when it fails. - ci-v4: rename to `Dependency Audit`, add --deny warnings, write the JSON and SARIF under the workspace so hashFiles() finds them, include denied warnings in the SARIF, and add a CI v4 Required Checks job. - All three pin cargo-audit 0.22.2 / actions by SHA. Rust jobs also honour a legacy <line>/audit-ignore (marked transitional) so branches not yet migrated to .cargo/audit.toml stay green. - Pin aquasecurity/trivy-action to the v0.36.0 commit with Trivy v0.76.0. - Add dependency-audit.yml: weekly (Mon 06:00 UTC) and on dispatch, audits v2, v2.5.x, v3, v3.1.x and v4 and keeps one `security` issue per branch titled "Dependency Audit: <branch>".
Add a "Dependency auditing" subsection (job name, commands, ignore files, schedule, required check) and the rule that a transitive 0.x bump forced by an in-major security fix is allowed and must be listed in the PR (approved by the owner on 2026-10-23).
…verted next commit)
…ash -e - ci-v2 and dependency-audit.yml (transitional): when a branch has the standard npm-audit.sh but only the legacy "<GHSA-id> <lockfile-dir>" v2/audit-ignore, write its first fields to v2/npm-audit-ignore for the run. A branch whose old script reads v2/audit-ignore runs unchanged. - dependency-audit.yml: Actions runs bash with -e, which ended the audit step before it recorded findings; turn it off for that step.
….yml (reverted next commit)" This reverts commit 0fd2ceb.
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.
What
Puts the dependency-audit standard on
main. This PR has to merge first, so its reusable jobs also work on branches that haven't migrated yet.Dependency Auditjob (same name in all three reusable workflows)ci-v2.ymlDependency Auditjob. It runs the checked-out branch's own.github/scripts/v2/npm-audit.sh(npm audit --audit-level=highon every committedpackage-lock.json) on Node 24.CI v2 Required Checksnow fails when it fails.ci-v3.ymlSecurity Auditis renamedDependency Audit. The push-onlyif:and therun-auditdispatch input are gone, so the job now gates PRs.CI v3 Required ChecksandCI v3 Statusnow fail when it fails (until now it was "non-blocking").ci-v4.ymlDependency Audit, with--deny warningsadded. The JSON and SARIF are now written under the workspace, sohashFiles()finds them and the SARIF upload runs (it never did before). The SARIF now includes denied warnings as well as vulnerabilities. v4 had no aggregate job, so this addsCI v4 Required Checks.cargo binstall --locked cargo-audit@0.22.2). The new jobs pin their actions by commit SHA.aquasecurity/trivy-actionis pinned toed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0inci-v2.ymlandci-v3.yml, withversion: v0.76.0. That is the newest Trivy at least 3 days old: v0.76.1 came out 2026-10-21, too recent..github/WORKFLOW_ARCHITECTURE.md: the job name is updated.Transitional code (marked
# transitional, to remove once every branch has migrated)<line>/audit-ignoreexists, its IDs become--ignoreflags, on top of<line>/.cargo/audit.toml.v2/npm-audit-ignoreand falls back to the legacyv2/audit-ignore. It always runs whatever script the branch has:v2today): readsv2/audit-ignorein its own<GHSA-id> <lockfile-dir>format. It runs unchanged.v2/npm-audit-ignorefor that run.v2/npm-audit-ignore(v2.5.x, ci(v2): standard dependency audit #390): used as-is.dependency-audit.yml(new)workflow_dispatch.contents: read,issues: write.v2,v2.5.x,v3,v3.1.xandv4. Each leg checks out its branch and runs that line's audit with the same commands as its CI job.Dependency Audit: <branch>and labelledsecurity. A clean run closes it.SECURITY.mdrenovate.jsonand.github/dependabot.ymlare not touched.Merge order and the v4 window
v2/audit-ignore, v3 and v3.1.x through the legacyv3/audit-ignoreflags.--deny warningsfails on two unmaintained crates: RUSTSEC-2026-0173 (proc-macro-error2) and RUSTSEC-2024-0449 (unsafe-libyaml). v4 has no legacy file to fall back on, and their documented exceptions belong inv4/.cargo/audit.tomlon the v4 branch. Merge the v4 PR right after this one. Then re-run CI on any open v4 PR.Validation
actionlintpasses on all four changed workflows, with no new findings. The remaining ones inci-v2.ymlandci-v3.ymlwere there before, and one inci-v4.ymlis gone.yamllint -c .yamllint.yml,prettier --checkandmarkdownlintall pass.dependency-audit.ymlruns. A schedule- and dispatch-only workflow can't be dispatched from a branch before it is on the default branch:gh workflow runreturns 404. To register it, I added a temporarypushtrigger for this branch and reverted it in the next commit, so the file is back to its final form.Dependency Audit: v4,security).-e, which ended the audit step before it recorded its result.gh workflow run dependency-audit.yml --ref ci/main-dependency-auditon the final file, and it succeeded. Issue writes were allowed on the non-default ref. Results matched, and the v4 leg updated Dependency Audit: v4 #393 rather than opening a duplicate.ci-v2.yml,ci-v3.ymlandci-v4.ymljobs only run from branches after this merges, because the shims call@main.🤖 Generated with Claude Code