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

28 lines
754 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 = [
""
];
NoNewPrivileges = true;
RestrictNamespaces = "pid";
ProtectControlGroups = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
MemoryDenyWriteExecute = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
LockPersonality = true;
ProtectHostname=true;
ProtectSystem=true;
PrivateUsers=true;
PrivateNetwork=true;
RestrictRealtime=true;
IPAddressAllow=[];
RestrictAddressFamilies="AF_NETLINK AF_UNIX";
};
};
}