Ensure auditd Collects Information on Kernel Module Loading and Unloading
An XCCDF Rule
Description
To capture kernel module loading and unloading events, use following lines, setting ARCH to either b32 for 32-bit system, or having two lines for both b32 and b64 in case your system is 64-bit:
-a always,exit -F arch=ARCH -S init_module,finit_module,delete_module -F key=modulesThe place to add the lines depends on a way
auditd
daemon is configured. If it is configured
to use the augenrules
program (the default), add the lines to a file with suffix
.rules
in the directory /etc/audit/rules.d
.
If the auditd
daemon is configured to use the auditctl
utility,
add the lines to file /etc/audit/audit.rules
.
Rationale
The addition/removal of kernel modules can be used to alter the behavior of the kernel and potentially introduce malicious code into kernel space. It is important to have an audit trail of modules that have been introduced into the kernel.
- ID
- xccdf_org.ssgproject.content_rule_audit_rules_kernel_module_loading
- Severity
- Medium
- References
- Updated