Disable IPv6 Networking Support Automatic Loading
An XCCDF Rule
Description
To prevent the IPv6 kernel module (ipv6
) from binding to the
IPv6 networking stack, add the following line to
/etc/modprobe.d/disabled.conf
(or another file in
/etc/modprobe.d
):
options ipv6 disable=1This permits the IPv6 module to be loaded (and thus satisfy other modules that depend on it), while disabling support for the IPv6 protocol.
Rationale
Any unnecessary network stacks - including IPv6 - should be disabled, to reduce the vulnerability to exploitation.
- ID
- xccdf_org.ssgproject.content_rule_kernel_module_ipv6_option_disabled
- Severity
- Medium
- References
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
# Prevent the IPv6 kernel module (ipv6) from loading the IPv6 networking stack
echo "options ipv6 disable=1" > /etc/modprobe.d/ipv6.conf
Remediation - Ansible
- name: Disable IPv6 Networking kernel module
lineinfile:
create: true
dest: /etc/modprobe.d/ipv6.conf
regexp: ^options\s+ipv6\s+disable=\d
line: options ipv6 disable=1