# Generated by iptables-save v1.6.0 on Sun May 5 09:35:53 2019 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] # Allow internal traffic on the loopback device -A INPUT -i lo -j ACCEPT # Continue connections that are already established or related to an established connection -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT # Drop non-conforming packets, such as malformed headers, etc. -A INPUT -m conntrack --ctstate INVALID -j DROP # Accept SSH -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT # Chain for preventing ping flooding - up to 6 pings per second from a single # source, again with log limiting. Also prevents us from ICMP REPLY flooding # some victim when replying to ICMP ECHO from a spoofed source. -N ICMPFLOOD -A ICMPFLOOD -m recent --name ICMP --set --rsource -A ICMPFLOOD -m recent --name ICMP --update --seconds 1 --hitcount 6 --rsource --rttl -m limit --limit 1/sec --limit-burst 1 -j LOG --log-prefix "iptables[ICMP-flood]: " -A ICMPFLOOD -m recent --name ICMP --update --seconds 1 --hitcount 6 --rsource --rttl -j DROP -A ICMPFLOOD -j ACCEPT # Permit useful IMCP packet types. # Note: RFC 792 states that all hosts MUST respond to ICMP ECHO requests. # Blocking these can make diagnosing of even simple faults much more tricky. # Real security lies in locking down and hardening all services, not by hiding. -A INPUT -p icmp --icmp-type 0 -m conntrack --ctstate NEW -j ACCEPT -A INPUT -p icmp --icmp-type 3 -m conntrack --ctstate NEW -j ACCEPT -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ICMPFLOOD -A INPUT -p icmp --icmp-type 11 -m conntrack --ctstate NEW -j ACCEPT # Drop all incoming malformed NULL packets -A INPUT -p tcp --tcp-flags ALL NONE -j DROP # Drop syn-flood attack packets -A INPUT -p tcp ! --syn -m conntrack --ctstate NEW -j DROP # Drop incoming malformed XMAS packets -A INPUT -p tcp --tcp-flags ALL ALL -j DROP COMMIT # Completed on Sun May 5 09:35:53 2019