Skip to content

Commit eccf638

Browse files
committed
nixos/echoip: improve systemd hardening
1 parent 110b3af commit eccf638

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

nixos/modules/services/web-apps/echoip.nix

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ in
7575
);
7676

7777
# Hardening
78+
AmbientCapabilities = "";
7879
CapabilityBoundingSet = [ "" ];
79-
DeviceAllow = [ "" ];
80+
DevicePolicy = "closed";
8081
LockPersonality = true;
82+
MemoryDenyWriteExecute = true;
83+
NoNewPrivileges = true;
8184
PrivateDevices = true;
8285
PrivateTmp = true;
8386
PrivateUsers = true;
@@ -91,15 +94,19 @@ in
9194
ProtectKernelTunables = true;
9295
ProtectProc = "invisible";
9396
ProtectSystem = "strict";
94-
RestrictAddressFamilies = [
95-
"AF_INET"
96-
"AF_INET6"
97-
"AF_UNIX"
98-
];
97+
RemoveIPC = true;
98+
RestrictAddressFamilies = [ "AF_INET AF_INET6 AF_UNIX" ];
9999
RestrictNamespaces = true;
100100
RestrictRealtime = true;
101101
RestrictSUIDSGID = true;
102102
SystemCallArchitectures = "native";
103+
SystemCallFilter = [
104+
"@system-service"
105+
"~@privileged"
106+
"~@resources"
107+
"setrlimit"
108+
];
109+
UMask = "0077";
103110
};
104111
};
105112

0 commit comments

Comments
 (0)