Align policy hash verification between SNP and TDX #901
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING: The Prometheus counter
contrast_meshapi_attestation_failures_total
is not incremented anymore if a workload has matching reference values but an untrusted policy hash. These rejections are now visible in thecontrast_grpc_server_handled_total
counter with fieldgrpc_code=PermissionDenied
.The policy hash is passed as
HOSTDATA
on SNP and asMRCONFIGID
on TDX. In the SNP validation, we used to check theHOSTDATA
too, but we did not introduce this for TDX. As a consequence, the metrics observed on SNP and TDX are different: on SNP, an unknown hash ends up inattestation_failures_total
, while on TDX it ends up ingrpc_server_handled_total
with an internal error status. Thus, we could not have a simple portable policy test that relied on the metrics.This PR unifies handling of the policy hash between SNP and TDX by removing the additional validation from SNP. Existence of the hash in the manifest is now only checked in the
NewMeshCert
handler, where failures increment thegrpc_server_handled_total
with aPermissionDenied
status. Now we can run the policy e2e test on all platforms.Drive-by fix: the CLI now verifies coordinators on TDX correctly.