From 46fc4c461588118b0c617de0528f095ccf7d9e4f Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 18 Apr 2019 22:14:34 +0200 Subject: [PATCH] protocol and documentation --- MANIFEST | 3 +++ fail2ban/protocol.py | 4 ++++ man/fail2ban-client.1 | 18 ++++++++++++++++++ man/jail.conf.5 | 8 ++++++++ 4 files changed, 33 insertions(+) diff --git a/MANIFEST b/MANIFEST index cb393096..892f33b7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -145,6 +145,7 @@ config/filter.d/sshd.conf config/filter.d/stunnel.conf config/filter.d/suhosin.conf config/filter.d/tine20.conf +config/filter.d/traefik-auth.conf config/filter.d/uwimap-auth.conf config/filter.d/vsftpd.conf config/filter.d/webmin-auth.conf @@ -333,9 +334,11 @@ fail2ban/tests/files/logs/solid-pop3d fail2ban/tests/files/logs/squid fail2ban/tests/files/logs/squirrelmail fail2ban/tests/files/logs/sshd +fail2ban/tests/files/logs/sshd-journal fail2ban/tests/files/logs/stunnel fail2ban/tests/files/logs/suhosin fail2ban/tests/files/logs/tine20 +fail2ban/tests/files/logs/traefik-auth fail2ban/tests/files/logs/uwimap-auth fail2ban/tests/files/logs/vsftpd fail2ban/tests/files/logs/webmin-auth diff --git a/fail2ban/protocol.py b/fail2ban/protocol.py index de9665f8..92b0dcc0 100644 --- a/fail2ban/protocol.py +++ b/fail2ban/protocol.py @@ -72,6 +72,8 @@ protocol = [ ['', "DATABASE", ""], ["set dbfile ", "set the location of fail2ban persistent datastore. Set to \"None\" to disable"], ["get dbfile", "get the location of fail2ban persistent datastore"], +["set dbmaxmatches ", "sets the max number of matches stored in database per ticket"], +["get dbmaxmatches", "gets the max number of matches stored in database per ticket"], ["set dbpurgeage ", "sets the max age in that history of bans will be kept"], ["get dbpurgeage", "gets the max age in seconds that history of bans will be kept"], ['', "JAIL CONTROL", ""], @@ -103,6 +105,7 @@ protocol = [ ["set banip ... ", "manually Ban for "], ["set unbanip [--report-absent] ... ", "manually Unban in "], ["set maxretry ", "sets the number of failures before banning the host for "], +["set maxmatches ", "sets the max number of matches stored in memory per ticket in "], ["set maxlines ", "sets the number of to buffer for regex search for "], ["set addaction [ ]", "adds a new action named for . Optionally for a Python based action, a and can be specified, else will be a Command Action"], ["set delaction ", "removes the action from "], @@ -130,6 +133,7 @@ protocol = [ ["get datepattern", "gets the patern used to match date/times for "], ["get usedns", "gets the usedns setting for "], ["get maxretry", "gets the number of failures allowed for "], +["get maxmatches", "gets the max number of matches stored in memory per ticket in "], ["get maxlines", "gets the number of lines to buffer for "], ["get actions", "gets a list of actions for "], ["", "COMMAND ACTION INFORMATION",""], diff --git a/man/fail2ban-client.1 b/man/fail2ban-client.1 index 22035f85..6c1ff7ef 100644 --- a/man/fail2ban-client.1 +++ b/man/fail2ban-client.1 @@ -168,6 +168,14 @@ persistent datastore. Set to get the location of fail2ban persistent datastore .TP +\fBset dbmaxmatches \fR +sets the max number of matches +stored in database per ticket +.TP +\fBget dbmaxmatches\fR +gets the max number of matches +stored in database per ticket +.TP \fBset dbpurgeage \fR sets the max age in that history of bans will be kept @@ -286,6 +294,11 @@ sets the number of failures before banning the host for .TP +\fBset maxmatches \fR +sets the max number of matches +stored in memory per ticket in + +.TP \fBset maxlines \fR sets the number of to buffer for regex search for @@ -393,6 +406,11 @@ gets the usedns setting for gets the number of failures allowed for .TP +\fBget maxmatches\fR +gets the max number of matches +stored in memory per ticket in + +.TP \fBget maxlines\fR gets the number of lines to buffer for diff --git a/man/jail.conf.5 b/man/jail.conf.5 index 0f3a4aa7..4f5c48e0 100644 --- a/man/jail.conf.5 +++ b/man/jail.conf.5 @@ -156,6 +156,11 @@ Database filename. Default: /var/lib/fail2ban/fail2ban.sqlite3 .br This defines where the persistent data for fail2ban is stored. This persistent data allows bans to be reinstated and continue reading log files from the last read position when fail2ban is restarted. A value of \fINone\fR disables this feature. .TP +.B dbmaxmatches +Max number of matches stored in database per ticket. Default: 10 +.br +This option sets the max number of matched log-lines could be stored per ticket in the database. This also affects values resolvable via tags \fB\fR and \fB\fR in actions. +.TP .B dbpurgeage Database purge age in seconds. Default: 86400 (24hours) .br @@ -276,6 +281,9 @@ regex (Python \fBreg\fRular \fBex\fRpression) to be added to the filter's failre .TP .B ignoreregex regex which, if the log line matches, would cause Fail2Ban not consider that line. This line will be ignored even if it matches a failregex of the jail or any of its filters. +.TP +.B maxmatches +max number of matched log-lines the jail would hold in memory per ticket. By default it is the same value as \fBmaxretry\fR of jail (or default). This option also affects values resolvable via tag \fB\fR in actions. .SS Backends Available options are listed below.