UCF STIG Viewer Logo

The audit system must be configured to audit the loading and unloading of dynamic kernel modules.


Overview

Finding ID Version Rule ID IA Controls Severity
V-208910 OL6-00-000202 SV-208910r810473_rule Medium
Description
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. The system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary, since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.
STIG Date
Oracle Linux 6 Security Technical Implementation Guide 2021-12-03

Details

Check Text ( C-9163r810472_chk )
To determine if the system is configured to audit execution of module management programs, run the following commands:

sudo egrep -e "(-w |-F path=)/sbin/insmod|(-w |-F path=)/sbin/rmmod|(-w |-F path=)/sbin/modprobe" /etc/audit/audit.rules

-w /sbin/insmod -p x -k modules
-w /sbin/rmmod -p x -k modules
-w /sbin/modprobe -p x -k modules

If "/sbin/insmod" is not being audited, this is a finding.

If "/sbin/rmmod" is not being audited, this is a finding.

If "/sbin/modprobe" is not being audited, this is a finding.

To determine if the system is configured to audit calls to the "init_module", "finit_module", and "delete_module" system calls, run the following command:

$ sudo egrep "init_module|delete_module" /etc/audit/audit.rules

-a always,exit -F arch=b32 -S init_module,finit_module,delete_module -k modules
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -k modules

If the system is 64-bit and does not return rules for both "b32" and "b64" architectures, this is a finding.

If the system is not configured to audit "init_module", this is a finding.
If the system is not configured to audit "finit_module", this is a finding.
If the system is not configured to audit "delete_module", this is a finding.

If no line is returned, this is a finding.
Fix Text (F-9163r809124_fix)
Add the following to "/etc/audit/audit.rules" in order to capture kernel module loading and unloading events:

-w /sbin/insmod -p x -k modules
-w /sbin/rmmod -p x -k modules
-w /sbin/modprobe -p x -k modules
-a always,exit -F arch=b32 -S init_module,finit_module,delete_module -k modules

If the system is 64-bit, then also add the following:

-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -k modules