grimm-nixos-laptop/hardening/systemd/cups.nix

30 lines
858 B
Nix
Raw Normal View History

2025-01-05 23:03:11 +01:00
{ lib, config, ... }:
{
config.systemd.services = lib.mkIf (config.specialisation != { }) {
cups.serviceConfig = {
2025-01-07 11:31:43 +01:00
CapabilityBoundingSet = [
"CAP_LEASE CAP_MKNOD CAP_SYS_RAWIO CAP_SYS_RESOURCE CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SETUID CAP_SETGID"
];
2025-01-05 23:03:11 +01:00
NoNewPrivileges = true;
RestrictNamespaces = "pid";
2025-01-07 11:31:43 +01:00
2025-01-05 23:03:11 +01:00
ProtectControlGroups = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
MemoryDenyWriteExecute = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
LockPersonality = true;
2025-01-07 11:31:43 +01:00
RestrictRealtime = true;
ProtectProc = "invisible";
2025-01-05 23:03:11 +01:00
# PrivateUsers=true;
2025-01-07 11:31:43 +01:00
PrivateNetwork = true;
RestrictAddressFamilies = "AF_UNIX";
2025-01-05 23:03:11 +01:00
# ProtectSystem=true;
};
};
}