Repository navigation
ci: enterprise-required dependency review and Semgrep workflows - #95
Merged
Merged
Conversation
Two workflows for the enterprise rulesets in #94, each run on every pull request into the default branch and staging: - dependency-review.yml: actions/dependency-review-action (fails on new high or critical advisories) plus npm, pnpm, cargo and pip-audit runs on the lockfiles a change touches. Passes when nothing changed. - reusable-semgrep.yml: the open-source Semgrep CLI (image pinned by digest, no token, metrics off), community packs for TypeScript, JavaScript, React, Python, Rust, secrets and the OWASP Top 10, diff-aware against the base commit, with Astro frontmatter and scripts extracted so the TypeScript rules read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq Signed-off-by: Bryan Fawcett <bryan@nyuchi.com>
Review findings on #95: - run npm, pnpm and cargo audit on copies of the lockfile in an empty directory, with the registry on the command line, so a pull request's .npmrc, .pnpmfile.cjs or .cargo/audit.toml can neither run code nor silence the audit; - resolve ranged requirements files with uv pip compile --no-build, fall back to the exact pins, and warn rather than fail when nothing can be pinned; drop git and URL references before pip-audit; - scan Astro extracts in a scratch git repo holding the base and head versions, with Semgrep's baseline, so only new findings count; - show Semgrep's scan summary in the log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq Signed-off-by: Bryan Fawcett <bryan@nyuchi.com>
Re-review findings on #95: strip the pnpm, packageManager and devEngines fields from package.json before pnpm audit, so a pull request cannot add auditConfig ignores or switch the pinned pnpm, and turn off pnpm's version switching. Drop `name@url` requirements however the `@` is spaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq Signed-off-by: Bryan Fawcett <bryan@nyuchi.com>
Review finding on #95: a wildcard pin such as `six==1.*` crashed pip-audit and turned the whole file into "not audited". The fallback now keeps only exact `==` versions (markers allowed, indentation allowed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq Signed-off-by: Bryan Fawcett <bryan@nyuchi.com>
Member
Author
Merge gate recordCode review (
Runtime verification: draft PR #96 planted findings on top of this branch. All three jobs failed as intended:
Locally I also confirmed:
On this PR itself, with nothing to review, all checks are green. Note for rollout: the community rule |
bryanfawcett
added a commit
that referenced
this pull request
Oct 7, 2026
Release staging to main: #95 adds dependency-review.yml and reusable-semgrep.yml, which the enterprise rulesets read from refs/heads/main. The tree is staging's exact tree. Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq Signed-off-by: Bryan Fawcett <bryan@nyuchi.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
7 tasks
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
Two workflows for the enterprise rulesets in #94. Each runs on every pull request into the default branch and
staging, in every repo in the enterprise.dependency-review.ymlreview:actions/dependency-review-actionv5.0.0, pinned. It fails on a newly added dependency with ahighorcriticaladvisory (runtime and development scopes). It doesn't comment on the PR, so it also works on forks.audit: each ecosystem's own auditor, run only on the lockfiles the change touches.npm auditandpnpm auditfail on high and above.cargo auditfails on any advisory.pip-auditruns onuv.lock(viauv export) andrequirements*.txt, with--no-deps --disable-pipso nothing is installed, and fails on any advisory.yarn.lock,bun.lockandpoetry.lockare left toreviewand named in the job summary.reusable-semgrep.ymlp/typescript p/javascript p/react p/python p/rust p/secrets p/owasp-top-ten, plus the repo's own.semgrep.ymlor.semgrep/if it has one.--erroron findings. On PRs and merge queue groups it runs--baseline-commitagainst the base, so only new findings count. Other events get a full scan..astrofiles: the frontmatter and<script>blocks are extracted to.tsfiles (line numbers kept) and scanned with the same rules.p/secretsreads.astrodirectly.workflow_callandpull_request/merge_grouptriggers, so the ruleset can name it directly and repos can also call it.A ruleset-run workflow ignores
on:filters, so both workflows check the event themselves.How it is enforced
Two new enterprise rulesets, in evaluate mode only, will name these files at
refs/heads/main, targeting~DEFAULT_BRANCHandstaging(same conditions asenterprise-release-version-check). They get switched to active only after the evaluate numbers have been reviewed (#94).Verification
This repo runs both workflows on its own PRs, so this PR dogfoods them (see the checks below). Locally:
actionlint, prettier and yamllint (repo config) pass.npm audit --package-lock-only,pnpm@10.34.6 audit(withmanage-package-manager-versions=false) andpip-audit --no-deps --disable-pipwere run against real lockfiles from mzizi-dev/packages-npm and shamwari-ai/shamwari.Refs #94
🤖 Generated with Claude Code
https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq