From 5828342201f33020aed8b82cce4072da5453a600 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 13 Apr 2024 20:15:47 +0200 Subject: [PATCH] add fail2ban --- fail2ban/filter.d/gitea.conf | 4 ++++ fail2ban/jail.d/gitea.conf | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 fail2ban/filter.d/gitea.conf create mode 100644 fail2ban/jail.d/gitea.conf diff --git a/fail2ban/filter.d/gitea.conf b/fail2ban/filter.d/gitea.conf new file mode 100644 index 0000000..753f135 --- /dev/null +++ b/fail2ban/filter.d/gitea.conf @@ -0,0 +1,4 @@ +# gitea.conf +[Definition] +failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from +ignoreregex = diff --git a/fail2ban/jail.d/gitea.conf b/fail2ban/jail.d/gitea.conf new file mode 100644 index 0000000..f84565d --- /dev/null +++ b/fail2ban/jail.d/gitea.conf @@ -0,0 +1,8 @@ +[gitea] +enabled = true +filter = gitea +logpath = /var/lib/gitea/log/gitea.log +maxretry = 10 +findtime = 3600 +bantime = 900 +action = iptables-allports