podvm: attach systemd measure output to podvm oci #3379
optional nit: I prefer braces for consistency:
oras push --annotation "${annotation}" "${image}:${tag}" podvm.tar.xz
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.
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"
LGTM. Thanks!
The e2e is failing, so maybe we need to add more permissions for the attestation?
The e2e is failing, so maybe we need to add more permissions for the attestation?
I think gh action has hickups
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.
stevenhorsman
mkulke
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.