SV-268166r1131137_rule
V-268166
SRG-OS-000473-GPOS-00218
ANIX-00-001790
CAT II
10
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 /var/log/lastlog -p wa -k logins"
];
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS is configured to generate audit records with the following command:
$ sudo auditctl -l | grep -w lastlog
-w /var/log/lastlog -p wa -k logins
If the command does not return a watch for the lastlog file, this is a finding.
V-268166
False
ANIX-00-001790
Verify NixOS is configured to generate audit records with the following command:
$ sudo auditctl -l | grep -w lastlog
-w /var/log/lastlog -p wa -k logins
If the command does not return a watch for the lastlog file, this is a finding.
M
5658