gcp: unify OS image hash measurement#757
Open
kvinwang wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GCP TDX attestation flow to use a unified OS image identity (os_image_hash = sha256(sha256sum.txt)) consistent with other platforms, while still binding the GCP-measured UKI Authenticode hash (from TPM PCR2) via new GCP-specific measurement material.
Changes:
- Introduces
measurement.gcp.cborand a newgcp_measurementfield inVmConfig/ measurement documents to bind GCP’s UKI Authenticode hash to the unifiedos_image_hash. - Updates the verifier’s GCP TDX path to require and validate
vm_config.gcp_measurementagainstvm_config.os_image_hashand TPM event log contents. - Updates
dstack-mranddstack-cloudto generate, attach, and inspect the new GCP measurement material; updates documentation to reflect the unified flow.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vmm/src/app.rs | Adds the new gcp_measurement field (default None) when building VmConfig. |
| verifier/src/verification.rs | Requires/validates vm_config.gcp_measurement and compares decoded UKI Authenticode hash against the GCP TPM PCR2 event. |
| verifier/README.md | Documents GCP alongside TDX-lite and SNP for unified os_image_hash verification behavior. |
| scripts/bin/dstack-cloud | Reads digest.txt + sha256sum.txt + measurement.gcp.cbor and emits vm_config.gcp_measurement instead of using auth_hash.txt. |
| dstack-types/src/lib.rs | Extends VmConfig and measurement document types to include gcp_measurement; adds GCP CBOR measurement/document types and filename constant. |
| dstack-mr/src/measurement.rs | Includes measurement.gcp.cbor in the generated OsImageMeasurementDocument when present. |
| dstack-mr/src/main.rs | Adds gcp support to inspect-measurement and introduces gcp-measurement-cbor utility subcommand. |
| docs/security/security-model.md | Extends the unified no-image-download model description to cover GCP TDX and measurement.gcp.cbor. |
| docs/attestation-gcp.md | Documents the new binding step between unified os_image_hash and the GCP TPM UKI event using gcp_measurement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
measurement.gcp.cbor) that carries the UKI Authenticode SHA-256 measured by GCP TPM PCR2VmConfig/ measurement documents withgcp_measurement, and make the GCP verifier bind it to the unifiedos_image_hash = sha256(sha256sum.txt)dstack-mrto generate/inspect GCP measurement CBORdstack-cloudto readdigest.txtand attachgcp_measurementinstead of usingauth_hash.txtas the OS image hashTesting
cargo fmt --checkcargo check -p dstack-types -p dstack-mr -p dstack-verifierpython3 -m py_compile scripts/bin/dstack-cloudmake dist FLAVORS=prod DIST_DIR=imageswuhan-workshopand confirmed the app starts/Atteston the GCP VM and verified the returned attestation with this branch's verifier:tee_platform = gcp-tdxquote_verified = trueevent_log_verified = trueos_image_hash_verified = true