tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/nebula: harden systemd unit
Morgan Jones
3 years ago
e99f342f
9d649fd7
+22
-1
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
networking
nebula.nix
+22
-1
nixos/modules/services/networking/nebula.nix
···
204
204
Type = "simple";
205
205
Restart = "always";
206
206
ExecStart = "${netCfg.package}/bin/nebula -config ${configFile}";
207
207
+
UMask = "0027";
207
208
CapabilityBoundingSet = "CAP_NET_ADMIN";
208
209
AmbientCapabilities = "CAP_NET_ADMIN";
210
210
+
LockPersonality = true;
211
211
+
NoNewPrivileges = true;
212
212
+
PrivateDevices = false; # needs access to /dev/net/tun (below)
213
213
+
DeviceAllow = "/dev/net/tun rw";
214
214
+
DevicePolicy = "closed";
215
215
+
PrivateTmp = true;
216
216
+
PrivateUsers = false; # CapabilityBoundingSet needs to apply to the host namespace
217
217
+
ProtectClock = true;
218
218
+
ProtectControlGroups = true;
219
219
+
ProtectHome = true;
220
220
+
ProtectHostname = true;
221
221
+
ProtectKernelLogs = true;
222
222
+
ProtectKernelModules = true;
223
223
+
ProtectKernelTunables = true;
224
224
+
ProtectProc = "invisible";
225
225
+
ProtectSystem = "strict";
226
226
+
RestrictNamespaces = true;
227
227
+
RestrictSUIDSGID = true;
209
228
User = networkId;
210
229
Group = networkId;
211
230
};
···
227
246
};
228
247
}) enabledNetworks);
229
248
230
230
-
users.groups = mkMerge (mapAttrsToList (netName: netCfg: { ${nameToId netName} = {}; }) enabledNetworks);
249
249
+
users.groups = mkMerge (mapAttrsToList (netName: netCfg: {
250
250
+
${nameToId netName} = {};
251
251
+
}) enabledNetworks);
231
252
};
232
253
}