diff --git a/crates/attestation/src/azure/ak_certificate.rs b/crates/attestation/src/azure/ak_certificate.rs index a2fefe1..a9d8fdb 100644 --- a/crates/attestation/src/azure/ak_certificate.rs +++ b/crates/attestation/src/azure/ak_certificate.rs @@ -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>> = 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>> = + Lazy::new(|| AZURE_ROOT_CA_PEMS.iter().map(|(_, pem)| pem_to_trust_anchor(pem)).collect()); /// Verify an AK certificate against pinned Azure root CAs. /// diff --git a/crates/attestation/src/azure/mod.rs b/crates/attestation/src/azure/mod.rs index 0a53029..0a29471 100644 --- a/crates/attestation/src/azure/mod.rs +++ b/crates/attestation/src/azure/mod.rs @@ -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;