Skip to content

feat: dstack TEE support for confidential deployment#29

Merged
skgbafa merged 3 commits intomainfrom
feat/dstack
Mar 10, 2026
Merged

feat: dstack TEE support for confidential deployment#29
skgbafa merged 3 commits intomainfrom
feat/dstack

Conversation

@skgbafa
Copy link
Copy Markdown
Contributor

@skgbafa skgbafa commented Mar 10, 2026

Summary

  • Key provider: Auto/Static/Dstack key resolution via resolve_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.
  • Column encryption: AES-256-GCM in tinycloud-core/src/encryption.rs with 0x01 version-byte prefix. Legacy plaintext data passes through transparently. Encryption hooks in delegation/invocation save (after hashing) and read paths.
  • Attestation endpoint: GET /attestation?<nonce> returns TDX quote + compose hash in TEE mode, classic response otherwise.
  • /version endpoint: Adds inTEE: bool field indicating whether the instance is running inside a TEE.
  • Feature-gated: cargo build --features dstack enables TEE support. Default build has zero dstack code.
  • Docker: CARGO_FEATURES build arg + 3 compose files (SQLite, Postgres+S3, full confidential).

Test plan

  • cargo build — compiles without dstack feature
  • cargo build --features dstack — compiles with dstack
  • cargo clippy -- -D warnings — clean (both modes)
  • cargo fmt -- --check — clean
  • cargo test — all 43 tests pass (including 7 new encryption tests)
  • Manual test with dstack simulator (DSTACK_SIMULATOR_ENDPOINT)
  • Verify GET /attestation returns valid response with simulator
  • Verify GET /version shows "inTEE": true in TEE mode

skgbafa added 3 commits March 10, 2026 12:51
- 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
@skgbafa skgbafa merged commit e613a82 into main Mar 10, 2026
13 checks passed
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.

1 participant