Skip to content

Commit

Permalink
Tighten local FS permissions around CA private key
Browse files Browse the repository at this point in the history
This isn't an impactful issue, since user profile dir permissions will
generally block access anyway, but it's good practice to keep this
limited where possible (and good defense-in-depth generally)
  • Loading branch information
pimterry committed Jun 21, 2024
1 parent 9822ae3 commit 80035cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ async function generateHTTPSConfig(configPath: string) {

return Promise.all([
writeFile(certPath, newCertPair.cert).then(() => newCertPair.cert),
writeFile(keyPath, newCertPair.key)
writeFile(keyPath, newCertPair.key, {
mode: 0o600 // Only readable for ourselves, nobody else
})
]);
});

Expand Down

0 comments on commit 80035cb

Please sign in to comment.