NixOS must generate audit records when successful/unsuccessful attempts to delete privileges occur.

Severity
Group ID
Group Title
Version
Rule ID
Date
STIG Version
mediumV-268164SRG-OS-000466-GPOS-00210ANIX-00-001730SV-268164r1039380_rule2024-10-251
Description
Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. Audit records can be generated from various components within the information system (e.g., module or policy filter).
ℹ️ Check
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.
✔️ Fix
Configure /etc/nixos/configuration.nix to record attempts to delete privileges by adding the following configuration settings: 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 the system with the following command: $ sudo nixos-rebuild switch