Skip to content

fix(dstack-util): fail closed when an encrypted env cannot be decrypted - #1340

Open
kvinwang wants to merge 1 commit into
nextfrom
fix/encrypted-env-fail-closed
Open

kvinwang wants to merge 1 commit into
nextfrom
fix/encrypted-env-fail-closed

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

The local, tpm and none key providers hand out no env crypt key, and decrypt_env_vars treated that like "no encrypted env": a present .encrypted-env was dropped and the app booted with none of its secrets. It now fails closed.

The VMM only writes .encrypted-env after fetching the app's encrypt pubkey from a KMS, so the newly failing combination was already losing every secret.

Docs (cvm-boundaries.md):

  • an empty key_provider_id pins nothing; the provider identity is still in the key-provider launch event;
  • the env envelope is keyed by the app ID alone, so the host can withhold or replay an earlier ciphertext — apps should carry a version or expiry in the plaintext.

Split out of #1243. Conflicts trivially with #1233 around write_env_file.

The local, tpm and none key providers hand out no env crypt key, and a
present .encrypted-env was then silently dropped, booting the app with
none of its secrets. Refuse to boot instead.

Also document that an empty key_provider_id pins nothing, and that the
env envelope is bound to the app ID only and can be replayed by the host.
@kvinwang
kvinwang force-pushed the fix/encrypted-env-fail-closed branch from 240b277 to fd6a07a Compare September 23, 2026 08:01

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