Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions crates/attestation/src/azure/ak_certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ const MICROSOFT_RSA_DEVICES_ROOT_2021: &str =
pub(super) const AZURE_VIRTUAL_TPM_ROOT_2023: &str =
include_str!("../../assets/azure-virtual-tpm-root-2023.pem");

/// The root CAs AK certificate chains are verified against, as (asset file
/// stem, PEM text) pairs in anchor order
///
/// Exported so callers can archive them alongside the evidence and
/// collateral, letting a verification be rechecked deterministically later
/// without depending on the exact version of this crate that ran it.
pub const AZURE_ROOT_CA_PEMS: &[(&str, &str)] = &[
("microsoft-rsa-devices-root-ca-2021", MICROSOFT_RSA_DEVICES_ROOT_2021),
("azure-virtual-tpm-root-2023", AZURE_VIRTUAL_TPM_ROOT_2023),
];

/// The root anchors for azure
static AZURE_ROOT_ANCHORS: Lazy<Vec<TrustAnchor<'static>>> = Lazy::new(|| {
vec![
// Microsoft RSA Devices Root CA 2021 (older VMs)
pem_to_trust_anchor(MICROSOFT_RSA_DEVICES_ROOT_2021),
// Azure Virtual TPM Root CA 2023 (TDX + newer trusted launch)
pem_to_trust_anchor(AZURE_VIRTUAL_TPM_ROOT_2023),
]
});
static AZURE_ROOT_ANCHORS: Lazy<Vec<TrustAnchor<'static>>> =
Lazy::new(|| AZURE_ROOT_CA_PEMS.iter().map(|(_, pem)| pem_to_trust_anchor(pem)).collect());

/// Verify an AK certificate against pinned Azure root CAs.
///
Expand Down
1 change: 1 addition & 0 deletions crates/attestation/src/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod tpm_quote;
mod tpms_attest;
mod verify;

pub use ak_certificate::AZURE_ROOT_CA_PEMS;
#[cfg(azure_attester_x86_64_linux)]
pub use attester::{create_azure_attestation, detect_azure_cvm};
use az_cvm_vtpm::hcl;
Expand Down
Loading