[STACKED on #1020] fix(simulator): replay image-specific GCP TPM events - #1018
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the simulator/image measurement pipeline to support image-specific GCP TPM event-log replay, ensuring the simulated vTPM PCRs and exposed TPM event log align with the UKI Authenticode digest described by measurement.gcp.cbor and the selected image identity.
Changes:
- Generate
measurement.gcp.eventlog.binduring image assembly by patching the GCP TPM event-log template with the assembled UKI Authenticode SHA-256 digest, and include it in checksums and release archives. - Transport the event log to the development simulator via
gcp_tpm_replay, validate it againstvm_config.gcp_measurement, replay it into swtpm, and expose it via/sys/kernel/security/tpm0/binary_bios_measurements. - Add supporting types and wiring across
dstack-types, VMM image loading/config, simulator logic, and E2E attestation setup.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| os/image/README.md | Documents the new generated GCP event-log artifact. |
| os/image/gcp-tpm-eventlog.py | New generator to bind the GCP event-log template to the assembled UKI hash. |
| os/image/assemble.sh | Produces, checksums, and archives measurement.gcp.eventlog.bin alongside existing measurement artifacts. |
| dstack/vmm/src/app/qemu.rs | Updates test fixtures to include the new gcp_tpm_replay field. |
| dstack/vmm/src/app/image.rs | Loads measurement.gcp.eventlog.bin into an in-memory replay struct for simulator transport. |
| dstack/vmm/src/app.rs | Wires gcp_tpm_replay into VM config and syncs it into the tee-simulator config. |
| dstack/tests/e2e/attestation/run-platform.sh | Adds gcp_tpm_replay to simulator config for GCP TDX E2E flow. |
| dstack/tee-simulator/src/tpm.rs | Validates/replays the GCP event log into swtpm and installs it under /sys/kernel/security. |
| dstack/tee-simulator/Cargo.toml | Adds nix mount feature dependency for mounting the securityfs shadow. |
| dstack/dstack-types/src/lib.rs | Introduces GcpTpmReplay and adds it to TeeSimulatorConfig. |
| dstack/Cargo.lock | Updates lockfile for the new dependency usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Base automatically changed from
codex/fix-vmm-simulated-nitrotpm-measurement
to
codex/fix-vmm-cloud-image-measurements
August 6, 2026 02:15
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
2 times, most recently
from
August 6, 2026 02:33
877b4a5 to
b34c13e
Compare
kvinwang
changed the base branch from
codex/fix-vmm-cloud-image-measurements
to
master
August 6, 2026 02:33
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
from
August 6, 2026 02:36
b34c13e to
9f0d18f
Compare
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
from
August 6, 2026 02:38
9f0d18f to
b1a22f0
Compare
kvinwang
changed the base branch from
master
to
fix/simulator-nitrotpm-measurement-master
August 6, 2026 02:38
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
from
August 6, 2026 02:42
b1a22f0 to
ba81e92
Compare
Base automatically changed from
fix/simulator-nitrotpm-measurement-master
to
master
August 6, 2026 03:29
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
from
August 6, 2026 03:29
ba81e92 to
49e3419
Compare
kvinwang
force-pushed
the
fix/simulator-gcp-image-eventlog
branch
from
August 6, 2026 03:32
49e3419 to
ad240a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The GCP vTPM simulator replayed the repository's fixed
tpm_eventlog.binfixture for every VM. The fixture contains one hard-coded UKI Authenticode digest, whilevm_config.gcp_measurementdescribes the image that was actually selected. Arbitrary dev images therefore produced an event-log UKI measurement that did not match their image identity.Fix
Generate and consume an image-specific GCP TPM event log:
measurement.gcp.eventlog.binfrom the GCP firmware event-log template during image assembly;sha256sum.txt, so it does not change the production image identity;measurement.gcp.cborbefore starting the simulated vTPM;/sys/kernel/security/tpm0/binary_bios_measurements.This keeps the quoted PCRs, exposed event log, GCP measurement document, and actual image identity aligned.
Dependency
masterVerification
cargo check -p dstack-types -p dstack-vmm -p dstack-tee-simulatorpython3 -m py_compile os/image/gcp-tpm-eventlog.pybash -n os/image/assemble.sh dstack/tests/e2e/attestation/run-platform.shcargo fmt --allgit diff --check