feat: restrict netbird access
This commit is contained in:
parent
8b45dc4d7e
commit
b8a5e48e85
|
@ -148,19 +148,6 @@ in {
|
||||||
cfg.tunnels
|
cfg.tunnels
|
||||||
);
|
);
|
||||||
|
|
||||||
systemd.tmpfiles.settings."10-netbird-access" = lib.flip lib.mapAttrs' cfg.tunnels (
|
|
||||||
_: {
|
|
||||||
stateDir,
|
|
||||||
userAccess,
|
|
||||||
...
|
|
||||||
}: (nameValuePair "/run/${stateDir}" {
|
|
||||||
d.mode =
|
|
||||||
if userAccess
|
|
||||||
then "0755"
|
|
||||||
else "0750";
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
systemd.services =
|
systemd.services =
|
||||||
mapAttrs'
|
mapAttrs'
|
||||||
(
|
(
|
||||||
|
@ -168,6 +155,7 @@ in {
|
||||||
environment,
|
environment,
|
||||||
stateDir,
|
stateDir,
|
||||||
environmentFile,
|
environmentFile,
|
||||||
|
userAccess,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
nameValuePair "netbird-${name}" {
|
nameValuePair "netbird-${name}" {
|
||||||
|
@ -190,6 +178,10 @@ in {
|
||||||
StateDirectory = stateDir;
|
StateDirectory = stateDir;
|
||||||
StateDirectoryMode = "0700";
|
StateDirectoryMode = "0700";
|
||||||
WorkingDirectory = "/var/lib/${stateDir}";
|
WorkingDirectory = "/var/lib/${stateDir}";
|
||||||
|
RuntimeDirectoryMode =
|
||||||
|
if userAccess
|
||||||
|
then "0755"
|
||||||
|
else "0750";
|
||||||
|
|
||||||
# hardening
|
# hardening
|
||||||
LockPersonality = true;
|
LockPersonality = true;
|
||||||
|
|
Loading…
Reference in a new issue