Skip to content

Getting a regex pattern to work with fail2ban #3034

Answered by sebres
ruirigel asked this question in Q&A
Discussion options

You must be logged in to vote

You don't need filter for such simple stuff (can write failregex directly in jail):

[vncserver]
failregex = ^\s*\S+\s+\S+\[\d+\]: Connections: disconnected: <ADDR>::\d+ \(\S+\) \(\[AuthFailure\]
enabled = true

(this will work for fail2ban versions >= 0.10, for versions smaller than 0.10, replace <ADDR> with <HOST> and set usedns = no in jail, but I have no idea whether default datepattern of v.0.9 would find timestamp 2021-05-31T17:34:27.479Z, if not - specify custom datepattern in init section of filter).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ruirigel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants