Repository navigation
Conversation
…ronment The node wiring from #327 (c1a040e), rebased onto main: at_rest config, keyring setup after migrations, the key mirror (ported to aws-sdk-s3 1.x), the /at-rest routes and the /info at_rest block. New: - at_rest.root_source = "escrow" (default, the node root and the escrow gate) or "env": the ARK is sealed under a 32-byte key from TINYCLOUD_AT_REST_ROOT_KEY (standard base64), with no escrow. - TINYCLOUD_AT_REST_PREVIOUS_ROOT_KEY: the root the stored ARK rows were sealed under; the keyring re-seals them under the current root. Used to change an env key and to move from an env root to the node root. - Refusals at boot: a missing, malformed or misplaced root key; env root with any escrow setting; an env key that does not open the stored keys; in a TEE, an env root that is not a literal in the measured compose, a root key that is a literal there, an app-compose that allows SSH keys, or an OS image that is not a pinned production image. - The key's fingerprint (a hash prefix, never the key) in the boot log and /at-rest/status. - tinycloud_core::at_rest::{AtRestMode, AtRestView, AtRestSource}: the view storage reads per operation; the runtime implements it. - Encrypt and strict need both KV blocks and SQL artifacts to declare a seal path.
--validate-config now refuses a missing, malformed or misplaced at-rest root key, as the boot does, without reading the node root.
This was referenced Nov 7, 2026
The DID-resolution guard reserves `resolve` for resolver entry points.
This branch has not been deployed
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.
TC-887. Third PR of the refreshed at-rest stack (base: #514). Replaces #327 and adds a root from the environment.
From #327 (
c1a040e), rebased onto mainat_restconfig:mode,escrow,escrow_none._tc/at-rest/in the block bucket,{datadir}/at-reston disk). The S3 mirror is ported to aws-sdk-s3 1.x./at-rest/*routes and the/infoat_restblock.docs/at-rest-escrow.md.New
at_rest.root_source = "escrow" | "env"(defaultescrow).escrowis feat(TC-887): node wiring for at-rest keys and escrow recovery #327's path unchanged: the node root, with the escrow gate.envseals the ARK under a 32-byte key fromTINYCLOUD_AT_REST_ROOT_KEY(standard base64, 44 characters, canonical), with no escrow.DekIdin TCE1 headers, object names, mirrors).TINYCLOUD_AT_REST_PREVIOUS_ROOT_KEY: the root the stored rows were sealed under. The keyring re-seals them under the current root (open_with_previous_root, feat(TC-887): at-rest keyring, key store and migration #514). This covers both changing an env key and moving from an env root to the node root. Data keys and data are not rewritten.root_source = "escrow";TINYCLOUD_AT_REST__ROOT_SOURCEto the literalenv;DSTACK_AUTHORIZED_KEYS;PRODUCTION_OS_IMAGE_HASHES,dstack-0.5.12today; dev images are refused).hex(SHA-256("tinycloud/at-rest/root-fingerprint/v1" ‖ key))[..16]goes in the boot log and in/at-rest/status(root_source,root_fingerprint). It can be computed offline; the key itself never appears.tinycloud_core::at_rest::{AtRestMode, AtRestView, AtRestSource}. Storage reads a fresh view per operation, andAtRestRuntimeimplements it.encrypt/strictstay refused until both KV blocks and SQL artifacts declare a seal path (SealPath::{Blocks, SqlArtifacts}), so this PR alone can't turn encryption on.--validate-configruns the same root-key checks as boot, without reading the node root, so a missing or malformed key fails the preflight.std::envonly and never enterConfig.TINYCLOUD_AT_REST_ROOT_KEYuses a single underscore on purpose: figment's__form would map intoat_restand faildeny_unknown_fields.Tests
tests/at_rest_env_root.rs(one process, real app). It covers:dstack-dev-0.5.12;os_image_hashparsing from Info.tests/at_rest_env.rschecks the root-key variables don't reach the config loader.Verification
--validate-configrejects a missing key, a malformed key, and a key set withroot_source = escrow. A boot with an env key serves/at-rest/statuswith the fingerprint you get from computing it offline. A restart with another key refuses to start and names that key's fingerprint, and no key bytes appear in the log.cargo test --locked -p tinycloud-node --lib -- at_rest dstackcargo test --locked -p tinycloud-node --test at_rest_env --test at_rest_ceremony --test at_rest_env_rootcargo clippy --locked -p tinycloud-node -p tinycloud-core --all-targetswith-Dwarnings, andcargo fmt --all -- --check: clean.