Skip to content

fix(config): tighten existing secrets file permissions - #10453

Merged
jbg merged 1 commit into
mainfrom
jbg/security-secret-file-mode
Jul 15, 2026
Merged

fix(config): tighten existing secrets file permissions#10453
jbg merged 1 commit into
mainfrom
jbg/security-secret-file-mode

Conversation

@jbg

@jbg jbg commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • enforce owner-only permissions whenever an existing Unix secrets file is rewritten
  • repair permissions before truncating the file so failures preserve existing contents
  • add regression coverage for permissive existing files while retaining fresh-file coverage

Validation

  • cargo test -p goose test_existing_secrets_file_permissions_tightened_on_write
  • cargo test -p goose test_secrets_file_created_with_restricted_permissions
  • cargo build -p goose
  • cargo clippy -p goose --all-targets -- -D warnings

This finding was discovered by Project Loupe.

@jbg
jbg requested review from DOsinga and jamadeo July 14, 2026 12:24

@alexhancock alexhancock left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me as a more logical progression of attempt permissions change, wipe, write.

@jbg
jbg added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit da57416 Jul 15, 2026
27 of 29 checks passed
@jbg
jbg deleted the jbg/security-secret-file-mode branch July 15, 2026 18:45
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