Skip to content

fix(startup): _VALID_PROVIDERS was missing azure-cvm-sev-snp - #564

Open
imran-siddique wants to merge 2 commits into
mainfrom
fix/valid-providers-azure-cvm
Open

fix(startup): _VALID_PROVIDERS was missing azure-cvm-sev-snp#564
imran-siddique wants to merge 2 commits into
mainfrom
fix/valid-providers-azure-cvm

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Follow-up to #563, from a defect @zohebk8s found and flagged while wiring #552's report_data measurement binding.

The defect

startup.py:55 says:

Mirrors the keys of _PROVIDER_MAP in audit/trace_claim.py

It did not.

contents
_VALID_PROVIDERS (startup.py:57) sev-snp, tdx, opaque, tpm, software-only
_PROVIDER_MAP (audit/trace_claim.py:25) the same five plus azure-cvm-sev-snp

So _validate_attestation_report raised ATTESTATION_PROVIDER_INVALID on every Azure confidential-VM report and the gateway exited at startup. #563 applies the measurement binding to azure-cvm-sev-snp, which meant it added behaviour for a provider this path could not select.

The guard

The test compares the two sets rather than asserting that one name is present. Asserting membership fixes today's instance and leaves the class open; comparing the sets means the next provider added to either side cannot drift the same way, which is what the comment already promised.

Proved it fails for the right reason by reverting only the one-line addition and keeping the test:

E     Extra items in the right set:
E     'azure-cvm-sev-snp'
FAILED tests/unit/test_startup.py::test_valid_providers_matches_the_map_it_says_it_mirrors

With the entry restored: tests/unit/test_startup.py and tests/unit/test_trace_claim.py, 55 passed.

Not covered

Whether an Azure CVM gateway then completes startup end to end on real hardware. This removes a gate that rejected it before anything else ran; it is not a claim that the rest of the path is exercised.

The comment above _VALID_PROVIDERS says it mirrors the keys of _PROVIDER_MAP
in audit/trace_claim.py. It did not: the map carries azure-cvm-sev-snp and the
set did not, so _validate_attestation_report raised
ATTESTATION_PROVIDER_INVALID on every Azure confidential-VM report and the
gateway exited at startup.

Found by @zohebk8s while wiring #552's report_data measurement binding in #563,
which applies to azure-cvm-sev-snp and so added behaviour for a provider that
path could not select.

The test compares the two sets rather than asserting one membership, so the
next provider added to either side cannot drift the same way.

Signed-off-by: Imran Siddique <imran.siddique@opaque.co>
@imran-siddique
imran-siddique requested a review from a team as a code owner August 24, 2026 23:29
ruff reads _VALID_PROVIDERS as the constant side because it is uppercase,
so the comparison had to put the computed set on the left.

Signed-off-by: Imran Siddique <imran.siddique@opaque.co>
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