Skip to content

Empty TPM key-provider id for stable launch measurement - #777

Merged
kvinwang merged 2 commits into
masterfrom
empty-tpm-key-provider-id
Jul 14, 2026
Merged

Empty TPM key-provider id for stable launch measurement#777
kvinwang merged 2 commits into
masterfrom
empty-tpm-key-provider-id

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • For key_provider = tpm, stop using the instance app-root public key as the provider id.
  • Launch event becomes {"name":"tpm","id":""} (mode only); KeyProvider::id() returns empty for TPM.
  • KMS (CA pubkey) and local (sealing MR) ids are unchanged.

Why

The TPM app-root key is derived from a per-instance sealed seed. Measuring its pubkey made key-providermr_system / mr_aggregated instance-bound and unsuitable as a precomputed allowlist identity. Empty id keeps the measured claim as “TPM mode” without an unusable instance fingerprint.

Note: This intentionally changes the TPM launch measurement / event payload. Existing quotes that included a non-empty TPM id will not match new replays. Pinning a non-empty key_provider_id in app-compose for TPM will now fail closed (runtime id is always empty).

Test plan

  • cargo test -p dstack-types key_provider
  • Review that no deployment relies on compose-pinning a TPM app-root pubkey as key_provider_id
  • Optional: boot a TPM-mode CVM and confirm key-provider event id is empty and MRs are stable across same-image instances when no_instance_id is set

The TPM app-root public key is derived from a per-instance sealed seed, so
measuring it as key-provider id made mr_system/mr_aggregated instance-bound
and unusable as a precomputed allowlist identity. Emit and report an empty
id for key_provider=tpm (mode remains in the event name / kind); KMS and
local provider ids are unchanged.
Copilot AI review requested due to automatic review settings July 14, 2026 01:42

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.

Pull request overview

This PR makes TPM key-provider launch measurements stable across same-image instances by removing the instance-derived TPM app-root public key from the key-provider “id” used in measurement and compose pinning, leaving the TPM id empty while keeping KMS and local provider ids unchanged.

Changes:

  • Update KeyProvider::id() to return an empty slice for TPM (and add a unit test for this behavior).
  • Adjust Stage0 runtime “key-provider” event emission so TPM reports {"name":"tpm","id":""} while local/KMS still emit a hex id.
  • Update documentation and comments to reflect that TPM has no stable provider id for measurement/pinning.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dstack/dstack-util/src/system_setup/config_id_verifier.rs Updates config-id format documentation to clarify TPM uses an empty key-provider id.
dstack/dstack-util/src/system_setup.rs Emits empty TPM key-provider id in runtime event; local/KMS ids come from KeyProvider::id().
dstack/dstack-types/src/lib.rs Makes TPM KeyProvider::id() empty and adds a regression test.
docs/security/cvm-boundaries.md Documents key_provider_id semantics for kms/local vs empty for tpm/none.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/security/cvm-boundaries.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kvinwang
kvinwang merged commit f2ff8cd into master Jul 14, 2026
15 checks passed
@kvinwang
kvinwang deleted the empty-tpm-key-provider-id branch July 20, 2026 14:05
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