Ensure auditd Collects Information on Kernel Module Loading and Unloading - finit_module
An XCCDF Rule
Description
If the auditd
daemon is configured to use the augenrules
program
to read audit rules during daemon startup (the default), add the following lines to a file
with suffix .rules
in the directory /etc/audit/rules.d
to capture kernel module
loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S finit_module -F key=modulesIf the
auditd
daemon is configured to use the auditctl
utility to read audit
rules during daemon startup, add the following lines to /etc/audit/audit.rules
file
in order to capture kernel module loading and unloading events, setting ARCH to either b32 or
b64 as appropriate for your system:
-a always,exit -F arch=ARCH -S finit_module -F key=modules
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_finit
- Severity
- Medium
- References
- Updated
Remediation - Kubernetes Patch
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition: