Architecture of Azure CVM
On Azure CVMs, (hardware) remote attestation is facilitated by a vTPM with two reserved NV indices:
0x01400001: This index stores the full Azure Attestation Report. This is a custom Azure format that wraps the underlying hardware report (e.g., SEV-SNP or TDX report).
0x01400002: This is a 64-byte area for the guest OS.
Boot time
The paravisor requests the attestation report (AR) from the AMD-SP using the SHA digest of the Runtime Claims as the REPORT_DATA. The Runtime Claims is a JSON consisting of AK Pub (signing public key for vTPM Quote), EK Pub, VM config, and zero-filled user-data (64 bytes HEX string). The paravisor wraps AR + JSON + other metadata into the Azure Attestation Report format and (re)writes the complete blob to the vTPM NV index 0x01400001.
This initial AR cannot bind any guest-provided data such as nonce. Therefore, there are vulnerabilities to replay attacks.
Runtime Attestation
The attestation flow for Azure CVMs is as follows:
- The guest OS (the "Relying Party") generates 64-byte data for the attestation challenge.
- The guest (initialises and) writes these 64 bytes to the vTPM NV index
0x01400002.
- The Azure paravisor detects this write operation. It then constructs a new
Runtime Claims JSON object, embedding the 64 bytes from the guest into the user-data field.
- The paravisor requests a new SNP report from the AMD-SP using the SHA digest of the new
Runtime Claims as the REPORT_DATA.
- The paravisor wraps the new SNP report + JSON into the Azure report and (re)writes it to the vTPM NV index
0x01400001.
- The guest OS reads the updated Azure report from
0x01400001. This report is cryptographically bound to the guest-provided data.
- The guest sends the Azure report to a verifier, which can validate the signature and check that the
REPORT_DATA matches the hash of the Runtime Claims JSON (incl. the guest-provided data).
# (1)
openssl rand 64 > user-data.bin
# (2)
sudo tpm2_nvdefine -C o 0x01400002 -s 64
sudo tpm2_nvwrite -C o 0x01400002 -i user-data.bin
# (3)-(5) automatically
# (6)
sudo snpguest report report.bin request-data.bin --platform
# signature verification part of (7)
snpguest fetch ca pem . -r report.bin -e vcek
snpguest fetch vcek pem . report.bin
snpguest verify attestation . report.bin
Problems
Currently, snpguest can only fetch the initial SNP report and Runtime Claims digest, and can only perform a part of step 6-7. To provide full support for Azure CVMs, snpguest should be enhanced to orchestrate this entire workflow.
Also, the current --platform flag is somewhat ambiguous. To make the tool's usage clearer, we propose renaming --platform to a more explicit name, such as --azure-cvm. This makes it evident that the flag enables a workflow specific to Azure's CVM implementation.
Architecture of Azure CVM
On Azure CVMs, (hardware) remote attestation is facilitated by a vTPM with two reserved NV indices:
0x01400001: This index stores the full Azure Attestation Report. This is a custom Azure format that wraps the underlying hardware report (e.g., SEV-SNP or TDX report).0x01400002: This is a 64-byte area for the guest OS.Boot time
The paravisor requests the attestation report (AR) from the AMD-SP using the SHA digest of the
Runtime Claimsas theREPORT_DATA. TheRuntime Claimsis a JSON consisting of AK Pub (signing public key for vTPM Quote), EK Pub, VM config, and zero-filleduser-data(64 bytes HEX string). The paravisor wraps AR + JSON + other metadata into the Azure Attestation Report format and (re)writes the complete blob to the vTPM NV index0x01400001.This initial AR cannot bind any guest-provided data such as nonce. Therefore, there are vulnerabilities to replay attacks.
Runtime Attestation
The attestation flow for Azure CVMs is as follows:
0x01400002.Runtime ClaimsJSON object, embedding the 64 bytes from the guest into theuser-datafield.Runtime Claimsas theREPORT_DATA.0x01400001.0x01400001. This report is cryptographically bound to the guest-provided data.REPORT_DATAmatches the hash of theRuntime ClaimsJSON (incl. the guest-provided data).Problems
Currently,
snpguestcan only fetch the initial SNP report andRuntime Claimsdigest, and can only perform a part of step 6-7. To provide full support for Azure CVMs,snpguestshould be enhanced to orchestrate this entire workflow.Also, the current
--platformflag is somewhat ambiguous. To make the tool's usage clearer, we propose renaming--platformto a more explicit name, such as--azure-cvm. This makes it evident that the flag enables a workflow specific to Azure's CVM implementation.