Skip to content

underhill_attestation: Implement VMGS provenance#3567

Open
stunes-ms wants to merge 3 commits into
microsoft:mainfrom
stunes-ms:user/mikestunes/provenance
Open

underhill_attestation: Implement VMGS provenance#3567
stunes-ms wants to merge 3 commits into
microsoft:mainfrom
stunes-ms:user/mikestunes/provenance

Conversation

@stunes-ms
Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings May 26, 2026 18:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_slice helper and tests for constructing GUIDs from 16-byte slices.
  • Extend crypto::x509::X509Certificate to 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.

Comment thread support/guid/src/lib.rs Outdated
Comment thread support/crypto/src/x509/mod.rs Outdated
Comment thread support/crypto/src/x509/symcrypt_rust.rs
Comment thread openhcl/underhill_attestation/src/lib.rs
Comment thread openhcl/underhill_core/src/worker.rs
.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) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to add runtime GUID parsing just for this, and this code should be handling GUIDs in a known representation only.

Comment thread support/crypto/src/x509/ossl.rs Outdated
@stunes-ms stunes-ms force-pushed the user/mikestunes/provenance branch from 78b13eb to 24f022a Compare May 27, 2026 23:24
Copilot AI review requested due to automatic review settings May 27, 2026 23:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

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.
@stunes-ms stunes-ms marked this pull request as ready for review May 27, 2026 23:56
@stunes-ms stunes-ms requested a review from a team as a code owner May 27, 2026 23:56
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.

2 participants