The release gate of NetOrk/netork#1390, decided 2026-11-07: no image may be pushed that brings a new fixable critical or high CVE compared with the last release of the same image.
verdict answers "does a rebuild improve on the pin?". This adds the other question as its own module and action.
What
image_tools/cve_gate.py: Trivy lists the packages of the release and of the candidate. netOrk's matcher in kb-server (POST /api/v1/match, kb-server#155) judges both in one call, so against one state of its data. Its new holds the critical/high (CVE, package) pairs only the candidate has, and the gate sorts them:
new and with a fixed version → blocked (exit 1);
new without a fix → listed in the report; passes, because nobody can close it yet;
what the release already had → no regression, not listed;
matcher not asked (an empty NETORK_LICENSE_KEY, 401/403, a network error, a Trivy failure) → no verdict (exit 2). That never passes.
actions/cve-gate: inputs release, candidate, arch; output passed. It prints the report into the log and writes cve-gate.json and cve-gate.md. The step's exit code is the gate's.
verify.py:
trivy_sbom(ref, platform=None) reads one platform of an index (--platform linux/arm64).
kb_key() refuses an empty key before anything is sent. The verdict used to end in a KeyError there.
refusal() says what kb.netork.io's 401 and 403 mean. The licence server's forward-auth takes per-service API keys only, so a licence key (nlk_…) is always a 401; a known key without feature_match is a 403. The key itself never reaches the log.
README (the action, and which key NETORK_LICENSE_KEY must hold) and a new CHANGELOG.
Tests
tests/test_cve_gate.py was written first and was red (ModuleNotFoundError). Its fixtures are two Trivy --list-all-pkgs reports (release, candidate) and kb-server's answer on them:
only the new fixable urllib3 high blocks;
zlib's new critical without a fix is listed;
openssl's and jinja2's highs are in both images, so they are not new;
severities, no-verdict paths, the missing key (Trivy does not even run), the 401/403 texts, the report, the exit codes.
tests/test_actions.py covers the new action. pytest -q: 133 passed. ruff 0.14.0 format/check and shellcheck are clean.
Merge note
NetOrk/netork pins this branch's head commit 1a7319bac45587608c6b2415dff26ac43f88bacb for every image-tools action (one commit for all, tests/test_image_chain.py). Merge with a merge commit (not squash or rebase), so that commit stays reachable from main. Otherwise the netork PR must be re-pinned to the resulting commit.
The release gate of NetOrk/netork#1390, decided 2026-11-07: no image may be pushed that brings a *new fixable* critical or high CVE compared with the last release of the same image.
`verdict` answers "does a rebuild improve on the pin?". This adds the other question as its own module and action.
## What
- **`image_tools/cve_gate.py`**: Trivy lists the packages of the release and of the candidate. netOrk's matcher in kb-server (`POST /api/v1/match`, kb-server#155) judges both in one call, so against one state of its data. Its `new` holds the critical/high (CVE, package) pairs only the candidate has, and the gate sorts them:
- new **and** with a fixed version → **blocked** (exit 1);
- new without a fix → listed in the report; passes, because nobody can close it yet;
- what the release already had → no regression, not listed;
- matcher not asked (an empty `NETORK_LICENSE_KEY`, 401/403, a network error, a Trivy failure) → **no verdict** (exit 2). That never passes.
- **`actions/cve-gate`**: inputs `release`, `candidate`, `arch`; output `passed`. It prints the report into the log and writes `cve-gate.json` and `cve-gate.md`. The step's exit code is the gate's.
- **`verify.py`**:
- `trivy_sbom(ref, platform=None)` reads one platform of an index (`--platform linux/arm64`).
- `kb_key()` refuses an empty key before anything is sent. The verdict used to end in a `KeyError` there.
- `refusal()` says what kb.netork.io's 401 and 403 mean. The licence server's forward-auth takes per-service API keys only, so a licence key (`nlk_…`) is always a 401; a known key without `feature_match` is a 403. The key itself never reaches the log.
- README (the action, and which key `NETORK_LICENSE_KEY` must hold) and a new CHANGELOG.
## Tests
`tests/test_cve_gate.py` was written first and was red (`ModuleNotFoundError`). Its fixtures are two Trivy `--list-all-pkgs` reports (release, candidate) and kb-server's answer on them:
- only the new fixable urllib3 high blocks;
- zlib's new critical without a fix is listed;
- openssl's and jinja2's highs are in both images, so they are not new;
- severities, no-verdict paths, the missing key (Trivy does not even run), the 401/403 texts, the report, the exit codes.
`tests/test_actions.py` covers the new action. `pytest -q`: 133 passed. ruff 0.14.0 format/check and shellcheck are clean.
## Merge note
NetOrk/netork pins this branch's head commit `1a7319bac45587608c6b2415dff26ac43f88bacb` for every image-tools action (one commit for all, `tests/test_image_chain.py`). Merge with a **merge commit** (not squash or rebase), so that commit stays reachable from main. Otherwise the netork PR must be re-pinned to the resulting commit.
The release gate of NetOrk/netork#1390. The verdict answers "does a rebuild
improve on the pin?"; a release needs the other question: does the candidate
bring a critical or high CVE that the last release of the same image does not
have and that has a fix? Both inventories go to netOrk's matcher in one call
(kb-server's POST /api/v1/match, one state of its data), and only new and
fixable blocks. A new one without a fix is listed: nobody can close it yet.
No verdict never passes, and an empty NETORK_LICENSE_KEY is said so before
Trivy runs. kb.netork.io's 401 and 403 come from the licence server's
forward-auth and now say what they mean: a licence key where a kb API key
belongs, an unknown key, or a plan without feature_match.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The release gate of NetOrk/netork#1390, decided 2026-11-07: no image may be pushed that brings a new fixable critical or high CVE compared with the last release of the same image.
verdictanswers "does a rebuild improve on the pin?". This adds the other question as its own module and action.What
image_tools/cve_gate.py: Trivy lists the packages of the release and of the candidate. netOrk's matcher in kb-server (POST /api/v1/match, kb-server#155) judges both in one call, so against one state of its data. Itsnewholds the critical/high (CVE, package) pairs only the candidate has, and the gate sorts them:NETORK_LICENSE_KEY, 401/403, a network error, a Trivy failure) → no verdict (exit 2). That never passes.actions/cve-gate: inputsrelease,candidate,arch; outputpassed. It prints the report into the log and writescve-gate.jsonandcve-gate.md. The step's exit code is the gate's.verify.py:trivy_sbom(ref, platform=None)reads one platform of an index (--platform linux/arm64).kb_key()refuses an empty key before anything is sent. The verdict used to end in aKeyErrorthere.refusal()says what kb.netork.io's 401 and 403 mean. The licence server's forward-auth takes per-service API keys only, so a licence key (nlk_…) is always a 401; a known key withoutfeature_matchis a 403. The key itself never reaches the log.NETORK_LICENSE_KEYmust hold) and a new CHANGELOG.Tests
tests/test_cve_gate.pywas written first and was red (ModuleNotFoundError). Its fixtures are two Trivy--list-all-pkgsreports (release, candidate) and kb-server's answer on them:tests/test_actions.pycovers the new action.pytest -q: 133 passed. ruff 0.14.0 format/check and shellcheck are clean.Merge note
NetOrk/netork pins this branch's head commit
1a7319bac45587608c6b2415dff26ac43f88bacbfor every image-tools action (one commit for all,tests/test_image_chain.py). Merge with a merge commit (not squash or rebase), so that commit stays reachable from main. Otherwise the netork PR must be re-pinned to the resulting commit.