summary refs log tree commit diff stats
path: root/system/services/fail2ban
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-03-25 14:00:29 +0100
committerene <ene@sils.li>2023-03-25 14:00:29 +0100
commitdce980ddb127a470b188fd6efbfb8ddb5b0fe315 (patch)
treeabc2293c6d126a6d87d49ef0b0eb6ffabc3fe263 /system/services/fail2ban
parentFix(system/services/fail2ban): Make db persistent (diff)
downloadnixos-server-dce980ddb127a470b188fd6efbfb8ddb5b0fe315.tar.gz
nixos-server-dce980ddb127a470b188fd6efbfb8ddb5b0fe315.zip
Feat(system/services/fail2ban): Add dovecot jail
This should reduce the log spam even further.
Diffstat (limited to 'system/services/fail2ban')
-rw-r--r--system/services/fail2ban/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/services/fail2ban/default.nix b/system/services/fail2ban/default.nix
index 949b486..5aee097 100644
--- a/system/services/fail2ban/default.nix
+++ b/system/services/fail2ban/default.nix
@@ -17,5 +17,14 @@
       multipliers = "2 4 16 128 256";
       maxtime = "72h";
     };
+    jails = {
+      dovecot = ''
+        # block IPs which failed to log-in
+        # aggressive mode add blocking for aborted connections
+        enabled = true
+        filter = dovecot[mode=aggressive]
+        maxretry = 2
+      '';
+    };
   };
 }