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

24 lines
756 B
Nix
Raw Normal View History

2025-01-05 23:03:11 +01:00
{ lib, config, ... }:
{
config.systemd.services = lib.mkIf (config.specialisation != { }) {
auditd.serviceConfig = {
# CapabilityBoundingSet = [ "CAP_AUDIT_*" "CAP_SYSLOG" "CAP_SYS_NICE" "CAP_SYS_PACCT" "CAP_SYS_PTRACE" ];
NoNewPrivileges = true;
RestrictNamespaces = "pid";
ProtectControlGroups = true;
ProtectKernelModules = true;
MemoryDenyWriteExecute = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
LockPersonality = true;
2025-01-07 11:31:43 +01:00
ProtectSystem = true;
2025-01-05 23:03:11 +01:00
# PrivateUsers=true;
# PrivateNetwork=true;
2025-01-07 11:31:43 +01:00
RestrictRealtime = true;
IPAddressAllow = [ ];
RestrictAddressFamilies = "AF_NETLINK";
2025-01-05 23:03:11 +01:00
};
};
}