Skip to content

Commit 9ab434f

Browse files
Containermanthey
authored andcommitted
ci: add audit-ci allowlist for known false-positive advisories
Replace the bare 'npm audit --audit-level high' gate with audit-ci, which supports an allowlist of advisories. npm audit itself has no ignore mechanism, and the newly registered GHSA-hp3w-g68c-fv3c (sprintf-js) and GHSA-vfj7-8cjw-p6xm (braces) advisories are false positives that the maintainers will not fix upstream: sprintf-js already raises an exception for unbounded precision specifiers, and the braces advisory only applies to code that misuses the library. - Add audit-ci.jsonc with the two allowlisted advisories, including justifications and removal instructions. - CI keeps the previous churn profile: fail on high or critical. - Add 'npm run audit' as the local equivalent with a strict low gate, so a fully clean report remains enforced locally. - Refresh package-lock.json.
1 parent afd7b7f commit 9ab434f

4 files changed

Lines changed: 366 additions & 381 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ jobs:
9191
- run: rm package-lock.json
9292
- run: npm install
9393
- run: npm run install-test-browsers
94-
- run: npm audit --audit-level high
94+
# Security audit with allowlisted false positives (audit-ci.jsonc)
95+
- run: npx --yes audit-ci@^7 --config audit-ci.jsonc --report-type summary
9596
- run: npm run setup-website
9697
- run: npm run ci-xvfb
9798
- run: npm run ci-build-website

‎audit-ci.jsonc‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
3+
// CI (`.github/workflows/main.yml`) runs `npx audit-ci@^7 --config audit-ci.jsonc`,
4+
// which fails on high or critical advisories, matching the previous
5+
// `npm audit --audit-level high` gate. The local `npm run audit` script adds
6+
// `--low` on top of this config, so locally every advisory of any severity
7+
// fails unless it is allowlisted here.
8+
"high": true,
9+
"allowlist": [
10+
// False positive: sprintf-js raises an exception for unbounded precision
11+
// specifiers instead of expanding them; the maintainers will not change
12+
// this behavior. https://github.com/advisories/GHSA-hp3w-g68c-fv3c
13+
// (npm advisory 1241202). Remove this entry if the advisory is retracted.
14+
"GHSA-hp3w-g68c-fv3c",
15+
// False positive: the reported uncontrolled resource consumption requires
16+
// application code that misuses the library; geojs does not expose such
17+
// usage. https://github.com/advisories/GHSA-vfj7-8cjw-p6xm
18+
// (npm advisory 1240992). Remove this entry if the advisory is retracted.
19+
"GHSA-vfj7-8cjw-p6xm"
20+
]
21+
}

0 commit comments

Comments
 (0)