Title here
Summary here
本章内容中所使用的方法来自 Bogdan Moldovan.
原文链接为: https://www.axigen.com/articles/fail2ban-linux-brute-force-attack-protection_82.html .
无论是SSH TELNET 或者 WEB服务,只要端口暴露在Internet上,就有可能被攻击,Axigen也不例外,因此出于安全考虑和服务稳定,防范骇客攻击已经成为不可忽视的问题.
首次搭建需要重启Axigen和Fail2ban,在搭建前请做好备份!
环境需求:
以Axigen 10.5.5 为例,CLI用户名请使用 admin,密码请输入向导设置时设置的密码.
<login> user admin
<password> admin_password_which_will_be_showed_in_clear_text<#> config server
<server#> config log
<server-log#> set enableSecurityLog yes
<server-log#> commit
<server#> commit
<#> save config
<#> quit/etc/init.d/axigen restart过滤文件路径为 /etc/fail2ban/filter.d/axigen.conf
创建好之后,将下面内容粘贴到/etc/fail2ban/filter.d/axigen.conf
# Fail2Ban filter for axigen
#
# Revision: 2016040601
#
# If you want to protect Axigen from being bruteforced by password
# authentication then configure enableSecurityLog = yes in axigen.cfg
# and reload configuration.
#
# Log file: ${AXIGEN_WORK_DIR}/log/security.txt
# Log example: 2016-03-08 12:41:29 +0200 02 aximon SECURITY:PROXY_WEBMAIL;0002607C;82.36.25.70;61707;OP_FAIL;root@q.me;Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Firefox/45.0;Authentication error; Invalid password
#
#
# Notes:
# * Feature introduced by Axigen version 9.0
# * Axigen 9 default separator was ':'
# * Axigen 10 default separator switched to ';' (due to IPv6 address format)
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
before = common.conf
[Definition]
_daemon = axigen
failregex = ^%(__prefix_line)s.* SECURITY:[A-Z3_\-]+[:;][0-9A-F]+[:;]<HOST>[:;][0-9]+[:;]OP_FAIL[:;].*$
ignoreregex =
[Init]
# "maxlines" is number of log lines to buffer for multi-line regex searches
maxlines = 10/etc/fail2ban/jail.local内容不做修改,只将下面内容添加进去,可以放在末尾处.
[axigen]
enabled = true
backend = polling
logpath = /var/opt/axigen/log/security.txt
banaction = iptables-allports
maxretry = 10
findtime = 600
bantime = 600systemctl restart fail2ban