Skip to content

Commit 80035cb

Browse files
committed
Tighten local FS permissions around CA private key
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)
1 parent 9822ae3 commit 80035cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ async function generateHTTPSConfig(configPath: string) {
5656

5757
return Promise.all([
5858
writeFile(certPath, newCertPair.cert).then(() => newCertPair.cert),
59-
writeFile(keyPath, newCertPair.key)
59+
writeFile(keyPath, newCertPair.key, {
60+
mode: 0o600 // Only readable for ourselves, nobody else
61+
})
6062
]);
6163
});
6264

0 commit comments

Comments
 (0)