This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
networking:firewall:arno_s_firewall [2011/11/01 13:09] 127.0.0.1 external edit |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Arno's Firewall ====== | ||
- | http:// | ||
- | |||
- | ===== Install ===== | ||
- | |||
- | Verify current network setup: | ||
- | |||
- | < | ||
- | ifconfig # | ||
- | route -n # | ||
- | iptables -nL |grep ACCEPT # | ||
- | iptables -t nat -n -L # | ||
- | </ | ||
- | |||
- | Additional for CentOS minimal installations: | ||
- | |||
- | < | ||
- | yum install wget which bind-utils | ||
- | </ | ||
- | Install: | ||
- | < | ||
- | wget http:// | ||
- | |||
- | tar -xzvf arno-iptables-firewall< | ||
- | cd arno-iptables-firewall< | ||
- | ./ | ||
- | </ | ||
- | |||
- | The install script calls the configure script at the end: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | service arno-iptables-firewall start | ||
- | </ | ||
- | |||
- | ===== Configure ===== | ||
- | |||
- | Startup verbosity: | ||
- | |||
- | < | ||
- | vim / | ||
- | </ | ||
- | |||
- | Firewall: | ||
- | |||
- | < | ||
- | vim / | ||
- | |||
- | # open from anywhere | ||
- | OPEN_TCP=" | ||
- | # limited by source address | ||
- | HOST_OPEN_TCP=" | ||
- | |||
- | service arno-iptables-firewall restart | ||
- | |||
- | iptables -nL | grep ACCEPT | ||
- | </ | ||
- | |||
- | ===== Logging ===== | ||
- | |||
- | Logging defaults to / | ||
- | |||
- | Edit / | ||
- | |||
- | < | ||
- | FIREWALL_LOG="/ | ||
- | LOGLEVEL=" | ||
- | |||
- | cat << EOF >> / | ||
- | / | ||
- | rotate 4 | ||
- | weekly | ||
- | compress | ||
- | notifempty | ||
- | create 0600 root root | ||
- | delaycompress | ||
- | create | ||
- | } | ||
- | EOF | ||
- | |||
- | cat << EOF >> / | ||
- | |||
- | # Log all iptables messages to / | ||
- | kern.=debug | ||
- | EOF | ||
- | |||
- | kill -HUP $(pidof syslogd) | ||
- | |||
- | service arno-iptables-firewall check-conf | ||
- | service arno-iptables-firewall restart | ||
- | </ | ||
- | |||
- | ===== Auto Startup ===== | ||
- | |||
- | < | ||
- | chkconfig arno-iptables-firewall on | ||
- | chkconfig iptables off | ||
- | chkconfig ip6tables off | ||
- | </ | ||
- | |||
- | ===== Port Check ===== | ||
- | |||
- | < | ||
- | iptables -nL | grep 2222 | ||
- | iptables -nL|grep ACCEPT | ||
- | </ | ||
- | |||
- | ===== Restart ===== | ||
- | |||
- | < | ||
- | service iptables stop | ||
- | service ip6tables stop | ||
- | service arno-iptables-firewall restart | ||
- | </ | ||
- | |||
- | ===== Adaptive Ban Plugin ===== | ||
- | |||
- | If you have not restarted the firewall (and then upgraded, following the | ||
- | prompt) via the web interface, please do... or " | ||
- | from the CLI. Of course, any changes to the plugins requires a restart of the | ||
- | firewall to take effect. | ||
- | |||
- | The new Adaptive Ban plugin uses the same technique as fail2ban ( | ||
- | http:// | ||
- | |||
- | While this technique is proven, our implementation as a plugin to the Arno | ||
- | Firewall is new, so users are encouraged to give it a try. Please report any | ||
- | problems... and successes :-) | ||
- | |||
- | To show we eat our own cooking, below is my Adaptive Ban plugin setting on my | ||
- | production boxes. | ||
- | |||
- | Lonnie | ||
- | |||
- | < | ||
- | --- snip --- | ||
- | |||
- | # ------------------------------------------------------------------------------ | ||
- | # -= Arno's iptables firewall - Adaptive Ban plugin =- | ||
- | # ------------------------------------------------------------------------------ | ||
- | |||
- | # To actually enable this plugin make ENABLED=1: | ||
- | # ------------------------------------------------------------------------------ | ||
- | ENABLED=1 | ||
- | |||
- | # Log file where failed access attempts are derived | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_FILE="/ | ||
- | |||
- | # The time in seconds between each iteration of analyzing the log file | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_TIME=90 | ||
- | |||
- | # The number of log failures to ban host | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_COUNT=6 | ||
- | |||
- | # A list of analysis types that are applied | ||
- | # Choose from: sshd asterisk mini_httpd | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_TYPES=" | ||
- | |||
- | # By default, inbound packets from banned IP addresses will be silently DROP' | ||
- | # As an option, the packets can be REJECT' | ||
- | # Define ADAPTIVE_BAN_REJECT=1 for an ICMP error message to be returned | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_REJECT=1 | ||
- | |||
- | # Bt default, INTERNAL (LAN) networks will be whitelisted against banning | ||
- | # As an option, this automatic whitelisting can be disabled | ||
- | # Define ADAPTIVE_BAN_WHITELIST_INTERNAL=0 to disable INTERNAL whitelisting | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_WHITELIST_INTERNAL=1 | ||
- | |||
- | # Whitelist Hosts | ||
- | # A list of IP addresses whose traffic will never be banned | ||
- | # ------------------------------------------------------------------------------ | ||
- | ADAPTIVE_BAN_WHITELIST="" | ||
- | |||
- | --- snip --- | ||
- | </ |