Product SiteDocumentation Site

1.2. Host Network Security

All of these settings should be placed in your /etc/sysctl.conf. Once the file is editied please run sysctl -p to enable those settings.
Required Config Lines
CompleteRequirementActionService/Config
ShouldSetnet.ipv4.ip_forward = 0[1]
ShouldSetnet.ipv4.conf.all.send_redirects = 0[2]
ShouldSetnet.ipv4.conf.default.send_redirects = 0[3]
MustSetnet.ipv4.conf.all.accept_redirects = 0[4]
MustSetnet.ipv4.icmp_echo_ignore_broadcasts = 1[5]
MustSetnet.ipv4.icmp_ignore_bogus_error_responses = 1[6]
MustSetnet.ipv4.tcp_syncookies = 1[7]
MustSetnet.ipv4.conf.all.log_martians = 1[8]
MustSetnet.ipv4.conf.default.log_martians = 1[9]
MustSetnet.ipv4.conf.all.accept_source_route = 0[10]
MustSetnet.ipv4.conf.default.accept_source_route = 0[11]
MustSetnet.ipv4.conf.all.rp_filter = 1[12]
MustSetnet.ipv4.conf.default.rp_filter = 1[13]
MustSetnet.ipv4.conf.all.accept_redirects = 0[14]
MustSetnet.ipv4.conf.default.accept_redirects = 0[15]
MustSetnet.ipv4.conf.all.secure_redirects = 0[16]
MustSetnet.ipv4.conf.default.secure_redirects = 0[17]

1.2.1. IPTables Configuration

IPTables edits can be made directly to /etc/sysconfig/iptables. To enable these rules restart iptables with service iptables restart
Required Config Lines
CompleteRequirementActionConfig
MustSet*filter :INPUT DROP [] :FORWARD ACCEPT [] :OUTPUT ACCEPT [][18]
ShouldSet-A INPUT -p icmp -j ACCEPT[19]
ShouldSet-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT[20]
ShouldUse-A INPUT -p tcp -m tcp --dport $PORT -j ACCEPT[21]
ShouldUse-A INPUT -p udp -m udp --dport $PORT -j ACCEPT[22]
ShouldUse-A INPUT -p tcp -m tcp -s $IPADDRES/$NETMASK --dport $PORT -j ACCEPT[23]
ShouldUse-A INPUT -p udp -m udp $IPADDRES/$NETMASK --dport $PORT -j ACCEPT[24]
MustSet-A INPUT -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j REJECT[25]
MustSet-A INPUT -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j REJECT[26]
MustSet-A INPUT -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j REJECT[27]
MustSet-A INPUT -p tcp --tcp-flags FIN,SYN FIN,SYN -j REJECT[28]
MustSet-A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j REJECT[29]
MustSet-A INPUT -p tcp --tcp-flags FIN,RST FIN,RST -j REJECT[30]
MustSet-A INPUT -p tcp --tcp-flags FIN,ACK FIN -j REJECT[31]
MustSet-A INPUT -p tcp --tcp-flags PSH,ACK PSH -j REJECT[32]
MustSet-A INPUT -p tcp --tcp-flags ACK,URG URG -j REJECT[33]
Should notUse-j DROP[34]
ShouldSet-A INPUT -j LOG --log-prefix "FW-REJECT "[35]
MustSet-A INPUT -j REJECT --reject-with icmp-host-prohibited[36]


[1] Unless this host serves as a network device. Do not pass traffic between networks

[2] Unless this host serves as a network device. Do not act like a network device.

[3] Unless this host serves as a network device. Do not act like a network device.

[4] Don't allow outsiders to alter routing tables.

[5] Prevents joining a smurf attack

[6] Protection from bad icmp error messages

[7] enables syncookies for protection against syn flood attacks

[8] Log spoofed, source routed and redirect packets

[9] Log spoofed, source routed and redirect packets

[10] Don't allow source routed packets

[11] Don't allow source routed packets

[12] Enable reverse path filtering

[13] Enable reverse path filtering

[14] Don't allow outsiders to alter routing tables.

[15] Don't allow outsiders to alter routing tables.

[16] Don't allow outsiders to alter routing tables.

[17] Don't allow outsiders to alter routing tables.

[18] First 4 lines

[19] Disable for more security but more difficult network troubleshooting.

[20] Disabling will break many network protocols, like tcp. Disable only if you know what you are doing.

[21] To open specific tcp ports to the world. The example above should replace $PORT with a tcp port number, like 80 for http.

[22] To open udp ports to the world. The example above should replace $PORT with a tcp port number, like 161 for snmp.

[23] To open tcp ports to specific hosts or networks. Using just IP address without a netmask is proper. If a network address is defined, netmask is required. The example above should replace $PORT with a tcp port number, like 80 for http.

[24] To open udp ports to specific hosts or networks. Using just IP address without a netmask is proper. If a network address is defined, netmask is required. The example above should replace $PORT with a tcp port number, like 161 for snmp.

[25] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[26] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[27] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[28] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[29] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[30] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[31] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[32] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[33] This combination of these TCP flags is not defined. By accepting packets from them, the results may be unexpected.

[34] This flag goes against some known standards and makes troubleshooting more difficult. The security added is debatable.

[35] Before last line

[36] As last line