Skip to content

fix(dstack-util): write boot-time secrets owner-only - #1233

Merged
kvinwang merged 1 commit into
nextfrom
fix/guest-secret-file-modes
Sep 24, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/guest-secret-file-modes

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

The boot path wrote secrets with plain fs::write, so they landed 0644:

  • .appkeys.json (disk/env keys, app root key, KMS temp CA key). get-keys/gen-app-keys already write the same file 0600.
  • .decrypted-env and .decrypted-env.json (plaintext deployer secrets). docs/security/security-best-practices.md asks for 0600 on both. app-compose.service reads them as root; containers get the values through compose, so nothing else changes.

All three now go through safe_write_with_mode(.., 0o600).

The host-shared copy truncation that was originally in this PR has since landed on next, so it was dropped on rebase.

Verification: cargo test -p dstack-util (113 passed), clippy and fmt clean.

@kvinwang
kvinwang force-pushed the fix/guest-secret-file-modes branch from ba47bdc to 6b24df5 Compare September 24, 2026 09:08
@kvinwang kvinwang changed the title fix(dstack-util): write boot-time secrets owner-only and truncate the host-shared copy fix(dstack-util): write boot-time secrets owner-only Sep 24, 2026
@kvinwang
kvinwang merged commit a93dd5c into next Sep 24, 2026
12 checks passed
@kvinwang
kvinwang deleted the fix/guest-secret-file-modes branch September 24, 2026 14:20
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