Skip to content

Commit 8073365

Browse files
committed
If a user is set, turn off DynamicUser.
Also set all the settings DynamicUser automatically sets. This ensures that the environment between the two options stays consistent.
1 parent 13d5456 commit 8073365

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/geth/default.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
mapAttrs'
2121
mapAttrsToList
2222
mkDefault
23+
mkForce
2324
mkIf
2425
mkMerge
2526
nameValuePair
@@ -132,6 +133,14 @@ in {
132133
(mkIf (cfg.args.authrpc.jwtsecret != null) {
133134
LoadCredential = ["jwtsecret:${cfg.args.authrpc.jwtsecret}"];
134135
})
136+
(mkIf (cfg.user != null) {
137+
DynamicUser = mkForce false;
138+
RemoveIPC = mkDefault true;
139+
PrivateTmp = mkDefault true;
140+
NoNewPrivileges = mkDefault "strict";
141+
RestrictSUIDSGID = mkDefault true;
142+
ProtectSystem = mkDefault true;
143+
})
135144
];
136145
})
137146
)

0 commit comments

Comments
 (0)