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.
45 lines
1.8 KiB
YAML
45 lines
1.8 KiB
YAML
name: No new fixable critical or high CVE
|
|
description: >-
|
|
The release gate (image_tools/cve_gate.py): fails when the candidate has a
|
|
critical or high CVE that the last release of the same image does not have
|
|
and that has a fix, by netOrk's matcher in kb-server. A new one without a fix
|
|
is listed and passes. Writes cve-gate.json and cve-gate.md, prints the report,
|
|
and fails as well when no verdict could be reached, an empty key included.
|
|
The caller passes NETORK_LICENSE_KEY (a kb API key whose plan grants
|
|
feature_match), and TRIVY_USERNAME/TRIVY_PASSWORD for the registry, as env.
|
|
inputs:
|
|
release:
|
|
description: The last release of the image, as a registry reference
|
|
required: true
|
|
candidate:
|
|
description: The image to push, as Docker can run it (local tag or reference)
|
|
required: true
|
|
arch:
|
|
description: The platform both are read for, amd64 or arm64
|
|
required: true
|
|
outputs:
|
|
passed:
|
|
description: '"true" when the candidate brings no new fixable critical or high CVE'
|
|
value: ${{ steps.gate.outputs.passed }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- id: gate
|
|
shell: bash
|
|
env:
|
|
RELEASE: ${{ inputs.release }}
|
|
CANDIDATE: ${{ inputs.candidate }}
|
|
ARCH: ${{ inputs.arch }}
|
|
PYTHONPATH: ${{ github.action_path }}/../..
|
|
run: |
|
|
status=0
|
|
python3 -m image_tools.cve_gate "$RELEASE" "$CANDIDATE" --platform "linux/$ARCH" \
|
|
--json cve-gate.json --report cve-gate.md || status=$?
|
|
# Into the log: Gitea shows no step summary.
|
|
cat cve-gate.md
|
|
cat cve-gate.md >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "$status" -eq 0 ]; then passed=true; else passed=false; fi
|
|
echo "passed=$passed" >> "$GITHUB_OUTPUT"
|
|
# 1: blocked, 2: no verdict. Either way nothing is pushed.
|
|
exit "$status"
|