Repository navigation
feat(vigutils): warn seven days before a security exception expires - #1555
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Security exception expiries surfaced only as a hard failure on the day
after.
check-expirationsruns in all PR CI (ci.yml:441,:524), inpre-commit, as the first step of both nightly
security-scan.ymllanes and inthe release train (
release.yml:906) — so one lapsed block reds every openbranch, both scan lanes and the release path at once, with zero prior warning.
That happened three times in two months (#1260, #1481, #1547), each time on a
date a human had chosen deliberately weeks earlier. The information existed;
nothing surfaced it.
This adds a seven-day advance notice. It is a notice, not a gate: the hard
gate is untouched.
Type of Change
feat-- New featureci-- CI/CD pipeline changesdocs-- Documentation onlytest-- Adding or updating testsModifiers
!) -- This change breaks backward compatibilityChanges Made
1.
check-expirations --warn-days Nand--json(
packages/vig-utils/src/vig_utils/check_expirations.py)--warn-days Nemits::warning::annotations (stderr, like the existing::error::ones) for entries falling due within N days, inclusive.It never changes an exit code: an entry inside the window is still valid, and
an already-expired entry still exits 1 exactly as today.
--jsonprints{"expired": [...], "expiring": [...]}on stdout, each record{"id", "file", "expiration", "days_left"}(days_leftis negative for anexpired entry). It replaces the human summary line so stdout is pure JSON,
and it is still emitted on the failing (expired) run, where a caller needs it
most.
classify_entries()holds the singleclassification rule;
check_file()is re-expressed through it and keeps itsexact contract, so the module stays the single parser of the
Expiration:grammar.
2. A third issue class in
.github/workflows/security-scan.yml(not a newworkflow — that job already carries the
main/devmatrix,issues: write,the label bootstrap and the ref-distinct dedup pattern from #1548)
Validate .vulnixignore exception expirationsstep, so an already-red register still reports what is coming next. A notice
scheduled after it would go silent exactly on the runs that need it.
.vulnixignore,.trivyignoreand.github/dependency-review-allow.txt. The nightly gate reads only the first,but the other two red every branch just as hard (curl 8.20.0 CVE exception batch expired 2026-07-22 — check-expirations now blocks all CI #1260 was a
.trivyignorecase).
date):
Security exception register (dev): exceptions expire 2026-09-02.Per-date because a date maps 1:1 to one combined review pass and staggered
dates then get their own issues — reinforcing the "stagger across weeks" rule
rather than flattening it. Dedup reuses the existing
gh issue list --state open --label security-scan --search "\"$TITLE\" in:title"lookup, with an exact-title filter on top because GitHub's search tokenises a
date and would otherwise let one date's open issue suppress another's.
continue-on-error: trueand everyghfailure degrades to a::warning::— the step can never turn a green nightly scan red. The hard gate stays the
validation step.
standard (read the latest findings delta first, delete what the pin
advance cleared, a renewal is a re-verification not a date bump) and links
docs/CONTAINER_SECURITY.md.3. Docs — new Advance notice, one grid period ahead subsection in
docs/CONTAINER_SECURITY.md, inside the exception-register section and rightafter the Wednesday-grid rationale it depends on. It states explicitly that this
is a notice and the gate is unchanged, and repeats the anti-blind-extension rule
(the notice deliberately arrives before the week's findings delta exists).
SECURITY.md:88("Expired entries fail CI via thecheck-expirationsutility")is still exactly true, so it is left alone.
Why 7 days
One expiry-grid period.
docs/CONTAINER_SECURITY.mdputs everyExpiration:ona Wednesday so an entry turns red on the Thursday after the week's Renovate
nixpkgsbump and the first nightly findings delta. A 7-day lead lands thenotice on a Wednesday too, one full Renovate cycle ahead: notice Wed, bump
merges Mon/Tue, nightly delta Tue/Wed, act Wed, red Thu.
Changelog Entry
Testing
just test)TDD evidence
Six commits, each phase its own commit:
050fe043test(vigutils): pin --warn-days and --json on check-expirations3170a59afeat(vigutils): add --warn-days and --json to check-expirations4ae883a6test(workflows): pin the seven-day exception expiry notice on security-scanbb35a932ci(security-scan): open an advance notice 7 days before an exception expires727c19abdocs(security): document the seven-day exception expiry notice9b1a831cdocs(changelog): record the security exception expiry advance noticeRED, utility —
ImportError: cannot import name 'classify_entries', 1 collection error.GREEN, utility —
25 passedinpackages/vig-utils/tests/test_check_expirations.py.RED, workflow —
7 failedin the newtests/test_workflow_expiry_notice.py(
AssertionError: no matching step found in security-scan.yml), while the threeexisting #1548 tests passed.
GREEN, workflow —
10 passedacross both workflow-shape files.tests/test_workflow_scan_failure_reporting.py::_reporting_stepmatched thefirst step containing
gh issue create, which the new step would have shadowed— it now also requires a
failure()guard, which the notice step deliberatelydoes not carry. Caught by running the full suite, not by the hook suite.
Verification output
Full test suite —
1645 passed, 20 skipped, 2 warnings in 282.61s.Default behaviour unchanged (the contract every existing call site relies on):
A test pins stdout to exactly
Validated 2 exception(s) across 1 file(s)\nwithempty stderr on a default run.
Real registers, real today (2026-08-20), 7-day window — nothing due, as
expected: 29 of 33 entries sit on
2026-09-02, 13 days out.Same registers with
todayinjected to 2026-08-26 (7 days before thatcliff) — 29 entries reported across all three registers, exit 0:
Workflow step executed locally, extracted from the YAML and run against the
real registers with stubbed
uv/gh(injectedtoday = 2026-08-26):gh issue create, titleSecurity exception register (dev): exceptions expire 2026-09-02, body listing exactly that date's entriesOpen notice already exists for 2026-09-02: #42 -- skipping create, exit 0WARN_DAYS=1, nothing dueNo security exceptions expire within 1 days on dev, exit 0::warning::could not classify the exception registers; the validation step below reports the real failure, exit 0Linting —
just precommit(prek run --all-files) fully green, 52 hooksPassed, zero failures, clean tree afterwards.actionlintgreen onsecurity-scan.ymlspecifically.zizmorin CI audits onlyassets/workspace/.github/workflows/, which this PR does not touch; every${{ }}in the new step is passed through stepenvrather than interpolatedinto the script.
Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Expiration:dates in theexception registers and touches only those dates. This PR changes no date in
any register. The only expected overlap is a
CHANGELOG.mdconflict in the## Unreleasedsection, which union-merges.assets/workspace/.Consumers get the
check-expirationspre-commit hook but ship no registersand no
security-scan.yml, so there is nothing to warn about;--warn-daysreaches them through the pinned utility if they ever add one.
--warn-daysin PR CI (a yellow annotation on everyPR). The issue lists it as "worth adding alongside" but not required, and a PR
annotation reaches whoever opens that run rather than the register's owner.
Left out to keep this diff minimal — worth a follow-up issue if wanted.
assets/workspace/.devcontainer/CHANGELOG.mddiff is thesync-manifestmirror of the root changelog, regenerated by the hook.
Refs: #1552