feat: add lite OS image verification mode for TDX#742
Merged
Conversation
17569c2 to
06b5b0c
Compare
6f8bb74 to
521ce24
Compare
4402211 to
8f47481
Compare
8f47481 to
05bc741
Compare
ab70662 to
c6ff79c
Compare
c6ff79c to
2a30f8e
Compare
a1f588a to
4885b99
Compare
4885b99 to
6b9344b
Compare
…t-attestation # Conflicts: # dstack-attest/src/attestation.rs # verifier/src/verification.rs
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
Adds a lightweight OS-image verification path for dstack TDX and AMD SEV-SNP while preserving the existing legacy TDX verifier behavior.
TDX lite verification
DstackTdxquote/attestation mode; select the verifier path fromvm_config.tdx_attestation_variant(legacyvslite).vm_config.tdx_measurement, carrying:sha256sum.txtbytes (checksum_file), andmeasurement.tdx.cborbytes (measurement).os_image_hash = sha256(sha256sum.txt);measurement.tdx.cborentry insha256sum.txtmatches the supplied CBOR bytes;vm_config,measurement.tdx.cbor, and the three named RTMR0ACPI DATAdigests from the quote-bound event log;legacy: download/cache the image, verify the image checksum manifest, recompute full expected measurements, and compare against the quote.>= 0xB0000000bytes.Unified image identity and measurement material
digest.txt = sha256(sha256sum.txt).measurement.tdx.cborandmeasurement.snp.cboras normal entries committed bysha256sum.txt, instead of introducing separate top-level image hashes.vm_configas JSON fields with base64 byte strings (checksum_file,measurement) so JSON stays compatible while avoiding hex bloat.AMD SEV-SNP measurement binding
measurement.snp.cborplussha256sum.txt.MEASUREMENTfrom the self-contained launch inputs and require it to match the hardware-verified report.HOST_DATAbinds themr_configdocument used for app identity, compose hash, instance id, and key-provider identity.os_image_hashand boot identity.VMM / attestation plumbing
vm_config.acpi-loader,acpi-rsdp,acpi-tables) so verification does not depend on event order.GetQuoteresponses compact by not returning the fullattestationpayload there.attestationis supplied, top-levelquote,event_log, andvm_configare ignored to avoid mixed trusted/untrusted inputs.Documentation and fixtures
os_image_hashbecomes trusted only after quote/measurement binding.Security notes
vm_config,sha256sum.txt, andmeasurement.*.cborare treated as untrusted until their hashes and recomputed measurements are bound to the hardware quote/report.measurement.*.cboragainst the correspondingsha256sum.txtentry before using it.Validation
cargo fmt --check --allcargo clippy -p sev-snp-qvl -p dstack-attest -p dstack-verifier -- -D warnings -D clippy::expect_used -D clippy::unwrap_used --allow unused_variablescargo test -p dstack-typescargo test -p dstack-mrcargo test -p dstack-attest --test sev_snp_verifycargo test -p dstack-verifier