Skip to content

ci(TC-887): deploy wiring for an at-rest root from the environment (draft, do not merge) - #517

Draft
samgbafa wants to merge 1 commit into
skgbafa/tc-887-r3-node-wiringfrom
skgbafa/tc-887-r9-deploy-wiring
Draft

samgbafa wants to merge 1 commit into
skgbafa/tc-887-r3-node-wiringfrom
skgbafa/tc-887-r9-deploy-wiring

Conversation

@samgbafa

@samgbafa samgbafa commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

TC-887. Draft, not for merging. This PR prepares the deploy for an at-rest root from the environment (base: #515). It stays a draft until the switch-on prerequisites tracked on TC-887 are met, and it will be rebased onto the top of the at-rest stack before then.

What

  • docker-compose.dstack-postgres.yaml:
    • adds TINYCLOUD_AT_REST__ROOT_SOURCE: env and TINYCLOUD_AT_REST__MODE: "off" as literals in the measured compose, and TINYCLOUD_AT_REST_ROOT_KEY: "${AT_REST_ROOT_KEY:?…}" from the sealed environment;
    • the trust-bundle comment becomes ASCII-only, because the node reads the measured compose with a strict, printable-ASCII parser.
  • With mode = "off" the node provisions and checks the keys (fingerprint in /at-rest/status) without encrypting. Turning encryption on is a later, reviewed one-line change to "encrypt".
  • docker.yml deploy:
  • The N0 template hash (6cc584f6…, raw eef0594d…), its byte-identical fixture scripts/ci/fixtures/tc959-n0-compose.yaml, docs/releasing.md and CHANGELOG move together.
  • Tests:
    • scripts/ci/test-deploy-recovery.py deploys with a valid key, checks the key never reaches logs, and adds a refusal test for malformed keys;
    • the escrow crate's production_compose_passes is back;
    • a node unit test checks that the production compose passes the env-root boot check.

Before this can deploy

  • The node refuses root_source = "env" in a TEE while the measured app-compose allows DSTACK_AUTHORIZED_KEYS, or on a non-production OS image (feat(TC-887): node wiring for at-rest keys, with a root from the environment #515). The SSH-key provisioning and the image must change first.
  • The secret must exist in the production environment. Once AT_REST_ROOT_KEY is in the CVM's allowed_envs, it must stay present on every deploy and rollback.

Verification

  • python3 scripts/ci/test-deploy-recovery.py: 31 tests OK.
  • bash scripts/ci/test-phala-os-guard.sh: passed.
  • cargo test --locked -p tinycloud-at-rest-escrow production_compose
  • cargo test --locked -p tinycloud-node --lib -- at_rest::tests

The production compose sets root_source = env and mode = off and takes the
root key from the sealed environment; the deploy maps the new production
secret, refuses a malformed key before the sealed file is written, and the
preflight validates it. Compose comments are ASCII-only for the strict
compose reader; the N0 template hash, its fixture and docs move together.

Draft: not for merging before the switch-on gates.
@samgbafa
samgbafa force-pushed the skgbafa/tc-887-r9-deploy-wiring branch from 82fc22c to ce47dc8 Compare November 8, 2026 00:15

This branch has not been deployed

No deployments
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