| name | cis-ubuntu1604-v200-3-1-1 |
| description | Disable IPv6 |
| category | cis-networking |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-16.04","networking"] |
| cis_id | 3.1.1 |
| cis_benchmark | CIS Ubuntu Linux 16.04 LTS Benchmark v2.0.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
CIS Ubuntu Linux 16.04 LTS Benchmark v2.0.0 - Control 3.1.1
Description
Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented.
Rationale
If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system.
Impact
If IPv6 is disabled through sysctl config, SSH X11forwarding may no longer function as expected. We recommend that SSH X11fowarding be disabled, but if required, the following will allow for SSH X11forwarding with IPv6 disabled through sysctl config:
Add the following line the /etc/ssh/sshd_config file:
AddressFamily inet
Run the following command to re-start the openSSH server:
systemctl restart sshd
Audit Procedure
Command Line
Run one of the following commands to verify IPv6 is disabled:
IF IPv6 is disabled through grub:
Run the following command:
grep "^\s*linux" /boot/grub/grub.cfg | grep -v "ipv6.disable=1"
No lines should be returned.
OR
IF IPv6 is disabled through sysctl settings:
Run the following commands:
sysctl net.ipv6.conf.all.disable_ipv6
sysctl net.ipv6.conf.default.disable_ipv6
grep -E '^\s*net\.ipv6\.conf\.(all|default)\.disable_ipv6\s*=\s*1\b(\s+#.*)?$' /etc/sysctl.conf /etc/sysctl.d/*.conf | cut -d: -f2
Expected Result
For grub method: no lines should be returned.
For sysctl method:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
And the grep should return:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Remediation
Command Line
Use one of the two following methods to disable IPv6 on the system:
To disable IPv6 through the GRUB2 config:
Edit /etc/default/grub and add to the parameters: