Merge pull request #2264 from girst/0.11 (rebased to 0.10)

pull/2448/head
sebres 2019-06-12 16:28:32 +02:00
commit 809e7c4e82
4 changed files with 33 additions and 0 deletions

View File

@ -85,6 +85,7 @@ filter = flt[logtype=short]
* `filter.d/common.conf`: differentiate `__prefix_line` for file/journal logtype's (speedup and fix parsing * `filter.d/common.conf`: differentiate `__prefix_line` for file/journal logtype's (speedup and fix parsing
of systemd-journal); of systemd-journal);
* `filter.d/traefik-auth.conf`: used to ban hosts, that were failed through traefik * `filter.d/traefik-auth.conf`: used to ban hosts, that were failed through traefik
* `filter.d/znc-adminlog.conf`: new filter for ZNC (IRC bouncer); requires the adminlog module to be loaded
### Enhancements ### Enhancements
* introduced new options: `dbmaxmatches` (fail2ban.conf) and `maxmatches` (jail.conf) to contol * introduced new options: `dbmaxmatches` (fail2ban.conf) and `maxmatches` (jail.conf) to contol

View File

@ -0,0 +1,18 @@
# Fail2Ban filter for ZNC (requires adminlog module)
#
# to use this module, enable the adminlog module from within ZNC and point
# logpath to its logfile (e.g. /var/lib/znc/moddata/adminlog/znc.log).
[Definition]
failregex = ^\[\] \[[^]]+\] failed to login from <ADDR>$
ignoreregex =
# DEV Notes:
# Log format is: [<DATE+TIME>] [<USERNAME>] <ACTION> from <ADDR>
# [2018-10-27 01:40:17] [girst] connected to ZNC from 1.2.3.4
# [2018-10-27 01:40:21] [girst] disconnected from ZNC from 1.2.3.4
# [2018-10-27 01:40:55] [girst] failed to login from 1.2.3.4
#
# Author: Tobias Girstmair (//gir.st/)

View File

@ -734,6 +734,13 @@ logpath = /var/log/freeswitch.log
maxretry = 10 maxretry = 10
# enable adminlog; it will log to a file inside znc's directory by default.
[znc-adminlog]
port = 6667
logpath = /var/lib/znc/moddata/adminlog/znc.log
# To log wrong MySQL access attempts add to /etc/my.cnf in [mysqld] or # To log wrong MySQL access attempts add to /etc/my.cnf in [mysqld] or
# equivalent section: # equivalent section:
# log-warnings = 2 # log-warnings = 2

View File

@ -0,0 +1,7 @@
# failJSON: { "time": "2018-10-27T01:40:55", "match": true , "host": "1.2.3.4" }
[2018-10-27 01:40:55] [girst] failed to login from 1.2.3.4
# failJSON: { "match": false }
[2018-10-27 01:40:17] [girst] connected to ZNC from 1.2.3.4
# failJSON: { "match": false }
[2018-10-27 01:40:21] [girst] disconnected from ZNC from 1.2.3.4