Skip to content

feat(security): fail-closed npm-audit gate (no critical/high vulns ships)#99

Closed
bdelanghe wants to merge 1 commit into
mainfrom
feat/gate-no-critical-vulns
Closed

feat(security): fail-closed npm-audit gate (no critical/high vulns ships)#99
bdelanghe wants to merge 1 commit into
mainfrom
feat/gate-no-critical-vulns

Conversation

@bdelanghe

Copy link
Copy Markdown
Contributor

Summary

Adds a fail-closed dependency-vulnerability gate. scripts/check-vulns.mjs re-runs npm audit over the committed package-lock.json, counts critical + high advisories, and fails CI unless that count is 0 and matches the committed evidence.vulns.knownCriticalOrHighVulns (drift guard) — same discipline as the axe / SBOM gates. Wired as a named step in the brand-checks conformance job. Scanned: 0 critical / 0 high.

Honest scope (important)

This does not yet flip the lone security.no-critical-vulns conformance row. The site's vendored conformance-kit (rev bf20952) still folds the vuln count into a combined e.security object shared with OWASP ASVS — supplying the vuln count alone would force a false ASVS verdict, which the honesty model forbids. lone's source has split vulns/asvs, but the vendored kit hasn't adopted it.

→ The committed evidence.vulns is the gate's drift baseline today; the conformance row flips with no new evidence once conformance-kit adopts the split and the site re-vendors. Tracked: prx-0ip7 (unblock), prx-2efn (this).

Why ship the gate now anyway

It's independently valuable and honest: the build now refuses to ship with known critical/high vulns, and it pre-positions the evidence for the row flip.

Test plan

  • node scripts/check-vulns.mjsok — 0 known critical/high vulns (verified in the nix devshell).
  • Drift/posture paths fail closed (exit 1) by construction.
  • Draft until CI is green.

🤖 Generated with Claude Code

…ips)

Adds scripts/check-vulns.mjs — re-runs `npm audit` over the lockfile, counts
critical+high, and fails closed unless that count is 0 AND matches the committed
evidence.vulns value (drift guard), same discipline as the axe/SBOM gates. Wired
as a named step in the brand-checks `conformance` job. Scanned: 0 critical / 0 high.

Does NOT yet flip the lone `security.no-critical-vulns` conformance row: the
vendored conformance-kit (rev bf20952) still folds the vuln count into a combined
`security` object shared with OWASP ASVS, so supplying it would force a false ASVS
verdict. The row flips with no new evidence once conformance-kit adopts lone's
split vulns/asvs schema and the site re-vendors (follow-up).

Advances prx-2efn (gate landed; conformance-row flip blocked on the kit split).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bdelanghe

Copy link
Copy Markdown
Contributor Author

Superseded by the re-vendor (#102, merged): conformance-kit e8838ed ships gates/vuln-gate.mjs (productized npm-audit gate, exact shape lone's split vulns schema consumes) — now vendored in the site. The follow-up will wire that upstream gate + add evidence.vulns to flip security.no-critical-vulns, replacing this hand-rolled scripts/check-vulns.mjs. Tracked under prx-tnqu / prx-2efn.

@bdelanghe bdelanghe closed this Jun 29, 2026
@bdelanghe bdelanghe deleted the feat/gate-no-critical-vulns branch June 29, 2026 04:31
bdelanghe added a commit that referenced this pull request Jun 29, 2026
…d vuln-gate (#103)

Vendors the upstream gates/vuln-gate.mjs (from the re-vendored conformance-kit
e8838ed), wires it as a fail-closed step in the brand-checks conformance job
(VULN_OMIT_DEV=false → all deps), and declares evidence.vulns
{ knownCriticalOrHighVulns: 0 }. The gate re-runs `npm audit` and fails closed on
any critical/high, so the committed 0 cannot drift — same discipline as axe.
Scanned: 0 critical / 0 high. Replaces the hand-rolled scripts/check-vulns.mjs
(closed PR #99). Lock regenerated (46 files @ e8838ed).

Closes prx-2efn.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant