← Back to Pull requests

podvm: attach systemd measure output to podvm oci #3379

Open
mkulke opened this pull request with 31 lines diff across 3 files
View on GitHub
mkulke mkulke commented on Oct 07, 2026 11:40 UTC
Author

We can precalculate the expected measurement of PCR11 of a UKI built with mkosi. The UKI measurement extends to the whole image due to dm-verity.

The measurement is added as an annotation to the podvm image and covered by the provenance attestation of the oci image. We can then extract that annotation in coco/reference-values for publishing.

Diff: 31 lines (+29 / -2) across 3 files Reviewer: stevenhorsman Review duration: 4920m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.27) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.27 · 31 lines diff across 3 files
0.27
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 5 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
89%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.207
Real PR Conversation Timeline
8 items
stevenhorsman stevenhorsman commented on code on Oct 07, 2026 14:35 UTC
Code Review
.github/workflows/podvm_mkosi.yaml:1
@@ -158,13 +158,15 @@ jobs:
         id: publish_oras_qcow2
         working-directory: src/cloud-api-adaptor/podvm
         run: |
+          annotation="$(make oci-annotation)"
+
           mkdir oras
           cd oras
           cp ../build/podvm-*.qcow2 .
           tar cJf podvm.tar.xz podvm-*.qcow2
           image="${REGISTRY}/podvm-${ARCH}${TEE_PLATFORM:+-${TEE_PLATFORM}}${DEBUG:+-debug}"
           tag="$(git rev-parse --short HEAD)"
-          oras push "${image}:${tag}" podvm.tar.xz
+          oras push --annotation "$annotation" "${image}:${tag}" podvm.tar.xz

optional nit: I prefer braces for consistency:

          oras push --annotation "${annotation}" "${image}:${tag}" podvm.tar.xz

stevenhorsman stevenhorsman commented on code on Oct 07, 2026 14:37 UTC
Code Review
.github/workflows/podvm_mkosi.yaml:1

Do we want the annotation on this push too. I think this might be used in the release flow where we tag by release version and sha, but am not sure TBH.

stevenhorsman stevenhorsman commented on code on Oct 07, 2026 14:40 UTC
Code Review
src/cloud-api-adaptor/podvm/Makefile:1
@@ -229,6 +229,13 @@ push-image-byom-e2e-container:
 	@echo "Push BYOM podvm container image to remote repository..."
 	docker push $(PODVM_BYOM_E2E_CONTAINER_NAME):$(PODVM_TAG)
 
+.PHONY: oci-annotation
+oci-annotation:
+	@value=$$(jq -r -e \
+		'.sha256[] | select(.phase == "enter-initrd:leave-initrd:sysinit:ready" and .pcr == 11) | .hash' \
+		./build/system.measurement.json) && \
+	echo "io.systemd.pcr11.sha256.ready=$$value"
+

nit: I wonder if having a specific error in the case of a missing pcr11 entry would help with debug (if it ever came to this) e.g.

oci-annotation:
	@value=$$(jq -r -e \
		'.sha256[] | select(.phase == "enter-initrd:leave-initrd:sysinit:ready" and .pcr == 11) | .hash' \
		./build/system.measurement.json \
		|| (echo "PCR11/phase entry not found in system.measurement.json" >&2; exit 1)) && \
	echo "io.systemd.pcr11.sha256.ready=$$value"

stevenhorsman stevenhorsman approved these changes on Oct 07, 2026 15:18 UTC
Approved Reviewer

LGTM. Thanks!

stevenhorsman stevenhorsman commented on Oct 07, 2026 15:19 UTC
Contributor

The e2e is failing, so maybe we need to add more permissions for the attestation?

mkulke mkulke commented on Oct 07, 2026 15:40 UTC
Author

The e2e is failing, so maybe we need to add more permissions for the attestation?

I think gh action has hickups

mkulke mkulke commented on Oct 07, 2026 16:38 UTC
Author

when testing a booted image I noticed that we mask the "pcr phase" units in the image, so the offline measurement is not what shows up in an image. I didn't want to mess with this, it probably makes sense to just have the UKI in pcr11, so I pluck the relevant sections out of the efi file for measurement and then the precalculated PCR matches the one that we see in a booted image.

Reviewers
Assignees
mkulke mkulke
Labels
risk: low confidence: 89.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 26.7% (LOW) · Higher = larger blast radius
26.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 89.5% · Lower = rushed or shallow review
89.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 2.8% · Safe to merge
2.8%