SV-268164r1131133_rule
V-268164
SRG-OS-000466-GPOS-00210
ANIX-00-001730
CAT II
10
Configure NixOS to record attempts to delete privileges.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
security.audit.rules = [
"-a always,exit -F path=/run/current-system/sw/bin/usermod -F perm=x -F auid>=1000 -F auid!=unset -k privileged-usermod"
];
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS generates audit records when attempts to delete privileges occur with the following command:
$ sudo auditctl -l | grep usermod
-a always,exit -S all -F path=/run/current-system/sw/bin/usermod -F perm=x -F auid>=1000 -F auid!=-1 -k privileged-usermod
If the command does not return an audit rule for "usermod", this is a finding.
V-268164
False
ANIX-00-001730
Verify NixOS generates audit records when attempts to delete privileges occur with the following command:
$ sudo auditctl -l | grep usermod
-a always,exit -S all -F path=/run/current-system/sw/bin/usermod -F perm=x -F auid>=1000 -F auid!=-1 -k privileged-usermod
If the command does not return an audit rule for "usermod", this is a finding.
M
5658