3.3.1.8 Ensure net.ipv4.conf.all.accept_redirects is configured

Information

ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables.

net.ipv4.conf.all.accept_redirects controls accepting of all IPv4 ICMP redirected packets on all interfaces.

More information about the kernel parameter configuration files, their location, and load preference is available in the "Configure Network Kernel Parameters" section overview.

ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables.

By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any IPv4 ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables.

Solution

- Run the following command to comment out net.ipv4.conf.all.accept_redirects lines returned by the audit procedure that are not net.ipv4.conf.all.accept_redirects = 0 :

# sed -ri '^\s*net.ipv4.conf.all.accept_redirects\s*=\s*1/s/^/#/g' "path/to/file/in/audit/filename"

Example:

# sed -ri '/^\s*net.ipv4.conf.all.accept_redirects\s*=\s*1/s/^/#/g' /etc/sysctl.d/99-sysctl.conf
- Create or edit a file in the /etc/sysctl.d/ directory ending in .conf and edit or add the following line:

net.ipv4.conf.all.accept_redirects = 0

Example:

# [ ! -d "/etc/sysctl.d/" ] && mkdir -p /etc/sysctl.d/
# printf '%s\n' "" "net.ipv4.conf.all.accept_redirects = 0" >> /etc/sysctl.d/60-ipv4_sysctl.conf
- Run the following command to load all sysctl configuration files:

# sysctl --system

See Also

https://workbench.cisecurity.org/benchmarks/25279

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b., CCI|CCI-000366, CSCv7|9.2, Rule-ID|SV-235018r991589_rule, Rule-ID|SV-244553r1017353_rule, Rule-ID|SV-248887r991589_rule, Rule-ID|SV-257958r991589_rule, Rule-ID|SV-269244r1050126_rule, Rule-ID|SV-271864r1092304_rule

Plugin: Unix

Control ID: 13dba7d902a4d5f6de820fc4b65819875da7a3a3a7771b49bc3c1177db1da9ee