Skip to content

fix(guest): safely write KMS key output - #890

Merged
kvinwang merged 1 commit into
masterfrom
codex/fix-guest-kms-key-permissions
Aug 5, 2026
Merged

kvinwang merged 1 commit into
masterfrom
codex/fix-guest-kms-key-permissions

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Protect the KMS key output with the repository's existing safe-write dependency.

Changes

  • Replace the direct KMS key output write with safe_write_with_mode(..., 0o600).
  • Publish the complete file atomically.
  • Set owner-only permissions when the temporary file is created, independently of the ambient umask.
  • Avoid an additional dependency or local atomic-write implementation.

Verification

  • cargo check --manifest-path dstack/Cargo.toml -p dstack-util
  • cargo fmt --manifest-path dstack/Cargo.toml --all
  • git diff --check

Copilot AI review requested due to automatic review settings July 31, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Base automatically changed from codex/fix-guest-atomic-credentials to master August 4, 2026 08:10
@kvinwang
kvinwang force-pushed the codex/fix-guest-kms-key-permissions branch from 7b03dde to 33099da Compare August 4, 2026 08:48
@kvinwang kvinwang changed the title [STACKED on #883] fix(guest): protect KMS key output fix(guest): safely write KMS key output Aug 4, 2026
@kvinwang
kvinwang merged commit ee6d950 into master Aug 5, 2026
15 checks passed
@kvinwang
kvinwang deleted the codex/fix-guest-kms-key-permissions branch August 7, 2026 13:46
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.

2 participants