ci: attest the OpenVEX document to each image and scan the images of each release #2379
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2379"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
Closes #2333.
A vulnerability scanner reports every known vulnerability in an image, including those that do not affect NVSentinel. #2355 added
.openvex.jsonto the repository for those. It is a hand-written list of the vulnerabilities that do not affect our images, each with the reason, in the OpenVEX format that Grype and Trivy can read. No script generates it: a contributor adds a statement in a pull request and a maintainer reviews it. But the file is only in the repository, so a user who scans one of our images cannot get it from the image. Also, we scan only the latest images frommain, not the images of a release.Attach
.openvex.jsonto each imageWhen
publish.ymlpublishes an image, thesbom-and-attestaction already attaches a signed SBOM and signed build provenance to it. That action now also runs:This puts
.openvex.json, unchanged, in a signed attestation. Cosign signs it with the GitHub OIDC identity of the publish workflow and pushes it to the registry as a separate object that refers to the image digest. The image itself does not change, and the file is not inside it. This applies to every published image, frommainand from a release, built with ko or with a Dockerfile.A user gets the document with
cosign verify-attestation, which finds the attestation from the image digest and checks that our publish workflow signed it. They then pass the document to the scanner with--vex, and the scanner leaves out the vulnerabilities in it.Because a syntax error in
.openvex.jsonwould now fail every publish, a newmake openvex-lintchecks the file on each pull request, in thesimple-lintjob oflint-test.yml..openvex.jsonhas no statements yet, so images carry an empty document until the first statement is added. A follow-up PR adds statements for the findings of the image scan.Scan the images of each release
When a release tag is pushed,
publish.ymlnow runs the weekly image scan (image-scan.yml) on the images of that tag, after they are built:image-scan.ymlruns on a tag, it scans the images of that tag. On a branch, it scans the latest images frommainas before. A manual run on a tag scans that release again..openvex.jsonfrom the tag.Documentation
SECURITY.mddescribes the release scan, and adds the commands to download the OpenVEX document from an image and use it with Grype or Trivy. It also says that only critical and high vulnerabilities need an update or a statement. The scans still report the lower severities.Testing
I ran the new attestation step in a test workflow in my fork. The workflow copied the
log-collectorimage of a publish frommaintoghcr.io/xrfxlp/nvsentinel/log-collector, and added a statement to.openvex.jsonthat a vulnerability in theaptpackage of the image does not affect it. Then it ransbom-and-atteston the copy and checked these:SECURITY.mdverified the attestation, and the downloaded document was the same as.openvex.json.aptand inlibapt-pkg7.0. With it, both reported it only inlibapt-pkg7.0, which the statement does not cover.--vex oci, where it finds the attestation in the registry by itself.The copy still has the digest of the original image,
sha256:56b7a976…, so the attestations did not change the image.cosign treelists them next to the image:The release scan runs only on a tag push in this repository, so it first runs at the next release.
Type of Change
Component(s) Affected
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Release container images are scanned for vulnerabilities when published, with findings associated with the release tag. Scans do not block releases.
Image supply-chain artifacts now include OpenVEX attestations, which can be used alongside current
mainstatements when scanning images.Image scans support release tags and can be called by other workflows.
Documentation
Updated scanning guidance to distinguish daily scans, weekly scans of the latest
mainimages, and release scans.* Clarified that vulnerability guidance focuses on critical and high findings, and added instructions for retrieving and using OpenVEX attestations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->