docs: add tested Kyverno policies for mirror signatures and provenance #3517
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 #3517"
general
weight: 0.35
yuanchen8911
Summary
Adds tested Kyverno policies to the supply chain verification guide for two checks: admitting only images the integrator signed after mirroring them into a private registry, and verifying AICR's own release provenance. It also shows how to combine them, and updates the provenance demo to match.
Motivation / Context
#3467 proposed a signature gate for bundle deploys. The suggested first step there was tested admission policies for customer-signed images in a private registry, with explicit coverage and exemptions, registry authentication, positive and negative tests, and the exact signature format. #1537 asked for a validated Kyverno example for AICR's GitHub attestations, which Kyverno v1.18.1 had failed to verify.
Fixes: #1537
Related: #3467
Type of Change
Component(s) Affected
docs/,examples/)demos/provenance.mdand its slidesImplementation Notes
- It has two
ImageValidatingPolicyobjects. One covers Pods, and with them the Deployments, Jobs and CronJobs Kyverno generates rules for. The other coverskubectl debug; folding that subresource into the first policy would switch those generated rules off.- Every image in every container list must carry your signature, wherever it is served from. The policies exempt
kube-systemandkyverno. Kyverno's default Helm filters also skipkube-publicandkube-node-lease; the guide shows the chart setting that brings them in.- Image volumes (
spec.volumes[].image, on by default from Kubernetes v1.35) aren't covered by those checks, so a third policy, aValidatingPolicy, denies them.- Pods that predate the policies are checked at their next update, even a label change. An unsigned image is denied, and a signed tag is pinned to its digest, which restarts the container. The guide recommends rolling workloads after applying the policies.
- The guide asks for a TLS registry. On Kyverno v1.19.2, an
ImageValidatingPolicydid not find Sigstore-bundle signatures on a plain-HTTP registry addressed by hostname.- Kyverno gets the mirror's CA through
global.caCertificates, so the reports controller's background scans can read signatures too.- The policies check the registry each Pod's image reference names, so workload references must name the mirror. Redirecting pulls in containerd isn't enough.
- The "not verified" note is replaced by two
ImageValidatingPolicyobjects; the second coverskubectl debug, like the mirror policies.- They match only the images
attest-images.yamlattests. They pin that workflow withsubjectRegExp, and the calling repository withgithubWorkflowRepository: NVIDIA/aicr. The workflow is reusable, so any repository can call it and get a matching subject.- There's no
ClusterPolicyform. Its Sigstore-bundle path checks only the issuer and subject, so it can't require the repository.- Both
-debugpolicies turn off background evaluation, so they report Ready.- A reference with no tag is checked: Kyverno adds
:latestbefore it matches. Release-candidate tags match the pattern too, and the guide shows how to trust final releases only.- The Policy Controller example's subject pattern now ends in
refs/tags/v.$, like the Kyverno policies. It can't require the repository, and the guide, the demo and the slides now say so.- Every
cosign verify-attestationcommand that trustsattest-images.yaml, in the guide, the demo, its script and the slides, pins the repository with--certificate-github-workflow-repository NVIDIA/aicr.- In testing, an exact
subject:with agave the sameno matching signatures foundthat #1537 recorded on v1.18.1. v1.18.1 itself was not re-tested.oras cp -r, sign the copy, then point both keylessImageValidatingPolicyobjects at the mirror: new globs, including the default validator path withoutnvidia/, andcredentials. Keyless verification also needs Sigstore's TUF repository, or an internal mirror of it. Both checks apply only to references the keyless globs match: a spelling they miss, such asregistry.example.com:443/…, gets only the mirror policies' signature check.failurePolicy: Ignore. Kyverno scaled to zero deletes its webhooks, so nothing is checked. The guide covers both, with recommendations.Testing
The docs checks and
make lintpass on the final branch.make -k qualifyran on the first commit; the later commits change only docs and demos. It passed everything excepttest-shellandapi-diff. Those fail locally only because my installedapidiffis older than the pin (exit 17, version mismatch), and that mademakeskip the Go unit tests, which depend ontest-shell. No Go or shell test reads the changed files.All cluster runs used kind (Kubernetes v1.37.0) with Kyverno v1.19.2 and cosign v3.1.4. Every YAML block this PR adds is byte-identical to the file the runs applied, except that the runs put a real key in place of the mirror policies' public-key placeholder and applied the mirror-registry glob fragment inside both keyless policies.
- signed, unsigned and other-key images, in both signature formats;
- init and ephemeral containers, Pod updates and
kubectl debug;- Deployments, Jobs and CronJobs;
- exemptions and multi-arch;
- moved tags, key rotation and Audit mode;
- registry and Kyverno outages.
56 matched their expected result and 7 were recorded without one. The other 2 were my wrong expectations about Kyverno scaled to zero, which the guide now documents.
The guide's own fence and commands were run as written, with only the key substituted. The signed image was admitted and pinned; unsigned and other-key images were denied with the guide's message.
- The keyless policies admitted
aicrby tag and by digest,aicrd, a validator andaicr-gate, and denied v0.16.0, whichon-tag.yamlsigned.- In a Pod mixing an AICR image with another image, only the AICR image was checked.
- In the mirror:
- attested and signed images were admitted;
- an image without the attestation was denied by the keyless policy;
- an unsigned copy was denied by the mirror policy;
- a signed component image was admitted.
- the keyless policies, as written, against Pods, Deployments and
kubectl debug;- the combined cases again, plus the default air-gap validator path and
kubectl debugon a running, mirror-signed Pod;- the gate,
busybox:1.37and CUDA 13 images AICR's own Pods use, denied as documented.The guide's signing and test commands were re-run as written after the
MIRROR_DIGESTchange.helm template: 20 passing, 3 recorded as measurements.- The image-volume policy, as written:
- Pods with an image volume were denied, whether its image was signed or not.
- Pods without one were admitted.
- Deployments (created or edited), Jobs, CronJobs and StatefulSets with one were denied.
- Kyverno's default filters:
- A Pod with an image volume was admitted in
kube-publicandkube-node-lease, and denied indefault.-
helm templateshows thatconfig.resourceFiltersExcludeNamespacesdrops both filters.- A label update on running Pods that predate the policies: the unsigned one was denied, and the signed one was pinned and restarted.
- The keyless policies admitted
ghcr.io:443/nvidia/aicr:v0.16.0and deniedghcr.io/nvidia/aicr:v0.16.0.- The keyless policies as written, now requiring
NVIDIA/aicr: v1.1.2 admitted and pinned, v0.16.0 denied, in Pods, Deployments andkubectl debug. With another repository required, v1.1.2 was denied in all three.- All four policies report Ready, and both
-debugpolicies still deny.- The combined mirror cases again, with the new policies.
- A reference with no tag is normalized to
:latestand checked, on ghcr.io and in the mirror.- Policy Controller's
tester, v0.15.1 and v0.13.1, on the aligned example: v1.1.2 verified and v0.16.0 denied on identity. A CUEpolicyblock requiring another repository, or a field its input lacks, still admitted v1.1.2: the block sees only each attestation's digest, id and predicate type.-
cosign verify-attestationwith the repository pinned: the SBOM and VEX attestations ofaicrandaicrdat v1.1.2 verify, and fail with another repository named.- Background scans: with the CA on the admission controller only, the mirror images' PolicyReport results were x509 errors. With
global.caCertificates, all 12 results were pass or fail. An earlier run of this check read results Kyverno had kept from before the change; clearing its ephemeral reports fixed that.cosign verify-attestationcommands, run as written against v1.1.2. The SBOM and VEX attestations verify withNVIDIA/aicrand fail with another repository. The rest of that round changes wording only; the YAML blocks are unchanged.Risk Assessment
Rollout notes: N/A
Checklist
make testwith-race) — N/A, docs onlymake lint)git commit -s -S)