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

From Red Hat Enterprise Linux 6 Security Technical Implementation Guide

Part of SRG-OS-000064

Associated with: CCI-000172

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

Vulnerability discussion

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.

Check content

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" /etc/audit/audit.rules $ sudo egrep -e "(-w |-F path=)/sbin/rmmod" /etc/audit/audit.rules $ sudo egrep -e "(-w |-F path=)/sbin/modprobe" /etc/audit/audit.rules If the system is configured to audit this activity, it will return a line. To determine if the system is configured to audit calls to the "init_module" system call, run the following command: $ sudo grep -w "init_module" /etc/audit/audit.rules If the system is configured to audit this activity, it will return a line. To determine if the system is configured to audit calls to the "delete_module" system call, run the following command: $ sudo grep -w "delete_module" /etc/audit/audit.rules If the system is configured to audit this activity, it will return a line. If no line is returned for any of these commands, this is a finding.

Fix text

Add the following to "/etc/audit/audit.rules" in order to capture kernel module loading and unloading events, setting ARCH to either b32 or b64 as appropriate for your system: -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=[ARCH] -S init_module -S delete_module -k modules

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer