LoFP LoFP / there is usually no reason to remove modules, but some buggy modules require it. these can be exempted by username. note that some linux distributions are not built to support the removal of modules at all.

Techniques

Sample rules

Kernel Module Removal

Description

Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. This rule identifies attempts to remove a kernel module.

Detection logic

process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and (
  process.name == "rmmod" or
  (process.name == "modprobe" and process.args in ("--remove", "-r"))
) and process.parent.name in ("sudo", "bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")