sandbox: TDX on the run path, through a pinned PCK #399

Merged
dcharlot merged 1 commit from feat/sandbox-tdx-run-path into main 2026-10-21 16:25:09 -04:00
Owner

The run path sealed and verified SEV-SNP only: TeeConfig held a VCEK, and both sealing and verify_run_evidence called verify_snp.

A soundness fix first

verify_tdx took the PCK key from the quote's own certification data and checked the quoting-enclave report against it. So a quote consistent with itself, endorsed by a key its maker generated, verified. Now:

  • verify_tdx(…, pck) takes the PCK key the verifier pinned: from Intel's PCS with its chain checked, just as a VCEK comes from AMD's KDS.
  • The quote must carry that key, and the QE report is checked against it.
  • Regression test: a_quote_endorsed_by_its_own_pck_is_refused.

TDX on the run path

  • TeeAnchor { SevSnp(vcek), Tdx(pck) } plus a verify_report dispatcher.
  • TeeConfig.anchor replaces vcek. Sealing refuses a provider and anchor of different kinds.
  • verify_run_evidence takes the verifier's anchor and refuses evidence of another kind.
  • LocalTdxProvider is a software-grounded TDX provider for wiring (real ECDSA-P256, Grounding::Software).
  • ConfigfsTsmProvider is no longer hard-coded to SEV-SNP:
    • for_kind(kind) sets the kind;
    • it refuses a report when the kernel's provider attribute names another platform (sev_guest or tdx_guest).
  • SPEC §7.6 gains the anchor rule and the TDX PCK rule; the §9 readiness row is updated.

Verification (build host)

  • sandbox-rs: 427 tests (--locked), plus sandbox-tee with the amd-kds feature.
  • Conformance: every class passes.
  • Clippy -D warnings is clean on the touched crates.
  • Mutation testing: 10 mutants; 9 killed. The 10th is equivalent: verifying with the quote's PCK once it has been pinned equal.
  • Repo checks pass, including lockfiles.

Not exercised: real TDX hardware. As on SEV-SNP, fetching the PCK certificate from Intel's PCS is the deployment's step.

🤖 Generated with Claude Code

The run path sealed and verified SEV-SNP only: `TeeConfig` held a VCEK, and both sealing and `verify_run_evidence` called `verify_snp`. ## A soundness fix first `verify_tdx` took the PCK key from **the quote's own certification data** and checked the quoting-enclave report against it. So a quote consistent with itself, endorsed by a key its maker generated, verified. Now: - **`verify_tdx(…, pck)`** takes the PCK key the **verifier pinned**: from Intel's PCS with its chain checked, just as a VCEK comes from AMD's KDS. - **The quote must carry that key,** and the QE report is checked against it. - **Regression test:** `a_quote_endorsed_by_its_own_pck_is_refused`. ## TDX on the run path - **`TeeAnchor { SevSnp(vcek), Tdx(pck) }`** plus a `verify_report` dispatcher. - **`TeeConfig.anchor`** replaces `vcek`. Sealing refuses a provider and anchor of different kinds. - **`verify_run_evidence`** takes the verifier's anchor and refuses evidence of another kind. - **`LocalTdxProvider`** is a software-grounded TDX provider for wiring (real ECDSA-P256, `Grounding::Software`). - **`ConfigfsTsmProvider`** is no longer hard-coded to SEV-SNP: - `for_kind(kind)` sets the kind; - it refuses a report when the kernel's `provider` attribute names another platform (`sev_guest` or `tdx_guest`). - **SPEC §7.6** gains the anchor rule and the TDX PCK rule; the §9 readiness row is updated. ## Verification (build host) - **sandbox-rs:** 427 tests (`--locked`), plus sandbox-tee with the `amd-kds` feature. - **Conformance:** every class passes. - **Clippy** `-D warnings` is clean on the touched crates. - **Mutation testing:** 10 mutants; 9 killed. The 10th is equivalent: verifying with the quote's PCK once it has been pinned equal. - **Repo checks** pass, including lockfiles. **Not exercised: real TDX hardware.** As on SEV-SNP, fetching the PCK certificate from Intel's PCS is the deployment's step. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandbox: TDX on the run path, through a pinned PCK
All checks were successful
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 16s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 1m45s
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-rs, linux) (pull_request) Successful in 1m46s
standards workspaces build + test / joule-ui-rs (joule-ui/joule-ui-rs, joule-ui-rs, linux) (pull_request) Successful in 1m15s
standards workspaces build + test / proof-rs (proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m41s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m43s
standards workspaces build + test / joulecontract-rs (joulecontract/joulecontract-rs, joulecontract-rs, linux-arm64, true) (pull_request) Successful in 2m39s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 4m38s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 13m15s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 4m41s
9caa8dcf13
The run path sealed and verified SEV-SNP only: TeeConfig held a VCEK and
both seal and verify_run_evidence called verify_snp, so a TDX guest could
not run a confidential unit. Wiring TDX in exposed a soundness gap first.
verify_tdx took the PCK key from the quote's own certification data and
checked the QE report against it, so any quote that was consistent with
itself, endorsed by a key its maker generated, verified.

sandbox-tee:
- verify_tdx takes the PCK key the verifier pinned (from Intel's PCS, its
  chain checked, as a VCEK comes from AMD's KDS); the quote must carry that
  key, and the QE report is checked against it.
- TeeAnchor { SevSnp(vcek), Tdx(pck) } and verify_report dispatch on it.
- LocalTdxProvider: a software-grounded TDX provider (real ECDSA-P256, dev
  keys, Grounding::Software), the TDX counterpart of LocalSnpProvider; the
  test-only quote builder becomes the crate-visible local_quote.
- ConfigfsTsmProvider is no longer hard-coded to SEV-SNP: for_kind(kind),
  and a report is refused when the kernel's `provider` attribute names
  another platform (tsm_provider_kind: sev_guest, tdx_guest).

sandbox-runtime:
- TeeConfig.anchor replaces TeeConfig.vcek. Sealing refuses a provider and
  anchor of different kinds, then verifies through verify_report.
- verify_run_evidence takes the verifier's anchor and refuses evidence of
  another kind.
sandbox-cli is updated to the anchor.

SPEC §7.6: the anchor rule (a report is trusted through a key the verifier
pins, never one it carries) and the TDX PCK rule. The §9 readiness row is
updated.

Tests:
- A quote endorsed by its own PCK is refused.
- A local TDX quote verifies against its PCK.
- TSM provider names map to kinds.
- A report of another platform kind is refused.
- A confidential run on TDX is sealed and verified, and refused for another
  challenge, outcome, PCK or kind.
- A provider and anchor of different kinds cannot seal.
Mutation testing: 10 mutants; 9 killed, 1 equivalent (checking the QE
report with the quote's PCK once it is pinned equal).

Verified on the build host: sandbox-rs 427 tests (--locked), sandbox-tee
with amd-kds, and every conformance class; clippy -D warnings clean on
sandbox-tee, -runtime, -cli. Repo checks pass, including lockfiles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!399
No description provided.