underhill_attestation: Implement VMGS provenance#3567
Open
stunes-ms wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds VMGS Provenance support to OpenHCL Underhill attestation by extracting provenance claims (VMGSID + signer identity) from a signed JWT stored in VMGS, and verifying the derived VMGSID (from encrypted seed material) matches the provisioned ID to detect tampering.
Changes:
- Add
Guid::from_slicehelper and tests for constructing GUIDs from 16-byte slices. - Extend
crypto::x509::X509Certificateto extract a certificate subject common name, used to build a signer DID for provenance claims. - Wire provenance parsing/claims into Underhill startup and attestation runtime claims, and add VMGSID derivation + verification logic.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| support/guid/src/lib.rs | Adds Guid::from_slice and a unit test for slice-to-GUID conversion. |
| support/crypto/src/x509/symcrypt_rust.rs | Implements subject CN extraction for the rust/symcrypt backend. |
| support/crypto/src/x509/ossl.rs | Implements subject CN extraction for the OpenSSL backend. |
| support/crypto/src/x509/mod.rs | Exposes X509Certificate::subject_name and adds a unit test. |
| openhcl/underhill_core/src/worker.rs | Reads provenance doc, populates runtime claims, and verifies derived VMGSID vs provisioned ID. |
| openhcl/underhill_attestation/test_data/valid_jwt | Adds test JWT data for provenance-claims parsing. |
| openhcl/underhill_attestation/src/lib.rs | Implements provenance claims extraction and VMGSID derivation + tests. |
| openhcl/underhill_attestation/src/igvm_attest/mod.rs | Updates attestation config tests for the new optional field. |
| openhcl/underhill_attestation/src/hardware_key_sealing.rs | Updates tests for the new optional field. |
| openhcl/underhill_attestation/Cargo.toml | Adds hex dependency for provenance parsing/formatting. |
| openhcl/openhcl_attestation_protocol/src/igvm_attest/get.rs | Adds VmgsProvisioner runtime claim and optional field on AttestationVmConfig. |
| Cargo.lock | Records the new hex dependency edge. |
| .await | ||
| .context("failed to read VMGSID seed doc")?; | ||
| let derived_vmgsid = underhill_attestation::derive_vmgsid(&vmgsid_file).await?; | ||
| if !derived_vmgsid.to_string().eq_ignore_ascii_case(&prov.id) { |
Contributor
Author
There was a problem hiding this comment.
I don't want to add runtime GUID parsing just for this, and this code should be handling GUIDs in a known representation only.
78b13eb to
24f022a
Compare
Comment on lines
+1457
to
+1466
| let valid = jwt | ||
| .verify_signature() | ||
| .map_err(ProvenanceError::VerifySignature) | ||
| .map_err(AttestationErrorInner::Provenance)?; | ||
| if valid { | ||
| let cert_chain = jwt | ||
| .cert_chain() | ||
| .map_err(ProvenanceError::DecodeProvenanceDoc) | ||
| .map_err(AttestationErrorInner::Provenance)?; | ||
| let leaf = &cert_chain[0]; |
Comment on lines
+178
to
+179
| #[error("invalid leaf certificate subject")] | ||
| InvalidLeafCertSubject, |
| .map(Self) | ||
| } | ||
|
|
||
| /// Get the subject name from an X.509 certificate. |
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.
This change adds support for the VMGS Provenance feature to OpenHCL. The confidential VM provisioner will create new CVM VMGS files with two extra indexes: a signed plaintext document (as a JWT) that contains a VMGS ID and a certificate chain, and an encrypted document (comma-separated hex strings) that contains cryptographic seeds from which the VMGS ID is derived.
When OpenHCL initializes, it reads the plaintext document from the VMGS. If it exists, it validates the JWT signature and then puts the VMGS ID and signer identity into the runtime claims. After key release, it reads the encrypted document, derives the VMGS ID from seeds, and verifies that it matches the VMGS ID in the plaintext document. If not, OpenHCL terminates, as this suggests VMGS tampering.