Disable IPv6 Addressing on All IPv6 Interfaces
An XCCDF Rule
Description
To disable support for (ipv6
) addressing on all interface add the following line to
/etc/sysctl.d/ipv6.conf
(or another file in /etc/sysctl.d
):
net.ipv6.conf.all.disable_ipv6 = 1This disables IPv6 on all network interfaces as other services and system functionality require the IPv6 stack loaded to work.
Rationale
Any unnecessary network stacks - including IPv6 - should be disabled, to reduce the vulnerability to exploitation.
- ID
- xccdf_org.ssgproject.content_rule_sysctl_net_ipv6_conf_all_disable_ipv6
- Severity
- Medium
- References
- Updated
Remediation Templates
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- NIST-800-171-3.1.20
- NIST-800-53-CM-6(a)
A Shell Script
# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}
' 'kernel' 2>/dev/null | grep -q installed; then
# Comment out any occurrences of net.ipv6.conf.all.disable_ipv6 from /etc/sysctl.d/*.conf files
for f in /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf; do