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"