]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/system/firewall
Revert "firewall: always allow outgoing DNS traffic to root servers"
[people/pmueller/ipfire-2.x.git] / src / initscripts / system / firewall
index 9a79cb1aa98e8ae814ca1f1217ce1b0097adea98..ec396c708c8e6b03396b0033ce2649fb61dec09b 100644 (file)
@@ -34,20 +34,20 @@ iptables_init() {
 
        # Empty LOG_DROP and LOG_REJECT chains
        iptables -N LOG_DROP
-       iptables -A LOG_DROP   -m limit --limit 10/minute -j LOG
+       iptables -A LOG_DROP   -m limit --limit 10/second -j LOG
        iptables -A LOG_DROP   -j DROP
        iptables -N LOG_REJECT
-       iptables -A LOG_REJECT -m limit --limit 10/minute -j LOG
+       iptables -A LOG_REJECT -m limit --limit 10/second -j LOG
        iptables -A LOG_REJECT -j REJECT
 
        # This chain will log, then DROPs packets with certain bad combinations
        # of flags might indicate a port-scan attempt (xmas, null, etc)
        iptables -N PSCAN
        if [ "$DROPPORTSCAN" == "on" ]; then
-               iptables -A PSCAN -p tcp  -m limit --limit 10/minute -j LOG --log-prefix "DROP_TCP Scan " -m comment --comment "DROP_TCP PScan"
-               iptables -A PSCAN -p udp  -m limit --limit 10/minute -j LOG --log-prefix "DROP_UDP Scan " -m comment --comment "DROP_UDP PScan"
-               iptables -A PSCAN -p icmp -m limit --limit 10/minute -j LOG --log-prefix "DROP_ICMP Scan " -m comment --comment "DROP_ICMP PScan"
-               iptables -A PSCAN -f      -m limit --limit 10/minute -j LOG --log-prefix "DROP_FRAG Scan " -m comment --comment "DROP_FRAG PScan"
+               iptables -A PSCAN -p tcp  -m limit --limit 10/second -j LOG --log-prefix "DROP_TCP Scan " -m comment --comment "DROP_TCP PScan"
+               iptables -A PSCAN -p udp  -m limit --limit 10/second -j LOG --log-prefix "DROP_UDP Scan " -m comment --comment "DROP_UDP PScan"
+               iptables -A PSCAN -p icmp -m limit --limit 10/second -j LOG --log-prefix "DROP_ICMP Scan " -m comment --comment "DROP_ICMP PScan"
+               iptables -A PSCAN -f      -m limit --limit 10/second -j LOG --log-prefix "DROP_FRAG Scan " -m comment --comment "DROP_FRAG PScan"
        fi
        iptables -A PSCAN -j DROP -m comment --comment "DROP_PScan"
 
@@ -55,7 +55,7 @@ iptables_init() {
        # that's not covered above, may just be a broken windows machine
        iptables -N NEWNOTSYN
        if [ "$DROPNEWNOTSYN" == "on" ]; then
-               iptables -A NEWNOTSYN  -m limit --limit 10/minute -j LOG  --log-prefix "DROP_NEWNOTSYN "
+               iptables -A NEWNOTSYN  -m limit --limit 10/second -j LOG  --log-prefix "DROP_NEWNOTSYN "
        fi
        iptables -A NEWNOTSYN  -j DROP -m comment --comment "DROP_NEWNOTSYN"
 
@@ -186,9 +186,12 @@ iptables_init() {
        iptables -A FORWARD -j GUARDIAN
 
        # IPS (suricata) chains
-       iptables -N IPS
-       iptables -A INPUT -j IPS
-       iptables -A FORWARD -j IPS
+       iptables -N IPS_INPUT
+       iptables -N IPS_FORWARD
+       iptables -N IPS_OUTPUT
+       iptables -A INPUT -j IPS_INPUT
+       iptables -A FORWARD -j IPS_FORWARD
+       iptables -A OUTPUT -j IPS_OUTPUT
 
        # Block non-established IPsec networks
        iptables -N IPSECBLOCK
@@ -299,9 +302,11 @@ iptables_init() {
        iptables -N OVPNINPUT
        iptables -A INPUT -j OVPNINPUT
 
-       # TOR
+       # Tor (inbound and outbound)
        iptables -N TOR_INPUT
        iptables -A INPUT -j TOR_INPUT
+       iptables -N TOR_OUTPUT
+       iptables -A OUTPUT -j TOR_OUTPUT
        
        # Jump into the actual firewall ruleset.
        iptables -N INPUTFW
@@ -365,8 +370,8 @@ iptables_init() {
        iptables -t nat -N REDNAT
        iptables -t nat -A POSTROUTING -j REDNAT
 
-       # Populate IPsec block chain
-       /usr/lib/firewall/ipsec-block
+       # Populate IPsec chains
+       /usr/lib/firewall/ipsec-policy
 
        # Apply OpenVPN firewall rules
        /usr/local/bin/openvpnctrl --firewall-rules
@@ -374,6 +379,9 @@ iptables_init() {
        # run wirelessctrl
        /usr/local/bin/wirelessctrl
 
+       # run captivectrl
+       /usr/local/bin/captivectrl
+
        # POLICY CHAIN
        iptables -N POLICYIN
        iptables -A INPUT -j POLICYIN
@@ -419,15 +427,6 @@ iptables_red_up() {
                iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i $DEVICE -j ACCEPT
        fi
 
-       # Orange pinholes
-       if [ "$ORANGE_DEV" != "" ]; then
-               # This rule enables a host on ORANGE network to connect to the outside
-               # (only if we have a red connection)
-               if [ "$IFACE" != "" ]; then
-                       iptables -A REDFORWARD -i $ORANGE_DEV -o $IFACE -j ACCEPT
-               fi
-       fi
-
        if [ "$IFACE" != "" -a -f /var/ipfire/red/active ]; then
                # DHCP
                if [ "$RED_DEV" != "" -a "$RED_TYPE" == "DHCP" ]; then
@@ -475,7 +474,7 @@ iptables_red_up() {
 
 iptables_red_down() {
        # Prohibit packets to reach the masquerading rule
-       # while the wan interface is down - this is required to
+       # while the WAN interface is down - this is required to
        # circumvent udp related NAT issues
        # http://forum.ipfire.org/index.php?topic=11127.0
        if [ -n "${IFACE}" ]; then