about summary refs log tree commit diff
path: root/fail2ban.nix
diff options
context:
space:
mode:
Diffstat (limited to 'fail2ban.nix')
-rw-r--r--fail2ban.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/fail2ban.nix b/fail2ban.nix
new file mode 100644
index 0000000..d30f6b0
--- /dev/null
+++ b/fail2ban.nix
@@ -0,0 +1,36 @@
+# Configuration for fail2ban
+# Copyright (C) 2024 Ngô Ngọc Đức Huy
+#
+# This file is part of loang configuration.
+#
+# Loang configuration is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Loang configuration is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with loang configuration.  If not, see <https://www.gnu.org/licenses/>.
+
+{ pkgs, ... }:
+{
+  services.jail2ban = {
+    enable = true;
+    bantime = "30m";
+    bantime-increment = {
+      enable = true;
+      maxtime = "7d";
+    };
+    jails = {
+      maddy = {
+        settings = {
+          logpath = "/var/log/maddy.log";
+        };
+      };
+    };
+  };
+};