Skip to content

fix(cli): write .df-credentials.json with owner-only permissions - #2454

Open
rafal-hawrylak wants to merge 2 commits into
mainfrom
fix/df-credentials-file-permissions
Open

rafal-hawrylak wants to merge 2 commits into
mainfrom
fix/df-credentials-file-permissions

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

dataform init-creds wrote .df-credentials.json with default permissions, so a file that can hold a service account key was readable by other local users. Add credentials.write, which creates the file with mode 0600 and tightens an existing file before writing to it. Also keep the file out of the temporary project copy made for a stateless @dataform/core install, whatever the ignore files say. Project code that loads the file during such a compile will no longer find it.

`dataform init-creds` wrote `.df-credentials.json` with default permissions, so a file that can hold a service account key was readable by other local users. Add `credentials.write`, which creates the file with mode `0600` and tightens an existing file before writing to it. Also keep the file out of the temporary project copy made for a stateless `@dataform/core` install, whatever the ignore files say. Project code that loads the file during such a compile will no longer find it.
@rafal-hawrylak
rafal-hawrylak requested a review from a team as a code owner November 18, 2026 06:47
@rafal-hawrylak
rafal-hawrylak requested review from apilaskowski and removed request for a team November 18, 2026 06:47
Exclude .df-credentials.json alongside .git in NEVER_COPIED_NAMES so it is never copied into the stateless-install temporary directory, even inside definitions/ or includes/ or through symbolic links.

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