ci: move the audit off the release gate and onto a schedule #10

Merged
chrnx merged 2 commits from ci/audit-out-of-the-release-gate into main 2026-08-07 22:02:13 +00:00
Owner

Two advisories landed in this tree in one day — js-yaml in the morning, nanoid a couple of hours later. Neither was caused by a code change. A release gated on npm audit fails by calendar date, and it fails at the moment there is least time to judge whether a fix is safe.

The reasoning: who is actually exposed?

What ships from this repo is built HTML, CSS and JS. Astro, js-yaml and nanoid are build-time tools that never reach a visitor. Both of today's advisories (quadratic CPU in !!omap resolution; an infinite loop on size: 0) require control over build inputs to matter — and an attacker with that has already won by a wider margin than npm audit can measure.

What changes

release.yml — the audit drops to --audit-level=critical. A tripwire for the catastrophic case, not a trigger for routine noise.

ci.yml — untouched. Still --audit-level=moderate on every PR and push, which is where there is time and context to fix things. Today's two were resolved in minutes precisely because no release was waiting on them.

audit.yml — new. Mondays at 07:00 local, Gitea only, files an internal issue when something turns up. Deduped, so a weekly cron cannot open 52 copies of the same thing. workflow_dispatch included so it can be run on demand.

Why the schedule is the point

This is what makes the relaxed gate safe rather than negligent. Advisories still get found — they arrive as an issue on Monday morning instead of as a broken release on a Friday afternoon. Learning about a vulnerability and being unable to publish stop being the same event.

It also lands where work already gets picked up, instead of as a red run somebody has to notice.

One thing this is not

It is not supply-chain protection, and it should not be mistaken for it. Against a malicious package, the defences are npm ci against a committed lockfile, pinned transitives and release provenance — all of which are already in place. npm audit cannot tell a hostile package from a quadratic loop in an edge case, so treating it as that defence buys reassurance rather than safety.

Verified

Both workflow files parse. The dedup query was exercised locally against sample payloads in both directions — an existing open issue returns 1 and short-circuits; no match returns 0 and proceeds to file.

Two advisories landed in this tree in one day — js-yaml in the morning, nanoid a couple of hours later. Neither was caused by a code change. A release gated on `npm audit` fails by **calendar date**, and it fails at the moment there is least time to judge whether a fix is safe. ## The reasoning: who is actually exposed? What ships from this repo is built HTML, CSS and JS. Astro, js-yaml and nanoid are build-time tools that never reach a visitor. Both of today's advisories (quadratic CPU in `!!omap` resolution; an infinite loop on `size: 0`) require control over build inputs to matter — and an attacker with that has already won by a wider margin than `npm audit` can measure. ## What changes **`release.yml`** — the audit drops to `--audit-level=critical`. A tripwire for the catastrophic case, not a trigger for routine noise. **`ci.yml`** — untouched. Still `--audit-level=moderate` on every PR and push, which is where there is time and context to fix things. Today's two were resolved in minutes precisely because no release was waiting on them. **`audit.yml`** — new. Mondays at 07:00 local, Gitea only, files an internal issue when something turns up. Deduped, so a weekly cron cannot open 52 copies of the same thing. `workflow_dispatch` included so it can be run on demand. ## Why the schedule is the point This is what makes the relaxed gate safe rather than negligent. Advisories still get found — they arrive as an issue on Monday morning instead of as a broken release on a Friday afternoon. **Learning about a vulnerability and being unable to publish stop being the same event.** It also lands where work already gets picked up, instead of as a red run somebody has to notice. ## One thing this is not It is not supply-chain protection, and it should not be mistaken for it. Against a malicious package, the defences are `npm ci` against a committed lockfile, pinned transitives and release provenance — all of which are already in place. `npm audit` cannot tell a hostile package from a quadratic loop in an edge case, so treating it as that defence buys reassurance rather than safety. ## Verified Both workflow files parse. The dedup query was exercised locally against sample payloads in both directions — an existing open issue returns `1` and short-circuits; no match returns `0` and proceeds to file.
chrnx added 1 commit 2026-08-07 21:55:05 +00:00
Two advisories landed in this tree in a single day — js-yaml in the morning,
nanoid a couple of hours later. Neither had anything to do with a code change.
A release gated on `npm audit` fails by calendar date, and it fails at the
exact moment there is least time to judge whether a fix is safe.

What ships from here is built HTML, CSS and JS. Astro, js-yaml and nanoid are
build-time tools that never reach a visitor; the advisories in question need
control over build inputs to matter, and an attacker with that has already won.

So the release gate drops to `critical` — a tripwire for the catastrophic case,
not a trigger for routine noise. Nothing is lowered anywhere else: ci.yml still
blocks every PR at moderate, which is where there is time and context to fix.

The new scheduled audit is what makes that safe rather than negligent. Monday
mornings on Gitea, filing an internal issue when something turns up, with a
dedup check so a weekly cron cannot open 52 copies. Learning about a
vulnerability and being unable to publish stop being the same event.

`workflow_dispatch` is included so it can be run and verified on demand.
chrnx added 1 commit 2026-08-07 21:59:50 +00:00
chrnx merged commit 9d82ec0f1f into main 2026-08-07 22:02:13 +00:00
Sign in to join this conversation.