SV-268097r1130996_rule
V-268097
SRG-OS-000042-GPOS-00020
ANIX-00-000300
CAT II
10
Configure NixOS to generate audit records when successful/unsuccessful attempts to modify the cron configuration occur.
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/cron/tabs/ -p wa -k services"
"-w /var/cron/cron.allow -p wa -k services"
"-w /var/cron/cron.deny -p wa -k services"
];
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS generates an audit record when successful/unsuccessful attempts to modify the cron configuration.
Check the auditing rules currently loaded into the audit daemon with the following command:
$ sudo auditctl -l | grep -w cron
-w /var/cron/tabs/ -p wa -k services
-w /var/cron/cron.allow -p wa -k services
-w /var/cron/cron.deny -p wa -k services
If the command does not return the example output, this is a finding.
Note: The "-k" allows for specifying an arbitrary identifier. The string following "-k" does not need to match the example output above.
V-268097
False
ANIX-00-000300
Verify NixOS generates an audit record when successful/unsuccessful attempts to modify the cron configuration.
Check the auditing rules currently loaded into the audit daemon with the following command:
$ sudo auditctl -l | grep -w cron
-w /var/cron/tabs/ -p wa -k services
-w /var/cron/cron.allow -p wa -k services
-w /var/cron/cron.deny -p wa -k services
If the command does not return the example output, this is a finding.
Note: The "-k" allows for specifying an arbitrary identifier. The string following "-k" does not need to match the example output above.
M
5658