fix(attestation): Azure attestation reports never pass verification - #373
fix(attestation): Azure attestation reports never pass verification#373rajnisht7 wants to merge 2 commits into
Conversation
Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
carloshvp
left a comment
There was a problem hiding this comment.
Requesting changes for one blocking trust-boundary problem: the Azure platform label is being treated as proof that the manifest binding was verified.
This branch sets report_data_matched = True whenever platform == "azure-cvm-sev-snp", but verify_attestation_chain() neither calls AzureCVMProvider.verify_manifest_in_report() nor receives an authenticated result from it. The reason string says the check happens separately, but the public function has no ordering or precondition that enforces that statement.
I reproduced this on the submitted head f8f1113ae3684f587d520b08e76016fca1811c3c with one self-consistent, correctly signed SNP report:
- the report carried a deliberately wrong PCR value;
AzureCVMProvider.verify_manifest_in_report(report, manifest)returnedFalse;- this changed
verify_attestation_chain()returnedpassed=True,report_data_matched=True, andsignature=VERIFIEDfor the same report; - the same signed report also returned
passed=Truefor three unrelatedexpected_manifest_hashvalues (11…,22…, andff…).
The new positive test encodes the same gap: its report has no pcr_read, no demonstrated vTPM/PCR verification, and still asserts passed is True solely because the platform string is Azure.
report_data being inapplicable is not equivalent to the manifest binding matching. Conflating those states turns the absence of this check into positive verification.
Before this can merge:
- Do not synthesize
report_data_matched=Truefrom the platform label. - If this public result is meant to pass for Azure, establish the Azure composite binding inside the verification boundary: the SNP/VCEK chain, SNP runtime-data binding to the vTPM AK, the AK-signed TPM quote/PCR evidence, and the PCR value derived from the expected manifest hash.
- If that composite verifier is outside this PR's scope, represent Azure report-data binding as not applicable without allowing
passed=True; keep the result fail-closed until separately supplied evidence is actually consumed and verified. - Replace the current positive test with load-bearing controls: missing PCR evidence, a mismatching PCR, and arbitrary expected manifest hashes must fail; only authenticated matching Azure binding may pass.
The focused test file is green (14 passed), but it is green around the wrong security property. The direct-SNP non-Azure control is useful and should remain.
Also account for #363 when rebasing: Azure may share the SNP signature primitive, but it remains a distinct binding profile and must be reached through explicit platform dispatch.
|
Maintainer confirmation on both halves, because the premise and the remedy point different ways here. @rajnisht7, the problem you found is real and it is ours. On Azure CVM, SEV-SNP runs under a Hyper-V paravisor and the attestation is vTPM-rooted: @carloshvp is right that this fix cannot land, and the reproduction is the reason. Setting
A correctly signed report with a wrong PCR returning The shape of a fix that would land. The Azure path needs the binding established, not assumed:
The general rule I want on the record, since this is the second time this month a platform label has stood in for a verification: a |
What
Fixes verify_attestation_chain() so it can actually return passed=True for a genuine Azure SEV-SNP attestation.
Why
On Azure, REPORT_DATA is sha256(runtime_data), not the manifest hash, the guest never controls that field there (already documented in this module and in LIMITATIONS.md). The function was still requiring REPORT_DATA to equal the manifest hash for every platform, so a valid Azure report could never pass, no matter how correct the signature and chain were.
Spec impact
None
Test plan
pytest -vpassesmypy src/agent_manifestpassesruff check src/ tests/passesCHANGELOG.mdupdatedDCO
All commits in this PR are signed off (
git commit -s). By submitting this PR I certify the Developer Certificate of Origin.