Merge pull request #285833 from 360ied/murmur-hardened

nixos/murmur: systemd service hardening
This commit is contained in:
Silvan Mosberger 2024-02-10 02:48:46 +01:00 committed by GitHub
commit 5de4385620
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -326,6 +326,29 @@ in
RuntimeDirectoryMode = "0700"; RuntimeDirectoryMode = "0700";
User = "murmur"; User = "murmur";
Group = "murmur"; Group = "murmur";
# service hardening
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
CapabilityBoundingSet = "CAP_NET_BIND_SERVICE";
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateTmp = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectSystem = "full";
RestrictAddressFamilies = "~AF_PACKET AF_NETLINK";
RestrictNamespaces = true;
RestrictSUIDSGID = true;
RestrictRealtime = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
}; };
}; };