I'm trying to make a very secure iptables configuration. I had some problems with an old configuration. Specifically I used to block a lot more of ICMP and allow a few specific ICMP types, but this seemed to cause periodic DNS issues.
This one appears to work (mostly). I can traceroute the server just fine. I'm testing this all in a virtual machine first. It has to pass PCI Compliance.
*filter
:INPUT DROP [5:735]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 13 -j DROP
-A INPUT -p icmp -m icmp --icmp-type 14 -j DROP
-A INPUT -p udp -m udp --dport 33200:33500 -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 33200:33500 -j ACCEPT
COMMIT
Is there any problems with the above configuration?
I'm using CentOS 5.6. Also what is the best way to prevent brute-force attacks on the SSH port? (I'll be changing ssh to a random port)