Skip to content

Disable Kernel cfg80211 Module

An XCCDF Rule

Description

To configure the system to prevent the cfg80211 kernel module from being loaded, add the following line to the file /etc/modprobe.d/cfg80211.conf:
install cfg80211 /bin/false

Rationale

If Wireless functionality must be disabled, preventing the kernel from loading the kernel module provides an additional safeguard against its activation.

ID
xccdf_org.ssgproject.content_rule_kernel_module_cfg80211_disabled
Severity
Medium
References
Updated

Remediation Templates

A Kubernetes Patch

apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
  config:
    ignition:
      version: 3.1.0

An Ansible Snippet

- name: Ensure kernel module 'cfg80211' is disabled
  lineinfile:
    create: true
    dest: /etc/modprobe.d/cfg80211.conf
    regexp: install\s+cfg80211
    line: install cfg80211 /bin/false

A Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
if LC_ALL=C grep -q -m 1 "^install cfg80211" /etc/modprobe.d/cfg80211.conf ; then
	
	sed -i 's#^install cfg80211.*#install cfg80211 /bin/false#g' /etc/modprobe.d/cfg80211.conf
else