Skip to content

Move TDX quote generation code to attestation provider crate - #117

Open
ameba23 wants to merge 1 commit into
mainfrom
peg/only-attestation-provider
Open

ameba23 wants to merge 1 commit into
mainfrom
peg/only-attestation-provider

Conversation

@ameba23

@ameba23 ameba23 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

This switches things so that using a separate attestation provider process is no longer optional. This simplifies things a bit since this is now our chosen way to do things, since it has a security advantage relating to linux permissions.

attestation-provider-server crate now contains the code for generating TDX quotes and collects platform metadata. Applications request evidence through AttestationGeneratorClient over the existing Unix socket protocol. The provider can run without network access and retains the local vSOCK fallback.

Migration

  • Start the provider with --server-attestation-type dcap-tdx or --server-attestation-type gcp-tdx. The server requires an explicit type and rejects auto and none.
  • attested-tls crate: Pass Some(client) to AttestedCertificateResolver to request evidence during certificate issuance and renewal. Pass None to issue and renew unattested certificates without contacting the provider.
  • Use attestation::detect_gcp() if the application already expects TDX and needs to select a platform type. It checks GCP metadata without probing TDX hardware and defaults to DcapTdx when GCP is unconfirmed.

Validation

  • Workspace tests passed with all targets and features. Clippy and formatting checks passed.
  • TLS tests cover issuance, renewal, and handshakes through a mock Unix-socket provider. A mock provider round trip also passed with IPv4 and IPv6 sockets blocked.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The offline ConfigFS/vSOCK generation claim requires confirmation on target TDX platforms because pinned external implementations are unavailable in this snapshot and mock socket tests do not validate the hardware paths.

No open issues 🎉

What changed in this PR

Moves TDX quote generation and platform metadata collection into attestation-provider-server, separating privileged hardware access from applications that request evidence over Unix sockets.

Changes:

  • Introduces AttestationGeneratorClient and updates TLS certificate issuance and renewal to use an optional provider client.
  • Requires an explicit provider platform type and replaces hardware auto-detection with the metadata-only detect_gcp() helper.
  • Migrates dependencies, updates documentation, and adapts tests to use a mock socket provider.
File Description
readme.md Describes attestation requests rather than local generation.
crates/​attested-tls/​tests/​nested_tls.rs Uses a mock provider for nested TLS handshakes.
crates/​attested-tls/​tests/​common/​mod.rs Adds a shared mock socket provider fixture.
crates/​attested-tls/​src/​lib.rs Uses optional provider clients and tests both renewal modes.
crates/​attested-tls/​readme.md Documents provider-backed and unattested certificate modes.
crates/​attested-tls/​Cargo.toml Removes the quote feature and adds provider test dependencies.
crates/​attestation/​src/​provider.rs Adds the client API and rejects responses without evidence.
crates/​attestation/​src/​lib.rs Removes local generation and exposes detect_gcp().
crates/​attestation/​src/​gcp/​provenance.rs Updates tests to generate mock quotes directly.
crates/​attestation/​src/​dcap.rs Removes quote generation while retaining verification.
crates/​attestation/​README.md Documents socket requests and revised platform detection.
crates/​attestation/​Cargo.toml Removes the direct TDX generation dependency.
crates/​attestation-provider-server/​src/​main.rs Requires and tests explicit supported platform types.
crates/​attestation-provider-server/​src/​lib.rs Integrates the relocated generator and updates transport tests.
crates/​attestation-provider-server/​src/​generator.rs Implements local quote generation and metadata collection.
crates/​attestation-provider-server/​README.md Documents platform selection and networking requirements.
crates/​attestation-provider-server/​Cargo.toml Adds generation dependencies and mock support.
Cargo.lock Records the dependency migration and test additions.

Review effort: Balanced

@ameba23
ameba23 requested a review from alexhulbert November 27, 2026 08:48
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