git clone https://github.com/fail2ban/fail2ban.git
cd fail2ban
sudo python setup.py install
cp files/debian-initd /etc/init.d/fail2ban
update-rc.d fail2ban defaults
vi /etc/fail2ban/jail.local
[asterisk]
enabled = true
port = 5060,5061
action_ = %(default/action_)s[name=%(__name__)s-tcp, protocol=”tcp”]
%(default/action_)s[name=%(__name__)s-udp, protocol=”udp”]
logpath = /var/log/asterisk/security_log
maxretry = 10
確認
fail2ban-client status [Jail名]
fail2ban-client status asterisk
fail2ban-client status
コメント