Skip to content

fix: write identity key material with owner-only permissions - #796

Open
raymondk wants to merge 1 commit into
fix/validate-network-environment-namesfrom
fix/identity-file-permissions
Open

raymondk wants to merge 1 commit into
fix/validate-network-environment-namesfrom
fix/identity-file-permissions

Conversation

@raymondk

Copy link
Copy Markdown
Collaborator

PEM keys, delegation chains and the --output-seed recovery phrase were written with plain fs::write, so under a typical umask of 022 they came out world-readable (0644) inside world-listable directories (0755).

PEM keys, delegation chains and the `--output-seed` recovery phrase were
written with plain `fs::write`, so under a typical umask of 022 they came
out world-readable (0644) inside world-listable directories (0755).

Add `fs::write_private`, which creates the file 0600 and narrows an
existing one before writing to it, and `fs::create_private_dir_all`,
which makes the directory 0700 even if it already existed. Use them for
every identity key write, the `keys/` and `delegations/` directories, and
the seed file.
@raymondk
raymondk requested a review from a team as a code owner September 25, 2026 23:41
@raymondk
raymondk added this pull request to stack #797 September 25, 2026 23:42

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