lnd: add strict hardening

Add ProtectSystem=strict, remove PermissionStartOnly.

Extract the section of postStart that needs secrets dir write
access into a separate script with full privileges.

Simplify preStart and fix dataDir quoting.
This commit is contained in:
Erik Arvstedt
2020-05-22 16:13:58 +00:00
committed by nixbitcoin
parent a040e52854
commit 5f3f362451
3 changed files with 63 additions and 56 deletions
+6 -1
View File
@@ -1,7 +1,7 @@
# See `man systemd.exec` and `man systemd.resource-control` for an explanation
# of the various systemd options available through this module.
lib:
lib: pkgs:
with lib;
{
@@ -42,4 +42,9 @@ with lib;
to 127.0.0.1;";
'';
};
script = src: pkgs.writers.writeBash "script" ''
set -eo pipefail
${src}
'';
}