Skip to content

feat(security): gate on CISA KEV and keep previous majors patched - #66

Merged
sylvesterdamgaard merged 1 commit into
mainfrom
sd/kev-gate
Nov 9, 2026
Merged

sylvesterdamgaard merged 1 commit into
mainfrom
sd/kev-gate

Conversation

@sylvesterdamgaard

Copy link
Copy Markdown
Contributor

CVE severity is a guess; CISA KEV is evidence of exploitation. Until now nothing here looked at KEV, and the watch only saw fixable HIGH/CRITICAL in the current channel.

What changes

  • Pre-promotion: any fixable KEV entry blocks tag promotion, at any severity (amd64 + arm64). Unfixed ones don't block publishing, since that would also hold back every other fix.
  • Hourly watch: scans every severity, fixed or not. Any KEV entry fails it. An unfixed one needs a justified, expiring entry in security/kev-exceptions.json. .trivyignore cannot silence a KEV.
  • The watch now also covers the previous major while it is in maintenance (versions.json → release.maintenance, v1 until 2027-05-07) and dispatches rebuilds on release/v1.
  • maintain-previous-majors.yml starts the v1 chain weekly. Schedules never fire on non-default branches, so v1 had no rebuild path once v2 took over main. Chaining on the branch itself is fix(ci): chain v1 downstream builds on the maintenance branch #65.

What the first full run found (36 images, v2 + v1, local run of this script)

  • v2: 0 KEV, 0 fixable HIGH/CRITICAL.
  • nginx:bookworm-v1: libbrotli1 1.0.9-2+b6, CVE-2026-111497, KEV due 2026-11-10. Rebuilt from release/v1 today; now 1.0.9-2+deb12u1.
  • CVE-2023-44487 (HTTP/2 Rapid Reset): exceptions with reasons in the file. Debian's nginx 1.22 in v1 php-fpm-nginx has no fix, and the image never enables HTTP/2 (its http2 on; is rejected by 1.22). The standalone nginx image runs nginx.org 1.29, which has had the mitigation since 1.25.3.
  • v1 php images: 11 fixable HIGH each (last built 2026-11-06). A full v1 rebuild is running.

https://claude.ai/code/session_01VnY3qneHHtCCBAr7izcfjC

@cbox-agents cbox-agents Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Talking to Cbox
  • Reply under a finding to ask Cbox about it.
  • /cbox fix in reply to a finding: Cbox fixes it on this pull request's branch, or, when it can't push there, on a new branch whose push waits for a confirm in Cbox.
  • /cbox review reviews this pull request again now.
  • /cbox <question> asks Cbox about this pull request.
  • /cbox remember <rule> proposes a rule for Cbox's reviews; an owner or admin approves it in Cbox.
  • /cbox config shows the review settings this pull request uses and where each comes from.
  • /cbox help shows this list.

Only people who can push to this repository and have linked their GitHub account in Cbox can use /cbox.


- name: Fail on fixable known-exploited vulnerabilities (amd64, pre-promotion)
if: inputs.enable-trivy
run: python3 scripts/security-watch.py kev-gate --report trivy-kev-amd64.json --kev /tmp/kev.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kev-gate runs scripts/security-watch.py, but the job's sparse checkout (line 854) does not fetch that file. This blocks the merge.

Add scripts/security-watch.py to the sparse-checkout list in the 'Checkout versions.json, CVE baseline and smoke-test scenario' step.


permissions:
contents: read
actions: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The new workflow grants actions: write workflow-wide so it can dispatch builds on release branches. Not blocking, but the scope should be narrowed.

Move permissions (contents: read, actions: write) to the dispatch job, set the workflow level to permissions: {}, and add a comment saying the write scope exists only for gh workflow run.

Comment thread scripts/security-watch.py
if not path.exists():
return set()
return {line.split()[0] for line in path.read_text().splitlines() if line.strip() and not line.startswith('#')}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ignored_ids() drops Trivy's exp:YYYY-MM-DD suffix on .trivyignore lines. Before this change, --ignorefile honoured it.

Parse the optional exp: token in ignored_ids() and skip entries whose date is before today.

A CVE in CISA's Known Exploited Vulnerabilities catalog is now
actionable at any severity, fixed or not. The pre-promotion gate blocks
a fixable KEV entry at any severity; the hourly watch fails on an
unfixed one until it has a reviewed, expiring exception in
security/kev-exceptions.json. .trivyignore cannot silence a KEV.

The watch also scans every previous major still inside its maintenance
window (versions.json release.maintenance) and dispatches rebuilds on
its release branch. maintain-previous-majors.yml starts that chain
weekly, because schedules never fire on a non-default branch: v1 had
no rebuild path at all once v2 took over main.

Found by the first run: nginx:bookworm-v1 carried libbrotli1
1.0.9-2+b6 (CVE-2026-111497, KEV due 2026-11-10).

Claude-Session: https://claude.ai/code/session_01VnY3qneHHtCCBAr7izcfjC

@cbox-agents cbox-agents Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 of 3 addressed.

Talking to Cbox
  • Reply under a finding to ask Cbox about it.
  • /cbox fix in reply to a finding: Cbox fixes it on this pull request's branch, or, when it can't push there, on a new branch whose push waits for a confirm in Cbox.
  • /cbox review reviews this pull request again now.
  • /cbox <question> asks Cbox about this pull request.
  • /cbox remember <rule> proposes a rule for Cbox's reviews; an owner or admin approves it in Cbox.
  • /cbox config shows the review settings this pull request uses and where each comes from.
  • /cbox help shows this list.

Only people who can push to this repository and have linked their GitHub account in Cbox can use /cbox.


permissions:
contents: read
actions: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

actions: write is granted to the whole workflow, not to the one job that dispatches. Not blocking.

Set top-level permissions: {} and move contents: read and actions: write under jobs.dispatch.permissions.

Comment thread scripts/security-watch.py
'--output', str(report_path), str(sbom)], check=True)
report = json.loads(report_path.read_text())
# Missing package detection is not evidence of a clean image.
if not any(r.get('Class') == 'os-pkgs' and r.get('Type') == 'debian' for r in report.get('Results', [])):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

v1 targets are filtered with main's .trivyignore, whose Bookworm, Go and npm exceptions are retired. No remediation exists for v1 non-OS findings.

Load the ignore file for each target's branch (for example git show origin/&lt;branch&gt;:.trivyignore), or report non-OS v1 findings without failing the watch.

@sylvesterdamgaard
sylvesterdamgaard merged commit b09731d into main Nov 9, 2026
104 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.

1 participant