STIGUI
V-268167CAT II — Medium severitySV-268167r1131139_rule

NixOS must generate audit records for all account creations, modifications, disabling, and termination events.

Rule version ANIX-00-001820 · STIG v1 · 2025-08-19

Discussion

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).

Satisfies: SRG-OS-000476-GPOS-00221, SRG-OS-000042-GPOS-00020, SRG-OS-000274-GPOS-00104, SRG-OS-000275-GPOS-00105, SRG-OS-000276-GPOS-00106, SRG-OS-000277-GPOS-00107, SRG-OS-000477-GPOS-00222, SRG-OS-000304-GPOS-00121

Check

Verify NixOS is configured to generate audit records on account events with the following command:

$ sudo auditctl -l | grep /etc

-w /etc/sudoers -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/group -p wa -k identity -w /etc/security/opasswd -p wa -k identity

If the output from the command does not include the example output, this is a finding.

Fix

Configure NixOS to generate audit logs on account creations and modifications.

Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:

security.audit.rules = [ "-w /etc/sudoers -p wa -k identity" "-w /etc/passwd -p wa -k identity" "-w /etc/shadow -p wa -k identity" "-w /etc/gshadow -p wa -k identity" "-w /etc/group -p wa -k identity" "-w /etc/security/opasswd -p wa -k identity" ];

Rebuild and switch to the new NixOS configuration: $ sudo nixos-rebuild switch

Identifiers

Group ID
V-268167
Group title
SRG-OS-000476-GPOS-00221
Rule ID
SV-268167r1131139_rule
Check ID
C-72091r1039387_chk
Fix ID
F-71994r1131138_fix