Skip to content

Commit

Permalink
[FE-6183] Update Permissions on Credentials Files (#487)
Browse files Browse the repository at this point in the history
* write creds as chmod 600

* do the same for shell history
  • Loading branch information
henryfauna authored Dec 6, 2024
1 parent deff6bc commit f7bb80d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/file-util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class CredentialsStorage {
}
this.filepath = `${this.credsDir}/${this.filename}`;
if (!fileExists(this.filepath)) {
fs.writeFileSync(this.filepath, "{}");
fs.writeFileSync(this.filepath, "{}", { mode: 0o600 });
}
}

Expand Down Expand Up @@ -335,7 +335,7 @@ export function initHistoryStorage() {
}
const historyFile = path.join(historyDir, "history");
if (!fileExists(historyFile)) {
fs.writeFileSync(historyFile, "");
fs.writeFileSync(historyFile, "", { mode: 0o600 });
}

return historyFile;
Expand All @@ -351,7 +351,7 @@ export function clearHistoryStorage() {
const fs = container.resolve("fs");
const homedir = container.resolve("homedir")();
const historyFile = path.join(homedir, ".fauna/history");
fs.writeFileSync(historyFile, "");
fs.writeFileSync(historyFile, "", { mode: 0o600 });
}

/**
Expand Down

0 comments on commit f7bb80d

Please sign in to comment.