From 179fbf17bcfefbe3e8e25b4cc9754070202bc290 Mon Sep 17 00:00:00 2001 From: Mark Hazleton Date: Sat, 21 Nov 2026 08:38:32 -0600 Subject: [PATCH] ci(security): audit prod deps strictly, allowlist dev-only advisories The Security workflow has failed weekly on two moderate advisories that only affect dev tooling and have no upstream fix yet: - GHSA-3g3m-2fjr-6pw4 (glob, via jest 30 and test-exclude) - GHSA-g3hv-75wg-m249 (minimatch, via typedoc 0.28 and test-exclude) `npm audit` now runs with --omit=dev so any production advisory still fails the build. audit-ci keeps auditing all dependencies via audit-ci.jsonc, which allowlists only these two IDs, so new dev advisories still fail too. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/security.yml | 8 ++++---- audit-ci.jsonc | 15 +++++++++++++++ package.json | 4 ++-- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 audit-ci.jsonc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f69bd88..121dfb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,11 +95,11 @@ jobs: - name: Install dependencies run: npm ci - - name: Run security audit - run: npm audit --audit-level=moderate + - name: Run security audit (production dependencies) + run: npm audit --omit=dev --audit-level=moderate - - name: Check for known vulnerabilities - run: npx audit-ci --moderate + - name: Check for known vulnerabilities (all dependencies, allowlisted dev-only advisories) + run: npx audit-ci --config audit-ci.jsonc package-check: name: Package Validation diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 3c8a610..ffb8555 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -32,11 +32,11 @@ jobs: - name: Install dependencies run: npm ci - - name: Run npm audit - run: npm audit --audit-level=moderate + - name: Run npm audit (production dependencies) + run: npm audit --omit=dev --audit-level=moderate - - name: Run audit-ci - run: npx audit-ci --moderate + - name: Run audit-ci (all dependencies, allowlisted dev-only advisories) + run: npx audit-ci --config audit-ci.jsonc - name: Check for known vulnerabilities with Snyk uses: snyk/actions/node@master diff --git a/audit-ci.jsonc b/audit-ci.jsonc new file mode 100644 index 0000000..2906303 --- /dev/null +++ b/audit-ci.jsonc @@ -0,0 +1,15 @@ +{ + "$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json", + "moderate": true, + "show-not-found": true, + // Dev-only advisories with no upstream fix yet (2026-11-21). + // Production deps are audited separately via `npm audit --omit=dev`, so these + // stay blocked if they ever reach the published package. + // Remove each entry once jest/ts-jest and typedoc allow the patched versions. + "allowlist": [ + // glob 9.0.0-14.0.1 (fixed 14.0.2): via jest 30 (^13) and test-exclude + "GHSA-3g3m-2fjr-6pw4", + // minimatch 7.0.0-11.0.0 (fixed 11.0.1): via typedoc 0.28 (^10) and test-exclude + "GHSA-g3hv-75wg-m249" + ] +} diff --git a/package.json b/package.json index 9aefb4e..589b6fd 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "postversion": "git push && git push --tags", "docs": "typedoc src/index.ts --out api-docs", "docs:update-version": "node scripts/update-docs-version.js", - "security:audit": "npm audit --audit-level=moderate", - "security:check": "npx audit-ci --moderate", + "security:audit": "npm audit --omit=dev --audit-level=moderate", + "security:check": "npx audit-ci --config audit-ci.jsonc", "security:update": "npx npm-check-updates -u && npm install && npm test", "security:verify": "node scripts/check-security.js", "prepare": "husky"