SV-268096r1130994_rule
V-268096
SRG-OS-000042-GPOS-00020
ANIX-00-000290
CAT II
10
Configure /etc/nixos/configuration.nix to log successful/unsuccessful attempts to use the "init_module", "finit_module", and "delete_module" system calls.
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 arch=b32 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=unset -k module_chng"
"-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=unset -k module_chng"
];
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS generates an audit record upon successful/unsuccessful attempts to use the "init_module", "finit_module", and "delete_module" system calls.
Check the auditing rules currently loaded into the audit daemon with the following command:
$ sudo auditctl -l | grep -w init_module
-a always,exit -F arch=b32 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=-1 -k module_chng
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=-1 -k module_chng
If the command does not return an audit rule for "init_module", "finit_module", and "delete_module", 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-268096
False
ANIX-00-000290
Verify NixOS generates an audit record upon successful/unsuccessful attempts to use the "init_module", "finit_module", and "delete_module" system calls.
Check the auditing rules currently loaded into the audit daemon with the following command:
$ sudo auditctl -l | grep -w init_module
-a always,exit -F arch=b32 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=-1 -k module_chng
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -F auid>=1000 -F auid!=-1 -k module_chng
If the command does not return an audit rule for "init_module", "finit_module", and "delete_module", 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