vmm: add per-VM swtpm key provider#798
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the dstack-vmm no-TEE development VM path to support persistent TPM-backed app keys by running a per-VM swtpm backend (instead of hardware TPM passthrough), and wires that through the VMM lifecycle, UI, and documentation. This enables exercising seal/unseal + restart persistence on the Dstack dev platform while explicitly keeping remote attestation/verifier trust unchanged.
Changes:
- Add per-VM
swtpmprocess management (state/socket under VM workdir), wait-for-socket gating before QEMU starts, and attach TPM via QEMU’s emulator backend. - Update VMM lifecycle cleanup to stop/remove dependent supervisor processes associated with a VM.
- Update the VMM console UI and docs to reflect
key_providerselection (kms|local|tpm|none) and Dstack dev-only swtpm semantics; expand TPM PCR policy support forPlatform::Dstackintpm-attest.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dstack/vmm/src/console_v0.html | Replaces KMS/local checkboxes with a key_provider selector and updates payload serialization. |
| dstack/vmm/src/app/workdir.rs | Adds workdir helpers for swtpm state directory and socket path. |
| dstack/vmm/src/app/qemu.rs | Implements swtpm-backed TPM for dev no-TEE VMs and hooks it into QEMU launch. |
| dstack/vmm/src/app.rs | Adds dependent-process stop/remove logic so auxiliary processes follow VM lifecycle. |
| dstack/tpm-attest/src/lib.rs | Allows Dstack platform to use the existing SHA-256 PCR 0/2/14 policy and adds a test. |
| docs/security/cvm-boundaries.md | Documents Dstack dev swtpm behavior and clarifies it is not a remote trust root. |
| CONTRIBUTING.md | Documents how to use key_provider=tpm with swtpm for no-TEE dev images. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The no-TEE development image can exercise the production guest setup path via the TEE ABI simulator, but it only has temporary app keys when no KMS/local SGX key provider is available. The VMM's existing
key_provider=tpmsupport passes through a host hardware TPM and the guest rejects TPM provisioning onPlatform::Dstack.Changes
swtpmbackenddstack-vmmbinary in a hiddenvm-launchermode as the single Supervisor-managed VM process;Platform::Dstackusing the existing SHA-256 PCR 0/2/14 policy;tpm, and ensure TPM emits an empty provider ID;console_v0route and file.The remote attestation/verifier side is intentionally unchanged. It does not accept Dstack software-TPM evidence.
Process failure handling
PR_SET_PDEATHSIG=SIGKILLas a final fallback;Safety
Validation
cargo check -p dstack-vmm -p tpm-attestcargo clippy -p dstack-vmm --all-targets -- -D warningscargo test -p dstack-vmm --no-fail-fastcargo test -p tpm-attest