From 4bb24d094ba9c67ef74818371311339e65d72033 Mon Sep 17 00:00:00 2001 From: MinePro120 <37949795+MinePro120@users.noreply.github.com> Date: Thu, 15 Oct 2020 21:35:45 +0300 Subject: [PATCH 1/7] Added [minecraft] to jail.conf --- config/jail.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/jail.conf b/config/jail.conf index b2fd263b..ffd09c28 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -908,6 +908,14 @@ bantime = 1h maxretry = 1 findtime = 1 +[minecraft] +# Vanilla server, 1.16.3 +# Change port and logpath as needed +port = 25565 +findtime = 20 +maxretry = 5 +bantime = 10d +logpath = /home/user/ServerName/logs/latest.log [murmur] # AKA mumble-server From 96765ebcf5b6c2cd43997df2b43b7d183beffefa Mon Sep 17 00:00:00 2001 From: MinePro120 <37949795+MinePro120@users.noreply.github.com> Date: Thu, 15 Oct 2020 21:36:51 +0300 Subject: [PATCH 2/7] Added minecraft filter --- config/filter.d/minecraft.conf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/filter.d/minecraft.conf diff --git a/config/filter.d/minecraft.conf b/config/filter.d/minecraft.conf new file mode 100644 index 00000000..92f4a0d6 --- /dev/null +++ b/config/filter.d/minecraft.conf @@ -0,0 +1,7 @@ +# fail2ban filter for minecraft +# 1.16.3 vanilla server +# Author : MinePro120 + +[Definition] + +failregex = \[\/\: \ No newline at end of file From eb691e5d034a5181d4aec29021b3fcc5831a837e Mon Sep 17 00:00:00 2001 From: MinePro120 <37949795+MinePro120@users.noreply.github.com> Date: Thu, 15 Oct 2020 21:39:31 +0300 Subject: [PATCH 3/7] Added newline at the end of minecraft.conf --- config/filter.d/minecraft.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/filter.d/minecraft.conf b/config/filter.d/minecraft.conf index 92f4a0d6..dc494d8f 100644 --- a/config/filter.d/minecraft.conf +++ b/config/filter.d/minecraft.conf @@ -4,4 +4,4 @@ [Definition] -failregex = \[\/\: \ No newline at end of file +failregex = \[\/\: From 43a9ce9d0c5107b15083111881fc549419aee14a Mon Sep 17 00:00:00 2001 From: MinePro120 <37949795+MinePro120@users.noreply.github.com> Date: Thu, 15 Oct 2020 22:46:36 +0300 Subject: [PATCH 4/7] Added minecraft test log --- fail2ban/tests/files/logs/minecraft | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 fail2ban/tests/files/logs/minecraft diff --git a/fail2ban/tests/files/logs/minecraft b/fail2ban/tests/files/logs/minecraft new file mode 100644 index 00000000..867dfe76 --- /dev/null +++ b/fail2ban/tests/files/logs/minecraft @@ -0,0 +1,2 @@ +# 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) \ No newline at end of file From 9d1644433bc026c855e8985cead365dd5048e96f Mon Sep 17 00:00:00 2001 From: MinePro120 <37949795+MinePro120@users.noreply.github.com> Date: Thu, 15 Oct 2020 23:42:56 +0300 Subject: [PATCH 5/7] Removed [minecraft] findtime, maxretry --- config/jail.conf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/jail.conf b/config/jail.conf index ffd09c28..9c2842e8 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -911,10 +911,9 @@ findtime = 1 [minecraft] # Vanilla server, 1.16.3 # Change port and logpath as needed +# Consider using low findtime (20 recommended) +# and low maxretry (5 recommended) port = 25565 -findtime = 20 -maxretry = 5 -bantime = 10d logpath = /home/user/ServerName/logs/latest.log [murmur] From 3e2c59b74d610b648b3bea625ab1bf21331931d8 Mon Sep 17 00:00:00 2001 From: MinePro120 Date: Sat, 17 Oct 2020 01:15:37 +0300 Subject: [PATCH 6/7] [minecraft] support for whitelist and auth -Added support for blocking non-whitelisted players -Added support for blocking "cracked" players -Changed jail.conf recommendations --- config/filter.d/minecraft.conf | 3 ++- config/jail.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/filter.d/minecraft.conf b/config/filter.d/minecraft.conf index dc494d8f..a5f7b308 100644 --- a/config/filter.d/minecraft.conf +++ b/config/filter.d/minecraft.conf @@ -4,4 +4,5 @@ [Definition] -failregex = \[\/\: +failregex = \[\/: + \(\/: diff --git a/config/jail.conf b/config/jail.conf index 9c2842e8..2d225a14 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -912,7 +912,8 @@ findtime = 1 # Vanilla server, 1.16.3 # Change port and logpath as needed # Consider using low findtime (20 recommended) -# and low maxretry (5 recommended) +# and high maxretry (10 recommended) to block +# bots, not regular players port = 25565 logpath = /home/user/ServerName/logs/latest.log From 778b09404f2885252088f6feb9ec3854508615bc Mon Sep 17 00:00:00 2001 From: MinePro120 Date: Sat, 17 Oct 2020 01:35:47 +0300 Subject: [PATCH 7/7] [minecraft] updated test log --- fail2ban/tests/files/logs/minecraft | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fail2ban/tests/files/logs/minecraft b/fail2ban/tests/files/logs/minecraft index 867dfe76..a876ab75 100644 --- a/fail2ban/tests/files/logs/minecraft +++ b/fail2ban/tests/files/logs/minecraft @@ -1,2 +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) \ No newline at end of file +[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