feat(cve-gate): no image goes out with a new fixable critical or high CVE
CI / Tests, lint (pull_request) Successful in 13s

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.
This commit is contained in:
Christian Manivong committed 2026-11-08 00:56:11 +01:00
1 parent adf80a7131
commit 1a7319bac4
10 files changed
+640 -10

No files matched your search

+20
View File
@@ -22,6 +22,7 @@ with its CIS result and SBOM attached (NetOrk/netork#1390).
| **Signature** (`bin/sign.sh`) | A cosign signature on the reference and on every platform image behind it, with the CIS result and the SBOM as in-toto attestations. Nothing goes to a public transparency log. |
| **Verification** (`bin/verify-base.sh`, `bin/verify-signature.sh`) | Every `FROM` image of a Dockerfile is pinned by digest and signed with the key in `cosign.pub`. |
| **Verdict** (`image_tools/verify.py`) | Whether a rebuild improves on the pinned image, by netOrk's matcher (kb-server), for a base's nightly. |
| **CVE gate** (`image_tools/cve_gate.py`) | Whether a candidate brings a critical or high CVE that the last release of the same image does not have **and** that has a fix, by the same matcher in one call. Only that blocks; a new one without a fix is listed. No verdict (an empty key, a matcher that cannot be asked) never passes. |
| **Bump** (`image_tools/bump.py`) | One pull request in every repository of a `dependents.toml` that moves only the pin, and that repository's workflow started. |
## Using it in a workflow
@@ -49,6 +50,18 @@ with its CIS result and SBOM attached (NetOrk/netork#1390).
current: registry.netork.io/netork/base-os:pinned
candidate: registry.netork.io/netork/base-os:13-20261022.3-amd64
# a release's image, before the push: nothing new and fixable against the last release
- name: No new fixable critical or high CVE
uses: https://git.netork.io/NetOrk/image-tools/actions/cve-gate@<commit>
env:
NETORK_LICENSE_KEY: ${{ secrets.NETORK_LICENSE_KEY }}
TRIVY_USERNAME: ${{ secrets.REGISTRY_USER }}
TRIVY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
with:
release: registry.netork.io/netork/engine:0.49.0
candidate: registry.netork.io/netork/engine:main-abc1234
arch: amd64
# push it, then:
- name: Sign it
uses: https://git.netork.io/NetOrk/image-tools/actions/sign@<commit>
@@ -59,6 +72,13 @@ with its CIS result and SBOM attached (NetOrk/netork#1390).
ref: registry.netork.io/netork/engine@sha256:…
```
**The key.** The verdict and the CVE gate ask kb.netork.io's `POST /api/v1/match`, which
sits behind the licence server's forward-auth. `NETORK_LICENSE_KEY` must therefore hold a
**kb API key** (`nak_kb_…`) of an instance whose plan grants kb's `feature_match`, not a
licence key (`nlk_…`): the forward-auth answers a licence key with 401, a plan without the
entitlement with 403. The gate says which in its report. It exits 0 when it passes, 1 when it
is blocked and 2 without a verdict, and the step fails on both of the last two.
The judge action reads `cis.toml` and `packages.allow` from the working directory by default.
The runner needs Docker, Python 3.12 or newer, and `curl`; cosign is installed by the actions,
pinned and checked against its release checksum (`bin/install-cosign.sh`).