正则表达式 – Fail2Ban SASL过滤器错过了登录失败

我在我的邮件服务器上使用 fail2ban.我今天早上发现有一些5000次失败的登录尝试(在1小时内)通过SMTP无法被我的sasl过滤器接收.以下是/var/log/mail.log中的条目示例
Jan 25 04:39:56 ***** postfix/smtpd[23828]: warning: 114-32-231-17.HINET-IP.hinet.net[114.32.231.17]: SASL LOGIN authentication Failed: authentication failure

这是我的(未修改的)fail2ban的sasl过滤器定义:

# Fail2Ban configuration file
#
# Author: Yaroslav Halchenko
#
# $Revision: 728 $
#

[DeFinition]

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
#          host must be matched by a group named "host". The tag "<HOST>" can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
# Values: TEXT
#
failregex = (?i): warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication Failed(: [A-Za-z0-9+/]*={0,2})?$

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches,the line is ignored.
# Values:  TEXT
#
ignoreregex =

任何人都可以推荐一个改进的正则表达式,也会抓住这个记录吗?

定义另一个failregex
(?i): warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication Failed(:.*)$

我用fail2ban-regex测试了这个正则表达式并且正在工作.

相关文章

正则替换html代码中img标签的src值在开发富文本信息在移动端...
正则表达式
AWK是一种处理文本文件的语言,是一个强大的文件分析工具。它...
正则表达式是特殊的字符序列,利用事先定义好的特定字符以及...
Python界一名小学生,热心分享编程学习。
收集整理每周优质开发者内容,包括、、等方面。每周五定期发...