【发布时间】:2021-04-07 12:00:54
【问题描述】:
我需要一个 fail2ban 过滤器的帮助,它应该与 openHAB 中的失败登录尝试匹配。
06-Apr.-2021 18:49:52.726 [WARN ] [core.io.http.auth.internal.AbstractAuthPageServlet] - Authentication failed: Wrong password for user UserThatFailedLogin
06-Apr.-2021 19:41:11.456 [WARN ] [core.io.http.auth.internal.AbstractAuthPageServlet] - Authentication failed: User not found: UserThatFailedLogin
这些都是 A) 密码错误和 B) 不存在用户的日志条目示例。
我玩过https://regex101.com 并想出了以下正则表达式(我的第一个接触点);
(\bAuthentication failed: Wrong password\b|\bAuthentication failed: User not found\b)
虽然它在 regex101 工具中匹配上述示例日志条目,但遗憾的是我在 fail2ban 中没有看到任何匹配项。
如果您能在这里帮助我,我们将不胜感激,在此先感谢您!
【问题讨论】:
-
请注意,不同的工具使用不同的正则表达式方言。可能是fail2ban 不支持
\b字边界指示器。