$iptables_base = "*filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] # disable all forwarding -A FORWARD -j REJECT --reject-with icmp-host-prohibited # trust loopback device -A INPUT -i lo -j ACCEPT # allow ICMP -A INPUT -p icmp --icmp-type any -j ACCEPT # allow IPSec -A INPUT -p 50 -j ACCEPT -A INPUT -p 51 -j ACCEPT # allow mDNS -A INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT # allow CUPS browsing -A INPUT -p udp -m udp --dport 631 -j ACCEPT -A INPUT -p tcp -m tcp --dport 631 -j ACCEPT # allow packets for established connections -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT " $iptables_final = " -A INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT " class iptables { file { "iptables" : path => "/etc/sysconfig/iptables", content => "$iptables_base$iptables_final" } service { "iptables" : enable => true } }