feat: dstack TEE support for confidential deployment#29
Merged
Conversation
- Key provider: Auto/Static/Dstack key resolution with Unix socket client - Column encryption: AES-256-GCM with version-byte prefix for gradual migration - Attestation endpoint: GET /attestation returns TDX quote in TEE mode - Docker: CARGO_FEATURES build arg + compose files for 3 dstack topologies - Feature-gated: `cargo build --features dstack` enables TEE support
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.
Summary
Auto/Static/Dstackkey resolution viaresolve_keys(). Dstack mode derives keys deterministically from TEE KMS over a Unix domain socket (/var/run/dstack.sock). Auto mode probes env var then socket.tinycloud-core/src/encryption.rswith0x01version-byte prefix. Legacy plaintext data passes through transparently. Encryption hooks in delegation/invocation save (after hashing) and read paths.GET /attestation?<nonce>returns TDX quote + compose hash in TEE mode, classic response otherwise./versionendpoint: AddsinTEE: boolfield indicating whether the instance is running inside a TEE.cargo build --features dstackenables TEE support. Default build has zero dstack code.CARGO_FEATURESbuild arg + 3 compose files (SQLite, Postgres+S3, full confidential).Test plan
cargo build— compiles without dstack featurecargo build --features dstack— compiles with dstackcargo clippy -- -D warnings— clean (both modes)cargo fmt -- --check— cleancargo test— all 43 tests pass (including 7 new encryption tests)DSTACK_SIMULATOR_ENDPOINT)GET /attestationreturns valid response with simulatorGET /versionshows"inTEE": truein TEE mode