Skip to content

Commit ef19fcf

Browse files
committedMar 19, 2025
nixos/zipline: improve systemd hardening
1 parent 0deb1b2 commit ef19fcf

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed
 

‎nixos/modules/services/web-apps/zipline.nix

+11-6
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ in
107107
ExecStart = lib.getExe cfg.package;
108108

109109
# Hardening
110+
AmbientCapabilities = "";
110111
CapabilityBoundingSet = [ "" ];
111-
DeviceAllow = [ "" ];
112+
DevicePolicy = "closed";
112113
LockPersonality = true;
114+
NoNewPrivileges = true;
113115
PrivateDevices = true;
114116
PrivateTmp = true;
115117
PrivateUsers = true;
@@ -123,15 +125,18 @@ in
123125
ProtectKernelTunables = true;
124126
ProtectProc = "invisible";
125127
ProtectSystem = "strict";
126-
RestrictAddressFamilies = [
127-
"AF_INET"
128-
"AF_INET6"
129-
"AF_UNIX"
130-
];
128+
RemoveIPC = true;
129+
RestrictAddressFamilies = [ "AF_INET AF_INET6 AF_UNIX AF_NETLINK" ];
131130
RestrictNamespaces = true;
132131
RestrictRealtime = true;
133132
RestrictSUIDSGID = true;
134133
SystemCallArchitectures = "native";
134+
SystemCallFilter = [
135+
"@system-service"
136+
"~@privileged"
137+
"~@resources"
138+
];
139+
UMask = "0077";
135140
};
136141
};
137142
};

0 commit comments

Comments
 (0)
Failed to load comments.