diff --git a/config/filter.d/minecraft.conf b/config/filter.d/minecraft.conf new file mode 100644 index 00000000..a5f7b308 --- /dev/null +++ b/config/filter.d/minecraft.conf @@ -0,0 +1,8 @@ +# fail2ban filter for minecraft +# 1.16.3 vanilla server +# Author : MinePro120 + +[Definition] + +failregex = \[\/: + \(\/: diff --git a/config/jail.conf b/config/jail.conf index 5d75f4f5..a2b619b1 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -922,6 +922,14 @@ bantime = 1h maxretry = 1 findtime = 1 +[minecraft] +# Vanilla server, 1.16.3 +# Change port and logpath as needed +# Consider using low findtime (20 recommended) +# and high maxretry (10 recommended) to block +# bots, not regular players +port = 25565 +logpath = /home/user/ServerName/logs/latest.log [murmur] # AKA mumble-server diff --git a/fail2ban/tests/files/logs/minecraft b/fail2ban/tests/files/logs/minecraft new file mode 100644 index 00000000..a876ab75 --- /dev/null +++ b/fail2ban/tests/files/logs/minecraft @@ -0,0 +1,6 @@ +# failJSON: { "time": "2005-08-13T21:30:40", "match": true, "host": "123.45.67.89" } +[21:30:40] [Server thread/INFO]: Player[/123.45.67.89:12345] logged in with entity id 551 at (825.302579326729, 65.0, -886.9107800126116) +# failJSON: { "time": "2005-08-13T21:30:40", "match": true, "host": "123.45.67.89" } +[21:30:40] [Server thread/INFO]: Disconnecting com.mojang.authlib.GameProfile@12345678[id=7de34b7e-069d-48a5-92c5-f583ae7c7a8b,name=Player,properties={textures=[com.mojang.authlib.properties.Property@12345678]},legacy=false] (/123.45.67.89:12345): You are not white-listed on this server! +# failJSON: { "time": "2005-08-13T21:30:40", "match": true, "host": "123.45.67.89" } +[21:30:40] [Server thread/INFO]: com.mojang.authlib.GameProfile@12345678[id=,name=Player,properties={},legacy=false] (/123.45.67.89:12345) lost connection: Disconnected