Skip to content

ci: run the SECURITY.md advisory register checks on the document-only path - #2025

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/2018-security-register-focused-path
Oct 31, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/2018-security-register-focused-path

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

SECURITY.md is a root document, so a PR that edits only that file takes the ADR 0011 focused path, which skips npm run check:audit and deliberately omits tests/audit-gate.test.mjs because its CLI arms spend ~40s on retry and deadline timing. That file also held the four checks binding ALLOWLISTED_ADVISORIES to the "Known unpatched dependency advisories" table, so the one document those checks police was the one document whose edit switched them off.

Changes, as specified in #2018:

  • tests/security-advisory-register.test.mjs (new): the four register checks and documentedAdvisoryIds() moved verbatim out of tests/audit-gate.test.mjs. Two file reads, about 100 ms.
  • .github/workflows/ci.yml: the new file is added to the focused contract list; the comment explaining why audit-gate.test.mjs stays on the full path is updated.
  • tests/content-only-ci-workflow.test.mjs: the new file is pinned in the required list so it cannot be dropped from the focused path again.

No gate semantics change. tests/audit-gate.test.mjs keeps every import it still uses.

Remit: a document-only edit to SECURITY.md could add or remove a suppression row while CI stayed green; the register checks now run on that path.

Fixes #2018

Verification

  • node --test tests/security-advisory-register.test.mjs 4/4; tests/content-only-ci-workflow.test.mjs 4/4; tests/audit-gate.test.mjs 57/57 (was 61; total unchanged)
  • Focused path run exactly as ci.yml runs it: 220/220
  • npm run test:unit:coverage:check: 3802/3802, gate exit 0
  • npm run check:unused, eslint and prettier --check on the touched files: clean

Checklist

  • Commits are DCO-signed (git commit -s)

@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit 6f9d3e6
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ae5618b284755ee964a3411
😎 Deploy Preview https://deploy-preview-2025--endusers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tree at 736540c, not just the diff. This looks correct to me, and the one red check is not this PR's fault — details below.

Verified:

  • The four register checks plus documentedAdvisoryIds() move verbatim from tests/audit-gate.test.mjs to tests/security-advisory-register.test.mjs — I diffed the removed lines against the added file line-by-line; every removed line reappears unchanged (the 19 extra lines are the new header comment and imports).
  • tests/audit-gate.test.mjs keeps every import it still uses: readFileSync (line 657), ALLOWLISTED_ADVISORIES (lines 256, 358, 366), repoRoot/join (line 610 onward). Nothing dangles.
  • Importing scripts/audit-gate.mjs from the new file is side-effect free: main() is behind if (import.meta.url === \file://${process.argv[1]}`)` (last lines of the script), so the focused path won't accidentally run the gate.
  • tests/content-only-ci-workflow.test.mjs:71 pins the new file in the required focused-path list, closing the regression #2018 describes.
  • Ran node --test tests/security-advisory-register.test.mjs tests/content-only-ci-workflow.test.mjs on the PR head: 8/8 pass in ~150 ms, confirming the "two file reads, cheap enough for the focused path" claim.
  • Matches the spec in #2018 exactly (move the four checks, add to focused list, pin them).

The failing Validate repository check is a base-branch issue, not this diff. The failed step is "Audit dependencies against the advisory allowlist". I reproduced it locally on the PR head: npm run check:audit fails on two advisories published after main's last CI run (Oct 13) — follow-redirects GHSA-mrwp-f3q8-3g9p and joi GHSA-4528-x5fx-h6hg, both high. This PR touches no dependency, lockfile, or allowlist (git diff --stat: ci.yml + three test files), so main fails identically today. Per the gate's own message, the "Dependency audit fix" workflow on main should open the fix PR; once that lands and this branch re-runs, this check should go green with no change here.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The red Validate repository check here is base staleness, not this diff.

The failure is audit-gate: moderate/low advisories npm can fix within the declared ranges: deepmerge (low): GHSA-gcqx-w48m-w2h4. That exact false positive is what #2027 fixed — the gate now confirms an in-range fix actually moves the locked version before failing on it. #2027 merged as 3ebb098 at 2026-10-31T01:18:30Z, after the last run on this head.

Verified on origin/main @ 3ebb098: npm run check:audit → audit-gate: ok — 0 high/critical finding(s), exit 0.

Merging main into this branch (or clicking Update branch) should clear the check. The head is in a fork, so this lane cannot push the merge itself.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 3ebb098

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

… path

SECURITY.md is a root document, so a pull request that edits only that file
takes the ADR 0011 focused path, which skips check:audit and deliberately
omits tests/audit-gate.test.mjs because its CLI arms spend ~40s on retry and
deadline timing. That file also held the four checks binding the gate's
ALLOWLISTED_ADVISORIES to the "Known unpatched dependency advisories" table,
so the one document those checks police was the one document whose edit
switched them off.

Move the four register checks verbatim into
tests/security-advisory-register.test.mjs (two file reads, ~100ms), add it to
the focused contract list in ci.yml, and pin it in the
content-only-ci-workflow contract so it cannot be dropped again.

Fixes cncf#2018

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
mrbobbytables added a commit to mrbobbytables/endusers that referenced this pull request Oct 31, 2026
…2027)

npm 10 (the CI toolchain) reports deepmerge's GHSA-gcqx-w48m-w2h4 as
fixAvailable: true although every published release of deepmerge sits
inside the advisory's vulnerable range, so `npm audit fix
--package-lock-only` leaves the lockfile where it is. Taken at face
value that reds the Validate repository check on every full-path PR
(cncf#2025, cncf#2026) with an instruction nobody can carry out; npm 11 reports
the same advisory as unfixable.

The gate now asks `npm audit fix` itself: when a moderate/low finding is
reported as fixable in range, it runs the fix on a scratch copy of
package.json and package-lock.json and compares the named package's
locked versions (at every nesting depth) before and after. A finding
whose versions did not move is logged as a warning and no longer fails
the gate; one that did move fails it exactly as before. A scratch run
that cannot be judged (spawn error, deadline, no JSON, npm error
document, unreadable lockfile) fails closed by treating every finding
as real, so a registry fault behaves as it did before this check.

Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrbobbytables
mrbobbytables force-pushed the fix/2018-security-register-focused-path branch from 736540c to 6f9d3e6 Compare October 31, 2026 03:33
@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 31, 2026
Merged via the queue into cncf:main with commit abfbc18 Oct 31, 2026
15 checks passed
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.

[sec-check] Document-only CI path skips the checks binding SECURITY.md's advisory register to the audit gate's allowlist

1 participant