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

27 lines
739 B
Nix
Raw Normal View History

2025-01-05 23:03:11 +01:00
{ lib, config, ... }:
{
config.systemd.services = lib.mkIf (config.specialisation != { }) {
acpid.serviceConfig = {
CapabilityBoundingSet = [
2025-01-07 11:31:43 +01:00
""
];
2025-01-05 23:03:11 +01:00
NoNewPrivileges = true;
RestrictNamespaces = "pid";
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
ProtectSystem = true;
PrivateUsers = true;
PrivateNetwork = true;
RestrictRealtime = true;
IPAddressAllow = [ ];
RestrictAddressFamilies = "AF_NETLINK AF_UNIX";
2025-01-05 23:03:11 +01:00
};
};
}