Hardened systemd deployment contract for read-only Monero observer
This commit is contained in:
@@ -10,6 +10,7 @@ async function secretFile(path: string | undefined): Promise<string> {
|
||||
if (!path) throw new Error('Custody PostgreSQL secret file is required');
|
||||
const info = await lstat(path);
|
||||
if (!info.isFile() || info.isSymbolicLink() || info.size > 16384 || info.size === 0) throw new Error('Invalid PostgreSQL secret file');
|
||||
if (process.platform !== 'win32' && (info.mode & 0o077) !== 0) throw new Error('PostgreSQL secret file permissions are too broad');
|
||||
return (await readFile(path, 'utf8')).trim();
|
||||
}
|
||||
/** No URL logging, no TLS options in a connection string overriding verified transport. */
|
||||
|
||||
Reference in New Issue
Block a user