Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tdx-verifier: eventlog: handle OVMF/efistub measurements correctly #674

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mythi
Copy link
Contributor

@mythi mythi commented Jan 23, 2025

This PR is a stopgap for checking the OVMF/direct boot based measurements logged in the CCEL. It merely follows the original MeasuredEntity approach for finding the kernel/cmdline/initrd measurements from the logs.

We should look to improve this and make it more generic to allow policies to check for more of the events and to support for different boot flows as well.

mythi added 3 commits January 23, 2025 15:06
The original "TDVF" kernel parser is not able to find the kernel
measurement from the raw eventlog. Futhermore, it never implemented
cmdline/initrd parsers similar to be aligned with the TdShim
functionality.

CoCo TDX uses Qemu direct boot. OVMF loads the kernel using
GenericQemuLoadImageLib and it is located under a vendor media device
path. This path also is found in the measured event desciption so look
for that as the anchor to the kernel measurement digest.

The kernel first runs the Linux efistub. Starting Linux 6.9, it adds
the support for CC_MEASUREMENT_PROTOCOL which is used to extend
RTMRs for cmdline (load image parameters) and initrd measurements. These
are logged using EV_EVENT_TAG with the event description (and ID)
identifying the measurement.

Signed-off-by: Mikko Ylinen <[email protected]>
Add tests to cover the Tdvf* MeasuredEntity enums. It also requires an
updated CCEL raw blob which is originated from Kata 3.13.0 based boot
with the initrd set as the rootfs.

Signed-off-by: Mikko Ylinen <[email protected]>
Add all of the Tdvf* MeasuredEntity results to the TDX claims under
ccel.

Signed-off-by: Mikko Ylinen <[email protected]>
@mythi mythi changed the title WIP: tdx-verifier: eventlog: handle OVMF measurements correctly tdx-verifier: eventlog: handle OVMF measurements correctly Jan 23, 2025
@mythi mythi marked this pull request as ready for review January 23, 2025 13:54
@mythi mythi requested a review from a team as a code owner January 23, 2025 13:54
@mythi mythi changed the title tdx-verifier: eventlog: handle OVMF measurements correctly tdx-verifier: eventlog: handle OVMF/efistub measurements correctly Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant