]> arthur.barton.de Git - ngircd.git/commitdiff
Add am example filter file for "Fail2Ban"
authorAlexander Barton <alex@barton.de>
Fri, 19 Apr 2024 21:28:34 +0000 (23:28 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 19 Apr 2024 21:40:19 +0000 (23:40 +0200)
contrib/Debian/rules
contrib/Makefile.am
contrib/README.md
contrib/ngircd-fail2ban.conf [new file with mode: 0644]

index 25e27872bd143d05bef96e4d169edc180d3c69df..561f765ca1d2000ad526c2c58d3d77bfdc8f207e 100755 (executable)
@@ -53,6 +53,11 @@ execute_after_dh_auto_install:
         $(CURDIR)/contrib/ngircd.logcheck \
         $(CURDIR)/debian/ngircd/etc/logcheck/ignore.d.paranoid/ngircd
 
+#      Install the fail2ban configuration.
+       install -o root -g root -m 0644 -D \
+        $(CURDIR)/contrib/ngircd-fail2ban.conf \
+        $(CURDIR)/debian/ngircd/etc/fail2ban/filter.d/ngircd.conf
+
 #      Make lintian happy :-)
        rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING
        mv $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/ChangeLog \
index f2d9901240b50c75e129a15cd75b524eff561261..cd2eb05e85479f7a947544b7a52f7441e75d6929 100644 (file)
@@ -17,6 +17,7 @@ EXTRA_DIST = README.md \
        Dockerfile \
        ngindent.sh \
        ngircd-bsd.sh \
+       ngircd-fail2ban.conf \
        ngIRCd-Logo.gif \
        ngircd-redhat.init \
        ngircd.logcheck \
index fdd46495c0ce6bb068ac97c29cd239686dcd28a8..5ab57690b3cac6218c720a094f45828ae77309fb 100644 (file)
@@ -16,6 +16,8 @@ This `contrib/` directory contains the following sub-folders and files:
 
 - `ngircd-bsd.sh`: Start/stop script for FreeBSD.
 
+- `ngircd-fail2ban.conf`: fail2ban(1) filter configuration for ngIRCd.
+
 - `ngircd-redhat.init`: Start/stop script for old(er) RedHat-based
   distributions (like CentOS and Fedora), which did _not_ use systemd(8).
 
diff --git a/contrib/ngircd-fail2ban.conf b/contrib/ngircd-fail2ban.conf
new file mode 100644 (file)
index 0000000..c9903e0
--- /dev/null
@@ -0,0 +1,25 @@
+# Fail2ban filter for ngIRCd
+#
+# Put into /etc/fail2ban/filter.d/ngircd.conf and enable in your jail.local
+# configuration like this:
+#
+# [ngircd]
+# enabled = true
+# backend = systemd
+#
+
+[INCLUDES]
+
+before = common.conf
+
+[DEFAULT]
+
+_daemon = ngircd
+
+[Definition]
+
+failregex = ^%(__prefix_line)sRefused connection from <ADDR> on socket \d+:
+
+[Init]
+
+journalmatch = _SYSTEMD_UNIT=ngircd.service + _COMM=ngircd