DCAP attestation: Add GCP provenence check to establish whether the associated PPID is endorsed by Google - #54
Conversation
* main: Bump reqwest to 0.13.4 chore(deps): bump openssl from 0.10.79 to 0.10.80
| expected_input_data: [u8; 64], | ||
| pccs: Option<Pccs>, | ||
| ) -> Result<MultiMeasurements, DcapVerificationError> { | ||
| ) -> Result<(MultiMeasurements, Quote), DcapVerificationError> { |
There was a problem hiding this comment.
To avoid parsing the quote a second time to extract the PPID after verification, the verifier function now returns the parsed quote.
| @@ -0,0 +1,70 @@ | |||
| //! On GCP check MRTD values map to Google endorsed firmware | |||
There was a problem hiding this comment.
This file is mostly unchanged from main - i just refactored it into a separate file to avoid having both provenance and firmware stuff together in one file.
| /// OS image | ||
| pub measurement_id: String, | ||
| /// The attestation type this record accepts | ||
| pub attestation_type: AttestationType, |
There was a problem hiding this comment.
To enforce the GCP provenance check, attestation policies need to explictly state the expected attestation type
| const GCP_PROVENANCE_REGISTRY_URL: &str = | ||
| "https://storage.googleapis.com/confidential-host-registry"; |
There was a problem hiding this comment.
should this be always fixed or should we also make it optionally set by an env var and if not provided it defaults to this URL instead?
This could also serve for future path in case PPID is deprecated or if the verifier would like to pull the registry from a different source.
There was a problem hiding this comment.
Agree this would be nice to have configurable. I started adding this, and realised it would be nice to have this option on the builder API for attestation verifier, which is still an open PR awaiting review: #70 so will make an issue and add that once the builder API is merged.
There was a problem hiding this comment.
Yes, I was recently thinking about this more and maybe for some of our workloads that soon going to migrate to bare-metal, we could also have something similar to the GCP provenance where we provide an endpoint as a registery URL for the TEE hardware inventory until a more standardized version comes out like Intel's PoE
| #[error("blocking task join: {0}")] | ||
| TaskJoin(String), |
There was a problem hiding this comment.
Nit: semantically doesn't seem to be a GcpProvenanceError type but rather a threading or async kind of error type, or did I misunderstand something here ?
There was a problem hiding this comment.
No, semantically its not. This would happen if the task handling the provenance check panics. Which if this is implemented correctly should be highly unlikely to happen but we have to handle this case anyway. I would argue it make sense to categorize it as this because it is a possible bad outcome of running the provenance check.
|
Small suggestion: |
If i understand you right, you mean we should handle the case that the verifier doesn't care whether or not its a GCP attestation - any DCAP attestation will do. Currently you can get this by specifying 'DcapTdx' as the attestation type in the policy. However, if the server claims their attestation type is I see the logic here, but i'd be wary of skipping the check in that case, because if the server indicates that they are running on GCP but is not, i don't think we should treat that as a valid attestation. In the happy path, the non-GCP server correctly submits platform metadata as If your concern is more just that we are starting to bloat the whole process with GCP-specific logic, then yes i can see an argument for putting it behind a feature flag and not compiling it on builds where we don't care about GCP. |
* main: Bump crates from attest repo following fix for counting disks attestation: keep deprecated azure feature as alias for azure-attester ci: check azure-verifier portability on macOS attestation: move azure generation into attester/, verification into verify.rs attestation: vendor portable vTPM quote verification, split the azure feature
…fyMode Second of two changes for flashbots#84, stacked on flashbots#85. Reporting the collateral a verification consumed is half of provenance. The other half is running the same verification again later, against that bundle, and getting the same answer. Nothing exposed that: the public entry points always fetched, and the only way to supply a bundle was through test-only variants that also took a bare timestamp. Verification now takes a VerifyMode. Live fetches collateral and reads the wall clock. Archived carries the bundle and the instant it was collected, so the two can never be supplied apart - a pinned bundle evaluated at the wrong instant is the mistake the old (Option<collateral>, now) pair permitted. Azure holds its AK certificate chain to the instant the DCAP leg reported, so both legs evaluate at one time in either mode. The Azure TCB override leaves the public DCAP entry points. Only the Azure verifier has a reason to relax TCB checks, so it reaches the override through a crate-private variant; verify_dcap_attestation always verifies at full strictness. The mock verifier likewise becomes its own function rather than a cfg switch inside the production one, so verify_dcap_attestation means Intel-rooted in every build and the fixture tests replay real captures against it. AttestationVerifier is the one place that picks between them. BREAKING CHANGE: verify_attestation and verify_attestation_sync take a VerifyMode; the DCAP and Azure entry points take mode before pccs and the DCAP ones drop override_azure_outdated_tcb; the *_with_given_timestamp variants are gone, replaced by VerifyMode::Archived. GCP checks and Archived mode ---------------------------- The GCP host provenance check from flashbots#54 stays live in either mode, as does the firmware fetch for the quote's MRTD. Neither rests on signed material a replay could re-verify: the provenance document is an unsigned JSON object whose trust is the TLS connection to Google's bucket, so archiving it would not make a replay stronger. The docs on VerifyMode::Archived and verify_attestation state the carve-out. Whether Archived should skip the provenance lookup instead is left open. Closes flashbots#84
When verifying an attestation which claims to be of type
AttestationType::GcpTdxthis PR adds an additional check as to whether the PPID from the PCK certificate included in the attestation is present in GCP's public bucket, which indicates that the PPID belongs to them. This is essentially a 'proof-of-cloud' check specially for GCP.This is based on Google's own provenance checker tool written in Go: https://github.com/google/go-tdx-guest/blob/main/tools/gceprovenance/main.go
In order to match the Go implementation we:
Unlike the Go implementation we additionally:
zoneandtimestamp.Note: The Go implementation offers an additional instance-verification check as well as the provenance check. This checks the MR_OWNER value against instance metadata. This is outside of the scope of this PR and not implemented.
Note: No checks are made on the timestamp or zone details in the response, other than making sure those fields are present. This is because the Go implementation also does not check those values. Such checks could be added later in a follow-up.
See relevant documentation from Google:
TODO: