Quote:
|
Originally Posted by GiLuX
im running a simple web and mail server on fc3.
right now i'm allowing all icmp traffic to pass through iptables but i wondered what icmp traffic i might block to fine tune the firewall some more.
for this server to peform its duty properly, what icmp traffic should be accepted at least and what can safely be dropped at most?
i'm not to familiar with icmp so any advice and or examples would be welcome.
|
I'm delighted to find your truly relevant question here. Most people forget ICMP, and this protocol is actually the most valuable probing facility for any intelligent hardcore hacker.
"ping" & "traceroute" is still enabled in the scenario below, and that should be disabled in yr case too when running active servicesfor the outside world. Here you see me using "accept" as default, while each chain ends always with some final DROP statement. Just a question of style/personal preference. This way, yr connections dont get reset when bringing it up&down while yr online....
This here works well in prctice for me, and im proceeding to close it even more later.
Change the rate limits to fit for YOUR case, OK !
To tighten that ICMP part up, I suggest as a first practicable quick fix / guideline :
:VDIT-Firewall-ICMP-IN - [0:0]
:VDIT-Firewall-ICMP-OUT - [0:0]
-A OUTPUT -p icmp -j VDIT-Firewall-ICMP-OUT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 8 -j DROP
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/0 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/1 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/2 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/3 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/5 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/6 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/7 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/9 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/10 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/11 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/12 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 3/13 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 11/0 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 11/1 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 12/0 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -m icmp --icmp-type 12/1 -j ACCEPT
-A VDIT-Firewall-ICMP-IN -p icmp -j DROP
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/0 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/1 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/2 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/3 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 3/11 -m limit --limit 1/sec -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 12/0 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -m icmp --icmp-type 12/1 -j ACCEPT
-A VDIT-Firewall-ICMP-OUT -p icmp -j DROP
-A VDIT-Firewall-INPUT -p icmp -j VDIT-Firewall-ICMP-IN
Kind Regards,
Frank