Skip to content

Commit a574f2b

Browse files
authored
nixos/uptime-kuma: Add additional lockdown settings to systemd unit (NixOS#361452)
2 parents f23331e + 4a66164 commit a574f2b

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

nixos/modules/services/monitoring/uptime-kuma.nix

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,30 @@ in
5151
DynamicUser = true;
5252
ExecStart = "${cfg.package}/bin/uptime-kuma-server";
5353
Restart = "on-failure";
54-
ProtectHome = true;
55-
ProtectSystem = "strict";
56-
PrivateTmp = true;
54+
AmbientCapabilities = "";
55+
CapabilityBoundingSet = "";
56+
LockPersonality = true;
57+
MemoryDenyWriteExecute = false; # enabling it breaks execution
58+
NoNewPrivileges = true;
5759
PrivateDevices = true;
58-
ProtectHostname = true;
60+
PrivateMounts = true;
61+
PrivateTmp = true;
5962
ProtectClock = true;
60-
ProtectKernelTunables = true;
61-
ProtectKernelModules = true;
62-
ProtectKernelLogs = true;
6363
ProtectControlGroups = true;
64-
NoNewPrivileges = true;
64+
ProtectHome = true;
65+
ProtectHostname = true;
66+
ProtectKernelLogs = true;
67+
ProtectKernelModules = true;
68+
ProtectKernelTunables = true;
69+
ProtectProc = "noaccess";
70+
ProtectSystem = "strict";
71+
RemoveIPC = true;
72+
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" "AF_NETLINK" ];
73+
RestrictNamespaces = true;
6574
RestrictRealtime = true;
6675
RestrictSUIDSGID = true;
67-
RemoveIPC = true;
68-
PrivateMounts = true;
76+
SystemCallArchitectures = "native";
77+
UMask = 027;
6978
};
7079
};
7180
};

0 commit comments

Comments
 (0)