Answer the question
In order to leave comments, you need to log in
How to create a fail2ban regex expression?
Hello.
I want to protect the minecraft server
In
the logs there are such
messages InitialHandler has connected
14:52:47 [INFO] [/46.33.52.200:50698] <-> InitialHandler has connected
14:52:52 [INFO] [/89.147.241.153:25639] <-> InitialHandler has connected
14:52 :54 [INFO] [/194.44.127.194:59030] <-> InitialHandler has connected
14:52:56 [INFO] [/5.248.38.199:49935] <-> InitialHandler has connected
14:53:05 [INFO] [ /46.188.123.234:17907] <-> InitialHandler has connected
14:53:05 [INFO] [/46.188.123.234:17900] <-> InitialHandler has connected
14:53:16 [INFO] [Tanya] -> UpstreamBridge has disconnected
14:53:16 [INFO] [Tanya] disconnected with: §f[Proxy] Lost connection to server.
14:53:16 [INFO] [Tanya] <-> DownstreamBridge <-> [lobby] has disconnected
14:53:18 [INFO] [/91.79.163.142:50687] <-> InitialHandler has connected
14:53:18 [INFO] [/178.140.46.18:53260] <-> InitialHandler has connected
Here are those who are more than 3 times per minute InitialHandler has connected - throw in a ban.
I understand that you need to do a regex for a string like
14:53:18 [INFO] [/178.140.46.18:53260] <-> InitialHandler has connected
But I have no idea how to do it.
Can someone tell me where to start or the line itself?
Answer the question
In order to leave comments, you need to log in
My version of fail2ban
#fail2ban-server -V
Fail2Ban v0.9.3
[minecraft]
filter = minecraft
enabled = true
logpath = full_path_to_minecraft_logs
bantime = 3600
findtime = 60
maxretry = 3
[Definition]
failregex = \[INFO\] \[\/<HOST>:\d+\] <-> InitialHandler has connected$
ignoreregex =
#python -V
Python 2.6.6
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question