marc
5b768c702d
simplistic Makefile
CI / build (2.7) (push) Canceled after 0s
CI / build (3.10) (push) Canceled after 0s
CI / build (3.11.0-alpha.1) (push) Canceled after 0s
CI / build (3.5) (push) Canceled after 0s
CI / build (3.6) (push) Canceled after 0s
CI / build (3.7) (push) Canceled after 0s
CI / build (3.8) (push) Canceled after 0s
CI / build (3.9) (push) Canceled after 0s
CI / build (pypy2) (push) Canceled after 0s
CI / build (pypy3) (push) Canceled after 0s
2021-12-24 03:17:05 +01:00
marc
2c48540bde
simplictic docker-compose.yml
2021-12-24 03:16:55 +01:00
marc
7692035dab
simplistic dockerfile
2021-12-24 03:16:41 +01:00
sebres
095aeda840
Merge branch '0.11'
2021-12-02 18:56:19 +01:00
sebres
3fb02527a4
Merge branch '0.10' into 0.11
2021-12-02 18:52:13 +01:00
sebres
25a61ce632
Merge branch 'gh-actions--test-systemd' into 0.10 + several revisions cherry-picked from 0.11/master
2021-12-02 18:48:59 +01:00
sebres
21d94ff178
amend to fix gh-3098: no option --disable-2to3 anymore
2021-12-02 18:44:24 +01:00
sebres
196c55e931
fix gh-3098: build fails with error in fail2ban setup command: use_2to3 is invalid (setuptools 58+)
2021-12-02 18:44:22 +01:00
sebres
0fa76ef75a
gh-actions: temporary ignore tests of systemd backend for python >= v.3.10 (otherwise it fails with "PY_SSIZE_T_CLEAN macro must be defined for '#' formats")
2021-12-02 18:33:10 +01:00
sebres
a147a8b0e1
gh-actions: coverage for systemd backend (to monitor journals in test-suite in GHA-env we need to use 0 as default flags, because otherwise it cannot be found using SYSTEM_ONLY(4))
2021-12-02 18:33:08 +01:00
sebres
1bcb62e31c
gh-actions: python releases upgrade + debug/test systemd backend availability in GHA
2021-12-02 18:33:05 +01:00
sebres
a57643404c
mytime.seconds2str: small amend with speed-up, code simplification and few tests
2021-11-04 14:34:04 +01:00
sebres
80805cabfc
Merge branch '0.11'
2021-11-03 16:01:00 +01:00
sebres
4fe4ac8dde
amend to merge: replace timedelta string representation with new function seconds2str
2021-11-03 15:58:57 +01:00
sebres
0b3ad780fe
Merge branch '0.10' into 0.11
2021-11-03 15:48:21 +01:00
sebres
ebf5784b8c
Merge branch 'fix-gh-2882' into 0.10
...
closes gh-2882
2021-11-03 15:47:45 +01:00
sebres
3b02098817
several backends optimizations (in file and journal filters):
...
- don't need to wait if we still had log-entries from last iteration (which got interrupted for servicing)
- rewritten update log/journal position, it is more stable and faster now (fewer DB access and surely up-to-date at end)
2021-11-03 15:41:50 +01:00
sebres
96661f25ab
filtersystemd.py: fixes wrong time point of "in operation" mode
...
todo: need more tests to cover any step of switch to inOperationMode (all branches)
2021-11-03 15:41:40 +01:00
sebres
7678f59827
better format of time delta (using seconds2str); increase stability for systemd test-cases
2021-11-03 12:57:57 +01:00
sebres
4b54a07d71
Revert "action.d/firewallcmd-*.conf (multiport only): fixed port range selector, replacing : with -;"
...
This reverts the incompatibility #3047 introduced by commit a038fd5dfe (#2821 ).
2021-11-01 11:45:40 +01:00
Sergey G. Brester
e74baae666
Merge pull request #3135 from sylvestre/patch-2
...
Add the Debian path to roundcube error logs
2021-10-25 12:11:42 +02:00
Sergey G. Brester
cb042dda7d
Merge pull request #3133 from sylvestre/master
...
Fix typo found by lintian (Debian static analyzer)
2021-10-25 12:10:28 +02:00
Sylvestre Ledru
3245b8018b
Add the Debian path to roundcube error logs
2021-10-23 17:38:20 +02:00
Sylvestre Ledru
1cd3118da3
Fix typo found by lintian (Debian static analyzer)
2021-10-23 17:06:13 +02:00
Sergey G. Brester
98c7dd04a4
Merge pull request #3037 from floppym/bug794931
...
tests: improve detection of readable systemd journal
2021-10-22 15:34:47 +02:00
Mike Gilbert
d91d949e95
tests: improve detection of readable systemd journal
...
Look for system.journal in journal sub-directory.
Add -readable to the find command.
Bug: https://bugs.gentoo.org/794931
2021-10-19 11:08:04 -04:00
Viktor Szépe
1e8ce20b32
Display ChangeLog as a Markdown document
2021-10-17 19:53:10 +02:00
Sergey G. Brester
8e3a26bdeb
Merge pull request #3117 from fail2ban/gh-3116
...
filter.d/lighttpd-auth.conf: adjust to the current source code, avoid catch-all's, etc
2021-10-01 15:09:09 +02:00
Sergey G. Brester
ba839af8ad
filter.d/lighttpd-auth.conf: adjusted to the current source code + avoiding catch-all's, etc (gh-3116)
2021-10-01 15:03:24 +02:00
Sergey G. Brester
f8f59dd31a
added test cases covering different messages adjusted to new log-format (gh-3116)
2021-10-01 14:58:25 +02:00
Sergey G. Brester
5ee482bc9a
Merge pull request #3053 from db48x/fix-grammar-of-timestamp-warnings
...
Improve grammar and readability of timestamp warnings
2021-09-21 16:16:52 +02:00
Sergey G. Brester
d086317cc8
Update filter.py
2021-09-21 16:05:53 +02:00
Sergey G. Brester
17eed32e03
Update filtertestcase.py
2021-09-21 16:00:37 +02:00
sebres
621d8cae17
restore backwards compatibility for date None
2021-09-20 02:20:22 +02:00
sebres
ec043cd202
simplifying logic and shortening messages (delta in minutes; removed clock synchronization, because it is rarely an issue on fail2ban side, e. g. for remote logs only, etc)
2021-09-19 21:58:42 +02:00
Daniel Brooks
d7afcde2e1
add a warning message for dates in the future
...
and a test that checks which message was output for which time deltas.
2021-09-19 19:39:52 +02:00
Daniel Brooks
1929e7a76b
include more specific information in the warning
2021-09-19 19:39:49 +02:00
Daniel Brooks
320a3dcdd5
remove old warnings from filtertestcase.py
...
assertLogged only checks that at least one listed message is found, so
it isn’t necessary to repeat them in the test.
2021-09-19 19:39:45 +02:00
Daniel Brooks
a98cc08b31
Updated the warning messages created when fail2ban sees unexpected timestamps
...
to improve their grammar and to remove jargon.
Partially fixes #2822
2021-09-19 19:39:41 +02:00
sebres
5093ff8956
Merge branch '0.11' into master
2021-09-19 18:54:23 +02:00
sebres
d6b884f3b7
amend to fix gh-3098: no option --disable-2to3 anymore
2021-09-19 18:52:34 +02:00
sebres
5ac303df8a
fix gh-3098: build fails with error in fail2ban setup command: use_2to3 is invalid (setuptools 58+)
2021-09-19 18:49:18 +02:00
sebres
8d45deca86
Merge branch '0.10' into 0.11
2021-09-19 18:42:23 +02:00
sebres
974ba688d4
Merge branch 'patch-3098' into 0.10
2021-09-19 18:41:24 +02:00
Sergey G. Brester
7f22c4873a
remove 2to3 in setup (should be called outside before setup)
2021-09-19 18:36:02 +02:00
Sergey G. Brester
1414a44b8e
Update main.yml
...
CI: try to install dependencies via apt, add build test
2021-09-19 18:24:36 +02:00
sebres
ad1f9dc4d0
Merge branch '0.11'
2021-09-08 20:12:48 +02:00
sebres
64217fe018
Merge branch '0.10' into 0.11
2021-09-08 20:09:48 +02:00
sebres
c0f9348db5
Merge branch 'sebres/gh-3097--fix-unh-except' into 0.10;
...
closes #3097
2021-09-08 20:08:30 +02:00
sebres
d709ec8179
GH actions: use newest python version for 3.10 (3.10.0-rc.2)
2021-09-08 20:00:41 +02:00
sebres
ba282b794c
pyinotify: amend to 1e4a14fb25: one fix more for sporadic runtime error "dictionary changed size during iteration" (watched files)
2021-09-08 19:56:02 +02:00
sebres
e323c148e1
backend systemd: fixes error "local variable 'line' referenced before assignment", introduced in 55d7d9e214f72bbe4f39a2d17aa004d80bfc7299;
...
don't update database too often (every 10 ticks or ~ 10 seconds in production);
closes gh-3097
2021-09-08 19:44:49 +02:00
sebres
1e4a14fb25
pyinotify: fixes sporadic runtime error "dictionary changed size during iteration" (if something outside changes the pending dict during _checkPending evaluation) - simply deserialize to a list for iteration, without any lock, because unneeded here due to small and mostly empty dictionary (logrotate, etc), not to mention that pending check is normally called once per minute;
...
don't call process file inside of server thread calling of addLogPath (always retard it as pending event);
ensure to wake-up as soon as possible to process pending events (e. g. if file gets added).
2021-09-08 19:17:44 +02:00
sebres
2f99d5accb
test coverage for unhandled exception in run of several filter (gh-3097)
2021-09-08 18:22:31 +02:00
Sergey G. Brester
cb667edf17
Merge pull request #3087 from alexporto2200/patch-3
...
README: added dependencies to setuptools or distutils (if installing from source)
2021-08-17 16:49:40 +02:00
Sergey G. Brester
ade79635b2
distutils/setuptools only required if installing from source
2021-08-17 16:41:20 +02:00
Alex Porto dos Santos
39fe0bdce6
Update Readme
...
Add python3-setuptools or python-setuptools for dependencies. On some distributions this doesn't come by default, it would be nice to let users know about this in the documentation.
2021-08-17 10:39:04 -03:00
sebres
10cd815525
merge 0.11 to 1.0 (GHSA-m985-3f3v-cwmm)
2021-07-07 12:06:06 +02:00
sebres
c03fe6682c
merge 0.10 to 0.11 (GHSA-m985-3f3v-cwmm)
2021-07-07 12:04:46 +02:00
sebres
e3f2fcfab4
merge point (GHSA-m985-3f3v-cwmm 0.9/0.10)
2021-07-07 11:50:49 +02:00
sebres
2ed414ed09
fixed possible RCE vulnerability, unset escape variable (default tilde) stops consider "~" char after new-line as composing escape sequence
...
closes GHSA-m985-3f3v-cwmm for 0.9
2021-07-07 11:46:28 +02:00
sebres
410a6ce5c8
fixed possible RCE vulnerability, unset escape variable (default tilde) stops consider "~" char after new-line as composing escape sequence
2021-06-21 17:12:53 +02:00
sebres
579c6a94af
filter.d/postfix.conf: mode ddos (and aggressive) extended to consider abusive handling of clients hitting command limit (gh-3040)
2021-06-10 15:23:24 +02:00
sebres
43f2923fbd
filter.d/postfix.conf: matches rejects with "undeliverable address" (sender/recipient verification, gh-3039) additionally to "Unknown user";
...
both are configurable now via extended parameter and can be disabled using `exre-user=` supplied in filter parameters
2021-06-10 15:06:54 +02:00
Sergey G. Brester
bbfff18280
action.d/ufw.conf: amend to #3018 : parameter kill-mode extended with conntrack
2021-06-03 12:02:08 +02:00
sebres
c7a86b4616
action.d/firewallcmd-ipset.conf: amend to #2620 :
...
- combines actions `firewallcmd-ipset` and `firewallcmd-ipset-native` (parameter `ipsettype=firewalld`);
- IPv6-capability for firewalld ipset;
- no internal timeout handling by default;
- no permanent rules yet
2021-05-29 22:59:55 +02:00
Sergey G. Brester
2a508da5a0
Merge pull request #2620 from mspolitaev/master
...
Using native firewalld ipset implementation
2021-05-29 21:30:55 +02:00
sebres
38535b0cca
Merge branch '0.11' into master
2021-05-29 21:25:24 +02:00
sebres
d2f5c7de09
Merge branch '0.10' into 0.11
2021-05-29 21:24:11 +02:00
sebres
92f90038fa
filter.d/dovecot.conf: extended to match prefix like conn unix:auth-worker (uid=143): auth-worker<13247>: (authenticate from external service like exim), gh-2553
2021-05-29 21:12:34 +02:00
sebres
8b984a0135
filter.d\exim-common.conf: pid-prefix extended to match mx1 exim[...]: (gh-2553)
2021-05-29 20:47:56 +02:00
sebres
6be1a5a0b1
filter.d/dovecot.conf: fixed "Authentication failure" regex, matches "Password mismatch" in title case (gh-2880)
2021-05-29 20:25:28 +02:00
sebres
8afea37494
filter.d/sendmail-auth.conf: covering several "authentication failure" messages, sendmail 8.16.1 (gh-2757)
2021-05-29 20:09:57 +02:00
sebres
c5f1598a21
filter.d/postfix.conf: extended to cover new vectors:
...
- reject: BDAT/DATA from (gh-2927)
- (since regex is more precise now) token selector changed to `[A-Z]{4}`, e. g. no matter what a command is supplied now (RCPT, EHLO, VRFY, DATA, BDAT or something else)
- matches "Command rejected" and "Data command rejected" now
2021-05-29 19:48:24 +02:00
sebres
ae3e9b9149
filter.d/postfix.conf: extended to cover 2 new vectors:
...
- RCPT from unknown, 504 5.5.2, need fully-qualified hostname, gh-2995
- 550 5.7.25 Client host rejected, gh-2996
review combining several regex to single one
2021-05-29 19:21:27 +02:00
sebres
87f717e0e0
filter.d/sendmail-reject.conf: fix reverse DNS for ... (gh-3012)
2021-05-29 18:45:59 +02:00
Sergey G. Brester
3d52fe3e4e
Merge pull request #2679 from mikaku/updated-to-latest-jail.conf
...
Add new jail (and filter) Monitorix
2021-05-27 12:17:16 +02:00
sebres
0a05dbdbfc
Merge branch '0.11' into master
2021-05-25 23:19:25 +02:00
sebres
3312b8cb95
Merge branch '0.10' into 0.11
2021-05-25 23:18:33 +02:00
sebres
1627d4f573
filter.d/sendmail-auth.conf: user not found, closes gh-3030
2021-05-25 23:16:29 +02:00
Sergey G. Brester
f07e0f7ade
Merge pull request #2984 from j-marz/zoneminder_filter_update
...
Zoneminder filter update
2021-05-21 13:03:33 +02:00
Sergey G. Brester
ec4e0dd65b
padding with space, prefregex, regex review (simplifying, capture user name, consider possible space char in user name)
2021-05-21 13:00:24 +02:00
j-marz
2367ad115c
fixed typo in comment
2021-05-20 09:15:45 +10:00
Ioannis Cherouvim
5e3de882af
docs: Typo. ( #3025 )
2021-05-12 13:18:46 +02:00
Sergey G. Brester
3f9cf27853
filter.d/apache-fakegooglebot.conf: better, more precise regex and datepattern (closes possible weakness like #3013 )
2021-05-11 13:47:48 +02:00
usernamepi
4f8427178a
Missing comment "#" ( #3022 )
...
Missed this ... but the logs showed it.
2021-05-07 18:23:40 +02:00
sebres
6ac2156907
Merge branch '0.11' into master
2021-05-07 01:48:36 +02:00
sebres
3e1aa03037
Merge branch '0.10' into 0.11
2021-05-07 01:46:46 +02:00
sebres
ef5c826c74
fixes search for the best datepattern (gh-3020) - e. g. if line is too short, boundaries check for previously known unprecise pattern may fail on incomplete lines (logging break-off, no flush, etc)
2021-05-07 01:18:54 +02:00
sebres
2918849f9e
fixes precise year pattern %ExY - accept years 20xx up to current century (using almost the same pattern in tests and production now)
2021-05-07 01:10:26 +02:00
usernamepi
88f779ed24
ufw.conf, amend to #3018 - add missing option for comment ( #3019 )
2021-05-06 23:23:39 +02:00
Sergey G. Brester
5a8f1bceb8
Merge pull request #3018 from usernamepi/master
...
Update ufw.conf: several fixes and enhancements
2021-05-06 22:20:39 +02:00
Sergey G. Brester
2958ad8636
Update ChangeLog
2021-05-06 22:19:38 +02:00
Sergey G. Brester
8f6a8df3a4
added new options kill-mode and kill, which makes the drop of all connections optional
2021-05-06 21:47:06 +02:00
Sergey G. Brester
5debaa4cac
option "add", can be set to "insert <num>" instead of prepend (customization or backwards compat)
2021-05-06 20:23:58 +02:00
usernamepi
e4e7a83cff
Update ufw.conf
...
Prerequisites:
* The ss command is available, kernel is compiled with option CONFIG_INET_DIAG_DESTROY.
* Ufw version is => 0.36 (released in 2018)
* Now using "prepend" instead of "insert" to be able to handle IPv6 addresses correctly. The current action will fail for IPv6 addresses.
* Now application names containing a space should handled correctly, solves https://github.com/fail2ban/fail2ban/pull/1532
* Now closing IPv4 and IPv6 connections (if any) from the ip that is being banned. The current action will leave them open.
Using ss to accomplish this. For this to work the kernel needs to be compiled with the CONFIG_INET_DIAG_DESTROY option.
My system apparently is compiled that way.
2021-05-06 13:44:36 +02:00
sebres
71ce548117
Merge branch '0.11'
2021-04-27 14:05:53 +02:00
sebres
b5b615731e
Merge branch '0.10' into 0.11
2021-04-27 14:03:49 +02:00
sebres
319cfefac2
fix travis build (unsupported pythons and pypy versions), update 3.10 in GH actions
2021-04-27 13:41:57 +02:00
sebres
d3f5d2d52b
documentation (interpolation tags)
2021-04-21 11:50:07 +02:00
sebres
f0214b3d36
filter.d/sendmail-reject.conf: fixed regex to consider "Connection rate limit exceeded" with different combination of arguments
2021-04-20 18:13:40 +02:00
Sergey G. Brester
ab0847e2d5
more precise anchored RE (also combining all 3 REs in a single regex)
2021-04-14 13:06:58 +02:00
Jordi Sanfeliu
b6fac90b5a
Update monitorix
2021-04-14 11:46:23 +02:00
Jordi Sanfeliu
63b3f39adc
Rename monitorix-httpd to monitorix
2021-04-14 11:30:48 +02:00
Jordi Sanfeliu
8b741129a5
Create monitorix-httpd
2021-04-14 11:26:52 +02:00
Jordi Sanfeliu
7d173b7ce0
Merge branch 'master' into updated-to-latest-jail.conf
2021-04-13 20:24:08 +02:00
sebres
6893d5a8b7
Merge remote-tracking branch 'remotes/gh-upstream/0.11' into master
2021-04-11 19:05:02 +02:00
Sergey G. Brester
d74dd9321b
Merge pull request #2565 from caronc/0.11
...
Add Apprise Support (50+ Notifications)
2021-04-04 00:24:21 +02:00
Sergey G. Brester
b2f6a3a658
remove unneeded substitution
...
it is enough to add `apprise` to action
2021-04-04 00:21:59 +02:00
Sergey G. Brester
ff09c52927
Merge pull request #2881 from stepodev/master
...
`filter.d/nginx-http-auth.conf` - extended with parameter mode, so additionally to `auth` (or `normal`) mode `fallback` (or combined as `aggressive`) can find SSL errors while SSL handshaking
2021-04-04 00:07:03 +02:00
Sergey G. Brester
dda70d60c0
Merge branch 'master' into master
2021-04-04 00:04:08 +02:00
Sergey G. Brester
c5d43d7573
Update ChangeLog
2021-04-04 00:00:59 +02:00
Michele Mondelli
7579072e3b
docs: fix typos
2021-04-03 23:49:23 +02:00
Sergey G. Brester
4eba9f2a4b
Merge pull request #2950 from sunweaver/pr/scanlogd-filter
...
Add support for filtering out detected port scans via scanlogd.
2021-04-03 23:36:14 +02:00
Sergey G. Brester
2d51240b3e
correction for default log interpolation and added allports banaction
2021-04-03 23:33:49 +02:00
Sergey G. Brester
977dfe4bd7
small amend: sport after saddr is optional
...
format of message: saddr[:sport] to daddr [and others,] ports port[, port...], ..., flags[, TOS TOS][, TTL TTL] @HH:MM:SS
2021-04-03 23:29:16 +02:00
Sergey G. Brester
14edeed310
fixed regex (don't need to match whole line, e. g. every port etc)
2021-04-03 23:24:55 +02:00
Sergey G. Brester
0c4d356d11
added test log-file
2021-04-03 23:10:51 +02:00
Sergey G. Brester
080dd12288
Merge pull request #2965 from oukb/patch-1
...
nsd.conf: fix for the current log format
2021-04-03 21:02:03 +02:00
Sergey G. Brester
a838deba7f
restore anchor (e. g. catch all in the middle), dot is optional now, RE rewritten a bit more precise
2021-04-03 21:00:14 +02:00
Sergey G. Brester
1215cb28ac
Update nsd
2021-04-03 20:58:26 +02:00
sebres
d445b5671d
Merge pull request #2642 from rolschewsky/mssql (and amend from sebres/mssql)
2021-04-03 20:28:18 +02:00
sebres
7f38b80d35
precise regex (left anchor and fewer catch-all's); fixed tests (added failJSON and more tests for some corner-cases around new RE)
2021-04-03 20:16:47 +02:00
Rüdiger Olschewsky
9eaa2322b0
Filter and Defaults for Microsoft SQL Server
2021-04-03 19:30:29 +02:00
Markus Felten
5aa20c30d8
fix: add journalmatch to nginx filters
2021-04-03 19:20:50 +02:00
j-marz
5d8f500471
updated formatting to pass tests
2021-03-29 08:36:53 +11:00
j-marz
2686811593
Updated zoneminder filter
...
Support new log format, ERR instead of WAR. Add detection of non-existent user login attempts
2021-03-28 21:19:10 +11:00
sebres
80a33b1dee
Merge branch '0.11'
2021-03-25 12:14:11 +01:00
sebres
b259e81911
test-suite: skip testFQDN if no network
2021-03-25 12:13:46 +01:00
sebres
d8e450cf12
Merge branch 'fix-readline-multibyte'
2021-03-25 12:13:18 +01:00
sebres
4b17dddc23
update ChangeLog
2021-03-25 12:07:34 +01:00
sebres
ccf4f3a07d
amend with common log-file iterator in fail2ban-regex and test-suite (in sample regex factory also)
2021-03-25 12:07:31 +01:00
sebres
9659033523
fail2ban-regex: reimplemented log-file iterator - uses FileContainer facilities now instead of direct read from file and decode;
...
fail2banregextestcase.py extended to cover proper line-ending handling by interim NL char as part of multi-byte encodings (utf-16be, utf-16le)
2021-03-25 12:07:29 +01:00
sebres
cbac7c176a
readline fixed to consider interim new-line character as part of code point in multi-byte logs (e. g. unicode: utf-16be, utf-16le);
...
suppress warning "Error decoding line" for incomplete line (produced by not fully read multi-byte new-line character at end of data);
added test coverage for such logs
2021-03-25 12:07:26 +01:00
sebres
6cf4669dee
Merge branch '0.10' into 0.11
2021-03-24 14:18:22 +01:00
sebres
d135aeea16
fixes restore of original logging withing tests (LogCaptureTestCase.tearDown) - python 3 seemed still to log wordy after tear down (setting of log.level does not restore the level for related log objects - e. g. for logger of fail2ban.jail etc, so fail2ban-testcases '(testVersion|testLongName).*servertest' generating messages in stdout handler in testLongName)
2021-03-24 14:14:47 +01:00
sebres
8757563be1
close fork
2021-03-23 14:20:10 +01:00
sebres
996920cdaa
in operation mode the filter reads only complete lines (ended with new-line) now, otherwise it would wait for end of line (for its completion)
2021-03-22 01:17:26 +01:00
sebres
061fab898a
Merge branch '0.10' into 0.11
2021-03-22 00:58:03 +01:00
sebres
e587526ede
tests: add missing constraint (causing incomplete comparison in below cycle if fewer lines as expected was found)
2021-03-22 00:56:40 +01:00
sebres
343ccd7e8a
small optimization
2021-03-21 23:35:38 +01:00
sebres
9bdc4be6cc
stability: better recognition of rotation (e. g. on hash collision, consider current size and last known position now), no hash of empty file (or not fulfilled line), etc;
...
performance: avoid unnecessary seek to start of file and hash calculation - now it occurs only if file really rotated (ino changing or size shrinking), otherwise not earlier than in 30 seconds;
avoid unneeded log-rotation in tests
2021-03-21 23:35:09 +01:00
sebres
725354c793
action info extended with new members for jail info (usable as tags in command actions):
...
`jail.found`, `jail.found_total` - current and total found failures
`jail.banned`, `jail.banned_total` - current and total bans
closes #10
2021-03-20 22:33:31 +01:00
oukb
529866b2bb
nsd.conf: fix for the current log format
...
New nsd 4.3.5 log format:
| [2021-03-05 05:25:14.562] nsd[160800]: info: axfr for example.com. from 192.35.168.32 refused, no acl matches
| [2021-03-06 05:24:33.223] nsd[356033]: info: axfr for localhost. from 192.35.168.160 refused, no acl matches
| [2021-03-07 05:23:26.641] nsd[547893]: info: axfr for example.com. from 192.35.168.64 refused, no acl matches
| [2021-03-08 05:18:54.067] nsd[739606]: info: axfr for example.com. from 192.35.168.32 refused, no acl matches
2021-03-08 19:14:28 +03:00
Mike Gabriel
f15ed35619
config/: Add support for filtering out detected port scans via scanlogd.
2021-03-05 16:35:13 +01:00
Sergey G. Brester
08393f9d82
Update filter_request.md
2021-03-03 20:28:27 +01:00
sebres
df5e024fb8
new issue templates
2021-03-03 20:16:34 +01:00
sebres
fb08534ed7
Merge branch '0.11'
2021-03-03 18:17:35 +01:00
sebres
3eaefe8da0
Merge branch '0.10' into 0.11
2021-03-03 18:16:47 +01:00
sebres
04aba6168c
fixed typo, -- is not expected in options declaration, so --dump-pretty did never work (only --dp is working)
2021-03-03 13:02:00 +01:00
sebres
a45b1c974c
filter.d/ignorecommands/apache-fakegooglebot: added timeout parameter (default 55 seconds) - avoid fail with timeout (default 1 minute) by reverse lookup on some slow DNS services (googlebots must be resolved fast);
...
closes gh-2951
2021-03-02 19:35:27 +01:00
sebres
63acc862b1
action.d/nginx-block-map.conf: reload nginx only if it is running (also avoid error in nginx-errorlog, gh-2949) and better test coverage for the action
2021-02-24 18:21:42 +01:00
sebres
fb6315ea5e
Merge branch '0.10' into 0.11
2021-02-24 13:16:36 +01:00
sebres
6f4b6ec8cc
action.d/badips.* removed (badips.com is no longer active, gh-2889)
2021-02-24 13:05:04 +01:00
sebres
e3d43d1241
Merge branch 'fix-rc-on-too-many-failures' into 0.10: resolves RC with uncontrolled growth of failure list (jail with too many matches that did not cause ban, gh-2945)
2021-02-24 12:45:15 +01:00
sebres
92a2242174
amend fixing journal tests (systemd backend only)
2021-02-23 15:54:48 +01:00
sebres
e353fb8024
fixed test cases (ban ASAP also followed in test suite now, so failure reached maxretry causes immediate ban now)
2021-02-23 02:46:44 +01:00
sebres
55d7d9e214
*WiP* try to solve RC on jails with too many failures without ban, gh-2945 ...
2021-02-22 18:39:58 +01:00
sebres
884cbbd6e1
Merge branch '0.11'
2021-02-17 19:04:23 +01:00
sebres
abc5a4e062
ChangeLog ( #2742 )
2021-02-17 19:02:22 +01:00
sebres
a0352182e8
Merge branch '0.10' into 0.11
2021-02-17 18:57:38 +01:00
sebres
294ec73f62
Merge branch 'py-3-10-alpha-5' into 0.10
2021-02-17 18:49:06 +01:00
Sergey G. Brester
9f1d1f4fbd
amend for Mapping (jails)
2021-02-17 18:47:42 +01:00
Sergey G. Brester
42dee38ad2
amend for Mapping
2021-02-17 18:47:40 +01:00
Sergey G. Brester
2b6bb2c1be
follow bpo-37324: :ref:collections-abstract-base-classes moved to the :mod:collections.abc module
...
(since 3.10-alpha.5 `MutableMapping` is missing in collections module)
2021-02-17 18:47:38 +01:00
Sergey G. Brester
8ae9208454
try to provide coverage for 3.10-alpha.5 ( #2931 )
2021-02-17 18:47:32 +01:00
Sergey G. Brester
a2f0dbad87
Merge pull request #2742 from aresxc/patch-1
...
Update drupal-auth.conf
2021-02-11 19:10:55 +01:00
Sergey G. Brester
f4f92aa72d
more tests covering different cases, injections attempt etc
2021-02-11 18:56:53 +01:00
Sergey G. Brester
d678440658
more precise RE (avoids weakness with catch-all's and is injection safe)
2021-02-11 18:32:32 +01:00
sebres
ea26509594
Merge branch '0.11'
2021-02-03 14:59:00 +01:00
sebres
6198b4566c
Merge branch '0.10' into 0.11
2021-02-03 14:47:56 +01:00
sebres
366c64cb9d
extractOptions: ensure options are parsed completely - avoids unexpected skip or truncate of parameters, produces more verbose error message in case of incorrect syntax; added more tests covering several cases
...
WARN: potential incompatibility (since it doesn't silently ignore wrong syntax anymore)
2021-02-03 14:45:30 +01:00
sebres
409348394e
Merge pull request #2913
...
Add transport to asterisk RE
2021-02-03 12:41:29 +01:00
Brian J. Murrell
7f185a828e
Update date in failJSON
...
The date format in failJSON is specific, so convert the date to use that format.
2021-01-31 15:22:16 +01:00
Brian J. Murrell
69c96c00c0
Log entries for updated failregex
...
Add a sample failregex.
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca >
2021-01-31 15:22:16 +01:00
Brian J. Murrell
dc4ee5aa47
Add transport to asterisk RE
...
Call rejection messages from Asterisk can have the transport prefixed to the IP address.
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca >
2021-01-31 15:22:16 +01:00
sebres
c75748c5d3
fail2ban.conf: added new fail2ban configuration option "allowipv6" (default auto), can be used to allow or disallow IPv6 interface in fail2ban immediately by start (e. g. if fail2ban starts before network interfaces).
...
closes gh-2804
2021-01-27 17:06:14 +01:00
sebres
3700a9e523
invalidate IP/DNS caches by reload, so inter alia would allow to recognize IPv6IsAllowed immediately, previously retarded up to cache max-time (5m);
...
closes gh-2804
2021-01-26 20:35:14 +01:00
sebres
21dd317870
Merge branch '0.11'
2021-01-21 19:13:13 +01:00
sebres
dbc77c47c3
Merge branch '0.10' into 0.11
2021-01-21 19:11:01 +01:00
sebres
913c37db80
more fixes and optimizations, better RE's for patterns, allow parse date without time with such a datepattern (assume 00:00:00 then), etc
2021-01-21 19:00:56 +01:00
sebres
0f44a3408a
amend to 747d468322:
...
fail2ban-regex: loosen up date patterns %ExY, %Exy - let accept every year from 19xx up to current century (+3 years)
2021-01-21 19:00:53 +01:00
Sergey G. Brester
164105fab1
added new parameter namespace for systemd backend
...
closes gh-2910
2021-01-16 17:10:12 +01:00
Sergey G. Brester
5f3f4d1e2f
action.d/cloudflare.conf: better IPv6 capability
...
closes gh-2891
2021-01-11 15:23:40 +01:00
sebres
9df332fdef
filter.d/apache-overflows.conf: extended to match AH00126 error (Invalid URI ...);
...
closes gh-2908
2021-01-11 15:10:53 +01:00
Michael Haro
2781e7b9d1
Add blank line so markdown renders correctly
2021-01-09 13:38:33 +01:00
Sergey G. Brester
2d4c3edeb6
Merge pull request #2906 from fail2ban/ci-py-3.10
...
CI: add python 3.10 (alpha) to github actions
2021-01-06 14:45:11 +01:00
Sergey G. Brester
c9907bef0d
CI: 3.10.0-alpha.4
2021-01-06 14:37:34 +01:00
Sergey G. Brester
097d9ea7fe
try wildcard (3.10 is still alpha)
2021-01-06 14:36:09 +01:00
Sergey G. Brester
3c8aa0e6ba
amend with correct yaml notation (float vs string)
2021-01-06 14:34:08 +01:00
Sergey G. Brester
0a7f5b7b5c
CI: add python 3.10 to github actions
2021-01-06 14:29:18 +01:00
sebres
e60b10392d
Merge branch '0.11' into master
2021-01-04 02:50:33 +01:00
sebres
f259dac747
Merge branch '0.10' into 0.11
2021-01-04 02:48:49 +01:00
sebres
747d468322
fixes century selector of %ExY and %Exy in datepattern for tests, considering interval from 2005 (alternate now) to now; + better grouping algorithm for resulting century RE
2021-01-04 02:45:16 +01:00
sebres
2c60d08b28
Merge '0.11' (fix gh-2899) into master
2020-12-29 21:27:02 +01:00
sebres
fe334590cd
Merge branch '0.10' into 0.11
2020-12-29 21:25:09 +01:00
sebres
73b39e0894
filter.d/named-refused.conf: fixes prefix for messages from systemd journal (no mandatory space ahead, because don't have timestamp)
...
closes gh-2899
2020-12-29 21:22:47 +01:00
Sergey G. Brester
6b5cc2dee8
Merge pull request #2898 from defanor/postscreen-pregreet-hangup
...
Handle postscreen's PREGREET and HANGUP messages in ddos and aggressive mode
2020-12-29 13:21:47 +01:00
defanor
ba7daef86c
Handle postscreen's PREGREET and HANGUP messages
...
Provoking those seems to be a popular activity among spammers.
2020-12-24 17:29:09 +03:00
Tim Gates
3bb19ecc9d
docs: fix simple typo, litle -> little
...
There is a small typo in fail2ban/client/fail2banclient.py, fail2ban/server/observer.py.
Should read `little` rather than `litle`.
2020-12-23 12:59:03 +01:00
sebres
7d256681a4
Merge branch '0.11' into master
2020-12-22 20:41:41 +01:00
sebres
567039f261
Merge branch '0.10' into 0.11
2020-12-22 20:40:52 +01:00
sebres
27e435a7f5
fix cymru test cases
2020-12-22 20:36:01 +01:00
stepodev
cecc3d62ff
add mode explanation to nginx-http-auth in jail.conf
2020-11-30 12:26:32 +01:00
stepodev
d0ba27cf46
move nginx-tls-fallback rules to nginx-http-auth
2020-11-30 12:14:49 +01:00
Sergey G. Brester
d959f6d199
Update nginx-tls-fallback.conf
...
more precise and conclusive regex without catch-all's
2020-11-26 12:25:32 +01:00
stepodev
c0256724a7
fix monitoring wrong error log. was access log, should be error.log
2020-11-25 21:30:21 +01:00
stepodev
27c40a77a3
add nginx-tls-downgrade
2020-11-25 20:59:43 +01:00
sebres
b8e8a87ee9
small amend to 0f27a8add8 - datedetector, strptime: token %Z recognizes all known zone abbreviation besides Z, GMT, UTC correctly, if it is matching (%z remains unchanged for backwards-compatibility, see comment in code); test cases fixed (PDT zone will be found now).
2020-11-24 20:23:39 +01:00
sebres
0f27a8add8
datedetector, strptime: token %Z must recognize zone abbreviation Z (GMT/UTC) also, similar to %z;
...
more test cases added.
2020-11-24 19:28:46 +01:00
sebres
a03109d096
Merge branch '0.11' into master (0.11.2 released)
2020-11-24 12:41:10 +01:00
sebres
eea1881b73
release 0.11.2 -- heal-the-world-with-security-tools
CI / build (2.7) (push) Canceled after 0s
CI / build (3.5) (push) Canceled after 0s
CI / build (pypy2) (push) Canceled after 0s
CI / build (3.6) (push) Canceled after 0s
CI / build (3.7) (push) Canceled after 0s
CI / build (3.8) (push) Canceled after 0s
CI / build (3.9) (push) Canceled after 0s
CI / build (pypy3) (push) Canceled after 0s
2020-11-23 21:43:03 +01:00
sebres
b78d1e439a
Merge branch '0.10' into 0.11
2020-11-23 21:35:32 +01:00
sebres
e768f8637a
release 0.10.6 -- just what the doctor ordered
CI / build (2.7) (push) Canceled after 0s
CI / build (3.5) (push) Canceled after 0s
CI / build (3.6) (push) Canceled after 0s
CI / build (3.7) (push) Canceled after 0s
CI / build (3.8) (push) Canceled after 0s
CI / build (3.9) (push) Canceled after 0s
CI / build (pypy2) (push) Canceled after 0s
CI / build (pypy3) (push) Canceled after 0s
2020-11-23 19:37:26 +01:00
sebres
79b61e009a
ChangeLog
2020-11-23 19:18:35 +01:00
Sergey G. Brester
753fff9c15
amend to #2750 , add jail for new filter nginx-bad-request
2020-11-23 18:38:41 +01:00
Sergey G. Brester
071048b8f2
Merge pull request #2750 from janprzy/master
...
Added filter nginx-bad-request
2020-11-23 18:28:07 +01:00
sebres
7965d652a1
filter.d/dovecot.conf: allow more verbose logging
...
closes #2573
2020-11-23 18:17:29 +01:00
sebres
a6de9459fc
typo
2020-11-23 18:08:38 +01:00
RyuaNerin
bba8844af8
typo
2020-11-23 18:07:49 +01:00
sebres
31a4a27ee3
better assert message in sample regex factory
2020-11-23 18:06:13 +01:00
Sergey G. Brester
fe716743ed
Merge pull request #2795 from mateusz834/managesieve-dovecot
...
add managesieve and submission support in dovecot filter
2020-11-23 17:50:16 +01:00
sebres
8672950c15
added test cases covering PR #2795
2020-11-23 17:47:47 +01:00
mpoliwczak834
595ee7ed74
add submission
2020-11-23 17:42:12 +01:00
mpoliwczak834
0c12cb7970
add managesieve support dovecot filter
2020-11-23 17:42:11 +01:00
sebres
cc64ef25f6
filter.d/apache-noscript.conf: extended to match "script not found" with error AH02811 (and cgi-bin path segment in script)
...
closes gh-2805
2020-11-23 17:25:41 +01:00
sebres
5d0e74d2ab
man/jail.conf.5: documentation extended (prefregex, etc)
...
closes gh-2820
2020-11-23 16:55:55 +01:00
sebres
d04c6c13ed
merge point
2020-11-23 15:02:05 +01:00
sebres
a107a8e7d2
setup.py: cherry-pick from 0.11 (option --without-tests)
2020-11-23 14:59:45 +01:00
sebres
1cefb7fdc6
setup.py: small amend to d2d3762ba9: allow build without tests also (both build and install accepting --without-tests option now)
2020-11-23 14:45:24 +01:00
sebres
f5ea40c7da
Merge branch '0.11' into master
2020-11-11 11:19:05 +01:00
sebres
adbfdc222d
Merge branch '0.10' into 0.11
2020-11-11 11:17:15 +01:00
sebres
ca4da9d1d3
actions: extend tags replacement in non ticket-based commands (actionstart, actionstop, etc);
...
fixes regression by interpolation of tag `<bantime>` introduced in 0.11 with dynamic bantime (due to `bantime.increment`, see #2869 )
2020-11-11 11:08:23 +01:00
Sergey G. Brester
9c8dcbd6eb
Merge pull request #2855 from benrubson/grafana
...
Add Grafana jail
2020-11-10 15:12:46 +01:00
Sergey G. Brester
1c1a9b868c
no catch-alls, user name and error message stored in ticket
2020-11-09 15:36:30 +01:00
benrubson
840f0ff10a
Add Grafana jail
2020-11-09 15:31:06 +01:00
Sergey G. Brester
267cbf5861
Merge pull request #2778 from Mart124/bitwarden
...
Add Bitwarden syslog support
2020-11-09 13:47:04 +01:00
sebres
25e006e137
review and small tweaks (more precise and safe RE)
2020-11-09 13:43:59 +01:00
Mart124
2a18b82f5f
Support alternative Bitwarden log format
2020-11-09 13:34:41 +01:00
Mart124
df659a0cbc
Add Bitwarden syslog support
2020-11-09 13:34:39 +01:00
Sergey G. Brester
472bdc437b
Merge pull request #2723 from benrubson/softether
...
Add SoftEtherVPN jail
2020-11-09 13:23:25 +01:00
Sergey G. Brester
010e76406f
small tweaks (both 2nd time and facility are optional, avoid catch-all, etc)
2020-11-09 13:19:25 +01:00
sebres
9f635c66fb
Merge branch '0.11' into master
2020-11-09 12:45:54 +01:00
sebres
66ff90408f
Merge branch '0.10' into 0.11
2020-11-09 12:45:29 +01:00
sebres
d4adec7797
Merge branch '0.9' into 0.10
2020-11-09 12:44:07 +01:00
sebres
5430091acb
jail counter-strike: removed link to site with redirect to malicious page (gh-2868)
2020-11-09 12:43:34 +01:00
benrubson
ec873e2dc3
Add SoftEtherVPN jail
2020-11-05 23:56:30 +01:00
sebres
e700ccc667
filter apache-modsecurity: added coverage for different log-format (apache 2.4 and php-fpm, gh-2717)
2020-11-05 16:51:49 +01:00
sebres
690ad20958
Merge branch '0.11' into master
2020-11-05 16:16:17 +01:00
sebres
6ef69b48ca
Merge branch '0.10' into 0.11
2020-11-05 16:12:31 +01:00
sebres
55d6408b13
tweaks to speedup test-cases (test-suite seems to be time stable now, so we could shorten sleeping intervals)
2020-11-05 15:31:11 +01:00
sebres
7f0010be68
attempt to install systemd-python module
2020-11-05 14:12:39 +01:00
Sergey G. Brester
7cb6412f68
1st try of GH actions flow (CI only, no coverage atm)
2020-11-05 14:12:37 +01:00
Sergey G. Brester
9d77fb2b4c
1st try of GH actions flow (CI only, no coverage atm)
2020-11-03 15:38:06 +01:00
Sergey G. Brester
a07e6fe1a2
reduce default maxmatches from 50 to 5: avoid too large memory consumption if maxretry is large and many failures don't cause ban (but accumulated in fail-manager with all the matched lines);
...
closes gh-2843
2020-10-30 14:17:47 +01:00
sebres
02525d7b6f
filter.d/sshd.conf: mode ddos (and aggressive) extended with new rule closing flood attack vector, matching:
...
error: kex_exchange_identification: Connection closed by remote host
(gh-2850)
2020-10-08 21:07:51 +02:00
sebres
c8059bf9b3
ban/unban: increase responsiveness of actions thread by (un)banning process, better waiting timeout considering pending tickets for unban (_nextUnbanTime)
2020-09-29 16:27:17 +02:00
sebres
2817a8144c
action.d/bsd-ipfw.conf: small amend (gh-2836) simplifying awk condition/code (position starts from <lowest_rule_num> and increases whilst used)
2020-09-29 13:33:40 +02:00
sebres
1418bcdf5b
action.d/bsd-ipfw.conf: fixed selection of rule-no by large list or initial lowest_rule_num, exit code can't be larger than 255 (gh-2836)
2020-09-29 12:35:49 +02:00
sebres
960e30cfcd
Merge branch '0.11'
2020-09-23 19:41:04 +02:00
sebres
d253e60a8b
Merge branch '0.10' into 0.11
2020-09-23 19:39:50 +02:00
sebres
24093de32d
small amend (simplifying formatted help and man)
2020-09-23 19:35:17 +02:00
Nathan Henrie
f518d42c59
Add a note about journalflags options to systemd-journal backend
...
Also adds systemd backend configuration examples to jail.conf(5)
Closes #2696
2020-09-23 19:09:42 +02:00
sebres
4c2539856c
Merge branch 'speedup-client-status' into 0.10
2020-09-23 13:03:45 +02:00
Sergey G. Brester
d977d81ef7
action.d/abuseipdb.conf: removed broken link, simplified usage example, fixed typos
2020-09-17 12:39:08 +02:00
sebres
f381b98246
introduces new flavor short for fail2ban-client status $jail short: output total and current counts only, without banned IPs list in order to speedup it and to provide more clear output (gh-2819), flavor basic (still default) is unmodified for backwards compatibility;
...
it can be changed later to `short`, so for full list of IPs in newer version one should better use:
- `fail2ban-client status $jail basic`
- `fail2ban-client get $jail banned` or `fail2ban-client banned`
2020-09-10 11:53:26 +02:00
sebres
e8ee3ba544
resolves a bottleneck within transmitting of large data between server and client: speedup search of communications end-marker and increase max buffer size (up to 32KB)
2020-09-10 11:52:25 +02:00
sebres
5abc4ba4ae
amend to 39d4bb3c35 ( #2758 ): better reaction on broken pipe (on long output), don't close stdout explicitly (allows usage of modules like cProfile, which outputs result on exit), just flush it before exit.
2020-09-09 17:32:10 +02:00
sebres
f555ff45e9
attempt to speedup ban- and fail-manager (e. g. fail2ban-client status, see gh-2819), remove unneeded lock (GIL is enough here)
2020-09-07 19:08:52 +02:00
sebres
74b73bce8a
Merge branch '0.10' into 0.11
2020-09-04 13:09:47 +02:00
sebres
a038fd5dfe
action.d/firewallcmd-*.conf (multiport only): fixed port range selector, replacing : with -;
...
small optimizations on `firewallcmd-rich-rules.conf` and `firewallcmd-rich-logging.conf` simplifying both and provide a dependency (rich-logging is a derivative of rich-rules);
closes gh-2821
2020-09-03 16:41:23 +02:00
Sergey G. Brester
70c601e9e5
involve config parameter (replaces hard-coded path); fixed typo in actionban (looks like copy&paste from trimmed tty)
2020-09-02 20:47:05 +02:00
sebres
4d2734dd86
Merge branch '0.10' into 0.11
2020-09-02 20:23:07 +02:00
sebres
ed20d457b2
jail.conf: removed action parameter name that set on jail-name (name=%(__name__)s is default in action reader)
2020-09-02 20:14:31 +02:00
sebres
f09ba1b399
action in jail-config extended to consider space as separator now (splitWithOptions separates by space between mains words, but not in options), so defining action = a b would specify 2 actions a and b;
...
it is additionally more precise now (see fixed typo with closed bracket `]` instead of comma in testServerReloadTest)
2020-09-02 20:09:06 +02:00
sebres
a3a148078e
fail2ban-regex: more informative output for datepattern (e. g. set from filter) - pattern : description, example:
...
Use datepattern : ^%Y-%m-%d %H:%M:%S : ^Year-Month-Day 24hour:Minute:Second
2020-08-28 14:12:57 +02:00
sebres
17a6ba44b3
fail2ban-regex: speedup formatted output (bypass unneeded stats creation);
...
fail2ban-regex: extended with prefregex statistic
2020-08-28 13:52:09 +02:00
sebres
db1f3477cc
amend to 3f04cba9f9: sendmail-auth has 2 failregex now, so rewritten with prefregex
2020-08-27 18:07:42 +02:00
sebres
3f04cba9f9
filter sendmail-auth extended to follow new authentication failure message introduced in sendmail 8.16.1, AUTH_FAIL_LOG_USER (gh-2757)
2020-08-27 17:44:25 +02:00
sebres
07fa9f2912
fixes gh-2787: allow to match did not issue MAIL/EXPN/VRFY/ETRN during connection non-anchored with extra mode (default names may deviate);
...
additionally provides common addr-tag for IPv4/IPv6 (`(?:IPv6:<IP6>|<IP4>)`) and test-coverage for IPv6
2020-08-27 17:04:19 +02:00
sebres
d0d1f8c362
improve result for get/set prefregex
2020-08-26 16:54:18 +02:00
sebres
8bc7623388
Merge branch '0.11'
2020-08-26 13:49:41 +02:00
sebres
be3115cda0
fix year overflow (9999) by format of datetime (time2str for end of ban of persistent ticket);
...
closes gh-2817
2020-08-26 13:31:29 +02:00
sebres
b2036c1d62
Merge branch '0.10' into 0.11
2020-08-26 12:22:17 +02:00
sebres
e569281d6b
avoids overwrite of known/option with unmodified (not available) value of option from .local config file,
...
so it wouldn't cause self-recursion if `option` already has a reference to `known/option` (from some include) in .conf file;
closes gh-2751
2020-08-26 12:08:04 +02:00
sebres
5a2cc4e1c5
substituteRecursiveTags: more precise self- or cyclic-recursion prevention (don't clear replacement counts of tags, rather consider replacement count by tax X in tag Y)
2020-08-26 12:05:20 +02:00
sebres
e9071b642a
Merge branch '0.10' into 0.11
2020-08-25 18:28:18 +02:00
Sergey G. Brester
81fb28e146
Merge pull request #2631 from benrubson/guacamole
...
`filter.d/guacamole.conf` extended with `logging` parameter to follow webapp-logging if it's configured
2020-08-25 18:27:18 +02:00
sebres
2945fe8cbd
changelog
2020-08-25 18:25:32 +02:00
sebres
d9b8796792
amend with better (common) handling, documentation and tests
2020-08-25 18:01:34 +02:00
sebres
7b05c1ce7a
do type-convert only in getCombined (otherwise int/bool conversion prevents substitution or section-related interpolation of tags)
2020-08-25 14:52:22 +02:00
benrubson
1707560df8
Enhance Guacamole jail
2020-08-25 13:01:50 +02:00
sebres
41b88b4f4f
Merge branch '0.10' into 0.11
2020-08-24 16:42:19 +02:00
TorontoMedia
1e3da21c68
Remove duplicate method and rename invalid parameter
...
(cherry picked from commit fd25c4cbb8 )
2020-08-24 16:41:55 +02:00
sebres
ad51fb7e1e
partial cherry-pick fd25c4cbb8 ( #2768 )
2020-08-24 16:41:22 +02:00
Sergey G. Brester
57caf8ec90
Merge pull request #2768 from TorontoMedia/patch
...
Remove duplicate method and rename invalid parameter
2020-08-24 16:39:25 +02:00
sebres
7327fee2c8
Merge branch '0.11'
2020-08-24 16:33:30 +02:00
sebres
4bc8bc9d5f
Merge branch '0.10' into 0.11
2020-08-24 16:31:48 +02:00
Sergey G. Brester
8da663a67e
Merge pull request #2814 from sebres/0.10-date-opt
...
extended datepattern handling (TZ issues, no datepattern, etc)
2020-08-24 16:27:35 +02:00
sebres
295630cccf
documentation and changelog
2020-08-24 16:12:55 +02:00
sebres
76e5d2b199
amend to f21c58dc72, better follow previous handling with last known datetime (compatibility for multi-line logs, in case of second line without a timestamp)
2020-08-21 17:53:02 +02:00
sebres
f21c58dc72
implements special datepattern {NONE} - allow to find failures without date-time in log messages (filter use now as timestamp)
...
closes gh-2802
2020-08-20 20:28:29 +02:00
sebres
b82f584a96
added test case covering new date handling (simulation, unknown format, warnings, etc)
2020-08-20 19:46:41 +02:00
sebres
d2cef96f33
filter: implement mode inOperation, which gets activated if filter starts processing of new messages; better interaction with non-matching optional datepattern or invalid timestamps (or timezone) - assuming now instead of bypass;
...
fixed test cases gathering new failures now in operation mode
2020-08-20 18:52:00 +02:00
sebres
7e8d98c4ed
code review, fix simplest TZ issue - avoid date adjustment by assuming of last year (date without year in the future) by wrong zone (don't adjust by offset up to +24 hours)
2020-08-13 19:20:27 +02:00
sebres
3ca69c8c0a
amend to #2791 : unban subnet when subnet is in supplied subnet
2020-08-11 17:14:21 +02:00
sebres
7d172faa50
implements gh-2791: fail2ban-client extended to unban IP range(s) by subnet (CIDR/mask) or hostname (DNS)
2020-08-11 16:01:52 +02:00
sebres
39d4bb3c35
closes gh-2758: no explicit flush (close std-channels on exit, it would cause implicit flush without to produce an error 32 "Broken pipe" on closed pipe)
2020-08-11 13:57:36 +02:00
sebres
a7ad3e00dd
amend to 91eca4fdeb ( #2634 ): server creates a RTM-directory for socket/pid file automatically (don't check its existence in client)
2020-08-11 11:58:02 +02:00
Chris Caron
2216fd8da4
Add Apprise Support (50+ Notifications)
2020-08-04 19:04:05 -04:00
sebres
1ea36c3045
Merge branch '0.11'
2020-08-04 17:19:51 +02:00
sebres
9d076af9a2
Merge branch '0.11-combine-multiple-captures' into 0.11
2020-08-04 17:15:28 +02:00
sebres
98983adf76
update ChangeLog
2020-08-04 17:14:13 +02:00
sebres
067b76fc9e
Merge branch '0.10' into 0.11
2020-08-04 15:40:59 +02:00
sebres
253d47d33c
compat: some 2.x pypy versions produce UnicodeEncodeError: 'ascii' codec can't encode character on surrogates (uni_string must be fixed also for UTF-8 system encoding)
2020-08-04 15:08:02 +02:00
sebres
9510346507
typo in skip message
2020-08-04 14:31:11 +02:00
sebres
0ef8f6675d
fix travis builds (pipy in xenial, don't error if doc missing in default path after install)
2020-08-04 14:25:31 +02:00
sebres
9100d07c03
Merge branch '0.10-ipset-tout' into 0.10, amend to #2703 : resolves names conflict (command action timeout and ipset timeout); closes #2790
2020-08-04 13:53:21 +02:00
sebres
62a6771b33
Merge remote-tracking branch 'sebres:0.10' into 0.10; closes gh-2763
...
action.d/nftables.conf (type=multiport only): fixed port range selector (replacing `:` with `-`)
2020-08-04 13:51:20 +02:00
sebres
73a8175bb0
resolves names conflict (command action timeout and ipset timeout); closes gh-2790
2020-08-04 13:22:02 +02:00
Sergey G. Brester
ea35f2ad75
default loglevel is INFO
2020-07-03 13:47:46 +02:00
Sergey G. Brester
08dbe4abd5
fixed comment for loglevel, default is INFO
2020-07-03 13:45:29 +02:00
TorontoMedia
fd25c4cbb8
Remove duplicate method and rename invalid parameter
2020-06-28 12:58:41 -04:00
sebres
309c8dddd7
action.d/nftables.conf (type=multiport only): fixed port range selector (replacing : with -)
2020-06-24 19:20:36 +02:00
Jan Przybylak
56fefe9240
Added test file "nginx-bad-request"
...
I tested with `./fail2ban-testcases testSampleRegex`, which did not return any errors.
2020-06-21 18:25:27 +02:00
Jan Przybylak
a5ab4406d8
Removed unnecessary escape sequence
...
This commit also contains changes to match requests that are 100% empty (by using "*" instead of "+" in the regex)
2020-06-21 18:24:09 +02:00
sebres
ec3000798d
ensure that set of alternate tags or combine tuple tags take place ordered (sort the lists by its name or index)
2020-06-12 21:25:42 +02:00
sebres
dd8081ade5
extends capturing alternate tags in filter, implementing new tag prefix <F-TUPLE_ (that would combine value of <F-V> with all value of <F-TUPLE_V?_n?> tags), for examples see new tests in fail2banregextestcase;
...
closes gh-2755 (extends #1454 and #1698 ).
2020-06-12 20:00:42 +02:00
Jan Przybylak
d7ef5d166d
Removed vulnerable catchall & anchor
2020-06-11 16:44:48 +02:00
sebres
78fc99ec7e
Merge branch '0.11'
2020-06-11 12:52:34 +02:00
sebres
1da9ab78be
Merge branch '0.10' into 0.11
2020-06-11 12:52:13 +02:00
sebres
5a0edf61c9
filter.d/sshd.conf: normalizing of user pattern in all RE's, allowing empty user (gh-2749)
2020-06-08 14:38:26 +02:00
Jan Przybylak
3c83c19070
Added filter nginx-bad-request
2020-06-06 19:51:46 +02:00
aresdr
412120ac3c
Update drupal-auth.conf
...
Small fix for Drupal 8. D8 uses "Login attempt failed from" while D7 uses "Login attempt failed for".
The referer part is a must currently, but some requests did not have one and are not failing.
2020-05-30 15:25:31 -07:00
sebres
9b6da03c90
amend to e786dbf132: removes space between name and [pid] by normal non-verbose logging, padding without truncate now; test coverage for getVerbosityFormat;
...
closes #2734
2020-05-26 13:14:37 +02:00
sebres
6cff2bb007
Merge branch '0.11'
2020-05-25 19:09:29 +02:00
sebres
1588200274
Merge branch '0.10' into 0.11
2020-05-25 18:58:05 +02:00
sebres
b8e2b77265
Merge branch '0.10-extend-proto-banned' into 0.10
2020-05-25 15:04:12 +02:00
sebres
fa1ff4c5d8
assertSortedEqual: fixed sort of nested lists, switch default of nestedOnly to False (comparison of unsorted lists is rarely needed)
2020-05-25 14:45:24 +02:00
sebres
54b2208690
extends protocol/client with banned status (retrieve information whether an IP is banned and/or in which jails), implements FR gh-2725
2020-05-20 16:31:54 +02:00
sebres
0ae2ef68be
ensure iterator is safe (traverse over the list in snapshot created within a lock), avoids getting modified state as well as "dictionary changed size during iteration" errors
2020-05-20 15:36:06 +02:00
sebres
afb7a93163
amend to 368aa9e775: fix time in gitlab test (GMT in log due to TZ-suffix Z, CEST in test-suite)
2020-05-20 15:27:48 +02:00
Sergey G. Brester
43f699b872
grammar / typos
2020-05-06 17:32:13 +02:00
Sergey G. Brester
368aa9e775
Merge pull request #2689 from benrubson/gitlab
...
New Gitlab jail
2020-05-04 19:19:13 +02:00
Sergey G. Brester
f2aec43d8a
Merge pull request #2140 from szepeviktor/patch-9
...
CloudFlare started to indent their API responses
2020-04-27 19:39:27 +02:00
Sergey G. Brester
42aef09d69
Update ChangeLog
2020-04-27 19:38:48 +02:00
Sergey G. Brester
01e92ce4a6
added fallback using tr and sed (jq is optional now)
2020-04-27 19:26:46 +02:00
Sergey G. Brester
1c1b671c74
Update cloudflare.conf
2020-04-27 19:26:44 +02:00
Sergey G. Brester
5b8fc3b51a
cloudflare: fixes ip to id conversion by unban using jq
...
normalized URIs and parameters, notes gets a jail-name (should be possible to differentiate the same IP across several jails)
2020-04-27 19:26:43 +02:00
Viktor Szépe
852670bc99
CloudFlare started to indent their API responses
...
We need to use https://github.com/stedolan/jq to parse it.
2020-04-27 19:26:39 +02:00
Ilya
8b3b9addd1
Change tool from 'cut' to 'sed'
...
Sed regex was tested - it works.
2020-04-27 19:12:36 +02:00
Ilya
5da2422f61
Fix actionunban
...
Add command to remove new line character. Needed for working removing rule from cloudflare firewall.
2020-04-27 19:12:35 +02:00
Sergey G. Brester
fe84b158a5
Merge pull request #2703 from sebres/0.10-ipset-tout
...
0.10 / ipset timeout removal
2020-04-26 12:39:37 +02:00
Sergey G. Brester
da1652d0d7
Update ChangeLog
2020-04-26 12:26:55 +02:00
sebres
12be3ed77d
test cases fixed
2020-04-25 15:17:42 +02:00
sebres
87a1a2f1a1
action.d/*-ipset*.conf: several ipset actions fixed (no timeout per default anymore), so no discrepancy between ipset and fail2ban (removal from ipset will be managed by fail2ban only)
2020-04-25 14:52:38 +02:00
sebres
6b90ca820f
filter.d/traefik-auth.conf: filter extended with parameter mode (normal, ddos, aggressive) to handle the match of username differently:
...
- `normal`: matches 401 with supplied username only
- `ddos`: matches 401 without supplied username only
- `aggressive`: matches 401 and any variant (with and without username)
closes gh-2693
2020-04-23 13:08:24 +02:00
sebres
affd9cef5f
filter.d/courier-smtp.conf: prefregex extended to consider port in log-message (closes gh-2697)
2020-04-21 13:32:17 +02:00
sebres
06b46e92eb
jail.conf: don't specify action directly in jails (use action_ or banaction instead);
...
no mails-action added per default anymore (e. g. to allow that `action = %(action_mw)s` should be specified per jail or in default section in jail.local), closes gh-2357;
ensure we've unique action name per jail (also if parameter `actname` is not set but name deviates from standard name, gh-2686);
don't use %(banaction)s interpolation because it can be complex value (containing `[...]`), so would bother the action interpolation.
2020-04-15 19:00:49 +02:00
sebres
7e3061e7ac
fail2ban.service systemd unit template: don't add user site directory to python system path (avoids accessing of /root/.local directory, prevents SE linux audit warning at daemon startup, gh-2688)
2020-04-15 17:35:04 +02:00
Sergey G. Brester
78651de7e5
Update ChangeLog
2020-04-14 12:25:18 +02:00
benrubson
2912bc640b
New Gitlab jail
2020-04-09 16:42:08 +02:00
sebres
136781d627
filter.d/sshd.conf: fixed regex for mode extra - "No authentication methods available" (supported seems to be optional now, gh-2682)
2020-04-08 12:17:59 +02:00
sebres
d21a24de8e
more test cases for IP/DNS (and use dummies if no-network set by testing)
2020-04-06 12:39:36 +02:00
sebres
fc175fa78a
performance: optimize simplest case whether the ignoreip is a single IP (not subnet/dns) - uses a set instead of list (holds single IPs and subnets/dns in different lists);
...
decrease log level for ignored duplicates (warning is too heavy here)
2020-04-06 12:12:23 +02:00
Jordi Sanfeliu
ede2009708
added new jail (and filter) Monitorix
2020-04-03 12:52:19 +02:00
sebres
343ec1cdd2
test-causes: avoid host-depending issue (mistakenly ignoring IP 127.0.0.2 as own address) - replace loop-back addr with test sub-net addr (and disable ignoreself)
2020-03-18 20:40:31 +01:00
sebres
38b32a9a72
Merge branch '0.10' into 0.11
2020-03-18 19:53:55 +01:00
sebres
22a04dae05
Merge branch '0.9' into 0.10 (gh-2246)
2020-03-18 16:11:53 +01:00
Sergey G. Brester
b1e1cab4b7
Merge pull request #2246 from shaneforsythe/shaneforsythe-patch-2
...
Improve regex in proftpd.conf
2020-03-18 15:49:18 +01:00
sebres
606bf110c9
filter.d/sshd.conf (mode ddos): fixed "connection reset" regex (seems to have same syntax now as closed), so both regex's combined now to single RE
...
(closes gh-2662)
2020-03-16 17:31:39 +01:00
sebres
6e570b8644
Merge branch '0.11'
2020-03-13 23:23:32 +01:00
sebres
5b16973f08
Merge branch '0.10' into 0.11
2020-03-13 23:23:03 +01:00
sebres
8547ea7ea0
resolve sporadic minor issue - check pending can refresh watcher (monitor) that gets deleting, and there may be no wdInt to delete
2020-03-13 23:16:04 +01:00
sebres
9905904bba
Merge branch '0.11'
2020-03-13 22:43:22 +01:00
sebres
00c5d33e45
Merge branch '0.10' into 0.11
2020-03-13 22:39:19 +01:00
sebres
b64a435b0e
ignore only not banned old (repeated and ignored) tickets
2020-03-13 22:34:15 +01:00
sebres
b43dc147b5
amend to RC-fix 9f1c6f1617 (gh-2660):
...
resolves bottleneck by initial scanning of a lot of messages (or evildoers generating many messages) causes repeated ban, that will be ignored but could cause entering of "long" sleep in actions thread previously;
speedup recognition banning queue has entries to begin check-ban process in actions thread
2020-03-13 22:22:42 +01:00
sebres
bc2b81133c
pyinotify backend: guarantees initial scanning of log-file by start (retarded via pending event if filter not yet active)
2020-03-13 22:07:32 +01:00
sebres
68f827e1f3
small optimization for manually (via client / protocol) signaled attempt (performBan only if maxretry gets reached)
2020-03-13 18:03:27 +01:00
sebres
4c22d4a801
Merge branch '0.11'
2020-03-13 17:47:03 +01:00
sebres
d42ec210cc
Merge branch '0.10' into 0.11
2020-03-13 17:44:29 +01:00
sebres
9f1c6f1617
filter stability fix: prevent race condition - no ban if filter (backend) is continuously busy if too many messages will be found in log, e. g. initial scan of large log-file or journal (gh-2660)
2020-03-13 17:34:37 +01:00
sebres
ab363a2c0e
small amend with fix still one test (ban unexpected in this old artificial test-cases, todo - such tests should be rewritten or removed)
2020-03-13 17:28:33 +01:00
sebres
e3737bb7c0
filter stability fix: prevent race condition - no ban if filter (backend) is continuously busy if too many messages will be found in log, e. g. initial scan of large log-file or journal (gh-2660)
2020-03-13 17:20:19 +01:00
Sergey G. Brester
428c75d1cd
Merge pull request #2651 from fail2ban/0.10-travis-3.9-dev
...
python 3.9 compatibility + CI
2020-03-06 20:46:02 +01:00
Sergey G. Brester
d4da9afd7f
Update ChangeLog
2020-03-06 20:29:48 +01:00
Sergey G. Brester
9d7388e684
Thread: is_alive instead of isAlive (removed in py-3.9)
2020-03-06 20:04:18 +01:00
Sergey G. Brester
55e76c0b80
restore isAlive method removed in python 3.9
2020-03-06 19:41:16 +01:00
Sergey G. Brester
781a25512b
travis CI: add 3.9-dev as target
2020-03-06 19:04:39 +01:00
sebres
8b43d54878
Merge branch '0.11'
2020-03-05 14:32:42 +01:00
sebres
32f02ef3b3
Merge branch '0.10' into 0.11
2020-03-05 14:01:14 +01:00
sebres
42714d0849
filter.d/common.conf: closes gh-2650, avoid substitute of default values in related lt_* section, __prefix_line should be interpolated in definition section (after the config considers all sections that can overwrite it);
...
amend to 62b1712d22 (PR #2387 , backend-related option `logtype`);
testSampleRegexsZZZ-GENERIC-EXAMPLE covering now negative case also (other daemon in prefix line)
2020-03-05 13:47:11 +01:00
sebres
2ddf687c31
Merge branch '0.10' into 0.11 - test cases only (add ban to database was moved to observer in 0.11)
2020-03-02 19:17:16 +01:00
sebres
15158e4474
closes gh-2647: add ban to database is moved from jail.putFailTicket to actions.__CheckBan; be sure manual ban is written to database, so can be restored by restart; reload/restart test extended
2020-03-02 18:58:59 +01:00
sebres
f088e7bf76
Merge branch '0.10' into 0.11
2020-03-02 17:10:48 +01:00
sebres
6281dc3633
failmanager, ticket: avoid reset of retry count by pause between attempts near to findTime - adjust time of ticket will now change current attempts considering findTime as an estimation from rate by previous known interval (if it exceeds the findTime);
...
this should avoid some false positives as well as provide more safe handling around `maxretry/findtime` relation especially on busy circumstances.
2020-03-02 17:05:00 +01:00
sebres
4766547e1f
performance optimization of datepattern (better search algorithm);
...
datetemplate: improved anchor detection for capturing groups `(^...)`; introduced new prefix `{UNB}` for `datepattern` to disable word boundaries in regex;
datedetector: speedup special case if only one template is defined (every match wins - no collision, no sorting, no other best match possible)
2020-02-28 14:27:21 +01:00
sebres
ef1eaf9b37
Merge branch '0.11'
2020-02-25 17:18:50 +01:00
sebres
c15c300d2a
Merge branch '0.10' into 0.11
2020-02-25 17:11:29 +01:00
sebres
e6ca04ca9d
Merge branch '0.10' into 0.11 + version bump (back to dev)
2020-02-25 16:10:31 +01:00
Sergey G. Brester
2e42b98cd3
Merge pull request #2638 from gurnec/pypy-ulimit-fix
...
close Popen() pipes explicitly for PyPy
2020-02-25 15:31:31 +01:00
sebres
6c6cf2a956
small amend (avoid possible error by close of not existing pipe)
2020-02-25 15:06:04 +01:00
Christopher Gurnee
df885586d4
close Popen() pipes explicitly for PyPy
...
Waiting for garbage collection to close pipes opened by Popen() can
lead to "Too many open files" errors with PyPy; close them explicitly.
2020-02-25 14:55:10 +01:00
sebres
e57e950ef5
version bump (back to dev)
2020-02-25 14:51:54 +01:00
sebres
ab3a7fc6d2
filter.d/sshd.conf: mode ddos (and aggressive) extended to detect port scanner sending unexpected ident string after connect
2020-02-17 16:24:42 +01:00
sebres
35591db3e8
Merge branch '0.11'
2020-02-14 12:14:51 +01:00
sebres
7282cf91b0
Merge branch '0.10' into 0.11
2020-02-14 12:13:29 +01:00
sebres
b3644ad413
code normalization and optimization (strip of trailing new-line, date parsing, ignoreregex mechanism, etc)
2020-02-13 21:52:54 +01:00
sebres
91eca4fdeb
automatically create not-existing path (last level folder only) for pidfile, socket and database (with default permissions)
2020-02-13 13:50:17 +01:00
sebres
14e68eed72
performance: set fetch handler getGroups depending on presence of alternate tags in RE (simplest variant or merged with alt-tags) in regex constructor
2020-02-13 12:31:15 +01:00
sebres
9137c7bb23
filter processing:
...
- avoid duplicates in "matches" (previously always added matches of pending failures to every next real failure, or nofail-helper recognized IP, now first failure only);
- several optimizations of merge mechanism (multi-line parsing);
fail2ban-regex: better output handling, extended with tag substitution (ex.: `-o 'fail <ip>, user <F-USER>: <msg>'`); consider a string containing new-line as multi-line log-excerpt (not as a single log-line)
filter.d/sshd.conf: introduced parameter `publickey` (allowing change behavior of "Failed publickey" failures):
- `nofail` (default) - consider failed publickey (legitimate users) as no failure (helper to get IP and user-name only)
- `invalid` - consider failed publickey for invalid users only;
- `any` - consider failed publickey for valid users too;
- `ignore` - ignore "Failed publickey ..." failures (don't consider failed publickey at all)
tests/samplestestcase.py: SampleRegexsFactory gets new failJSON option `constraint` to allow ignore of some tests depending on filter name, options and test parameters
2020-02-13 12:28:07 +01:00
sebres
1492ab2247
improve processing of pending failures (lines without ID/IP) - fail2ban-regex would show those in matched lines now (as well as increase count of matched RE);
...
avoid overwrite of data with empty tags by ticket constructed from multi-line failures;
amend to d1b7e2b5fb : better output (as well as ignoring of pending lines) using `--out msg`;
filter.d/sshd.conf: don't forget mlf-cache on "disconnecting: too many authentication failures" - message does not have IP (must be followed by "closed [preauth]" to obtain host-IP).
2020-02-11 18:44:36 +01:00
Sergey G. Brester
ac8e8db814
travis: switch 3.8-dev to 3.8 (released)
2020-02-11 14:18:58 +01:00
Sergey G. Brester
d7643fe538
Merge pull request #2630 from fail2ban/gh-2200-postfix
...
filter.d/postfix.conf: extended mode ddos and aggressive covering multiple disconnects without auth
2020-02-11 12:44:21 +01:00
Sergey G. Brester
88cf5bcd93
Update postfix
2020-02-10 13:41:28 +01:00
Sergey G. Brester
774dda6105
filter.d/postfix.conf: extended mode ddos and aggressive covering multiple disconnects without auth
2020-02-10 13:29:16 +01:00
Sergey G. Brester
34d63fccfe
close gh-2629 - jail.conf (action_blocklist_de interpolation): replace service parameter (use jail name instead of filter, which can be empty)
2020-02-10 13:03:55 +01:00
sebres
65ce64ba6d
Merge branch '0.11'
2020-02-07 13:57:00 +01:00
sebres
01333fc3e2
Merge branch '0.10' into 0.11
2020-02-07 13:55:20 +01:00
sebres
7a28861fc7
review of command line: more long-named options can be supplied via command line
2020-02-07 13:52:45 +01:00
sebres
3f48907064
amend to f3dbc9dda1: change main thread-name back to fail2ban-server;
...
implements new command line option `--pname` to specify it by start of server (default `fail2ban-server`);
closes gh-2623 (revert change of main thread-name, because it can affect process-name too, so `pgrep` & co. may be confused)
2020-02-07 11:08:01 +01:00
sebres
9c7bd80807
fail2ban-regex: stop endless logging on closed streams (redirected pipes like ... | head -n 100), exit if stdout channel is closed
2020-02-03 20:09:13 +01:00
Mihail Politaev
303861d7c7
Using native firewalld ipset implementation
...
By creating additional action file firewallcmd-ipset-native.conf
2020-01-30 21:17:32 +02:00
sebres
ccbc0c7405
Merge branch '0.11'
2020-01-30 10:23:14 +01:00
sebres
a7c68ea19f
Merge branch '0.10' into 0.11
2020-01-28 21:47:55 +01:00
sebres
12b3ac684a
closes #2615 : systemd backend would seek to last known position (or now - findtime) in journal at start.
2020-01-28 21:45:30 +01:00
sebres
cd42cb26d6
database: try to fix out of sequence error on some old platform / sqlite versions ( #2613 ) - repack iterator as long as in lock (although dirty read has no matter here and only writing operations should be serialized, but to be sure and exclude this as source of that errors).
2020-01-27 12:57:29 +01:00
sebres
569dea2b19
filter.d/mysqld-auth.conf: capture user name in filter (can be more strict if user switched, used in action or fail2ban-regex output);
...
also add coverage for mariadb 10.4 log format (gh-2611)
2020-01-22 17:24:40 +01:00
sebres
9e6d07d928
testSampleRegexsFactory: time is not mandatory anymore (check time only if set in json), allows usage of same line(s) matching different logtype option:
...
`# filterOptions: [{"logtype": "file"}, {"logtype": "short"}, {"logtype": "journal"}]`
2020-01-22 17:19:35 +01:00
sebres
3befbb1770
improved wait for observer stop on server quit (second stop would force quit), this also cause reset db in observer (to avoid out of sequence errors) before database gets ultimately closed at end of server stop process (gh-2608)
2020-01-20 16:45:01 +01:00
sebres
7f1b578af4
Merge branch 'gh-488-check-on-error'
2020-01-16 16:52:44 +01:00
sebres
8cbc1e0ebb
ChangeLog (change actioncheck behavior)
2020-01-16 16:51:57 +01:00
sebres
546fff8dc0
Merge branch '0.11'
2020-01-16 16:25:20 +01:00
Sergey G. Brester
d2d3762ba9
Merge pull request #2605 from angeloc/0.11
...
Fixing --withouth-test install option
2020-01-16 13:45:49 +01:00
Angelo Compagnucci
5fa1f69264
setup.py: adding option to install without tests
...
Tests files are not always needed especially when installing on low
resource systems like an embedded one.
This patch adds the --without-tests option to skip installing the
tests files.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com >
2020-01-16 12:28:42 +01:00
Angelo Compagnucci
3965d690b1
Revert "setup.py: adding option to install without tests"
...
Test should actually removed from the stup data in finalize_options
instead of being added back.
This reverts commit 9b918bba2f .
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com >
2020-01-16 12:05:13 +01:00
sebres
50fbcda8b6
Merge branch '0.10' into 0.11
2020-01-15 21:54:37 +01:00
sebres
8dc6f30cdd
closes #2596 : fixed supplying of backend-related logtype to the jail filter - don't merge it (provide as init parameter if not set in definition section), init parameters don't affect config-cache (better implementation as in #2387 and it covered now with new test)
2020-01-15 21:49:51 +01:00
sebres
ed4b5b8bdc
change actioncheck behavior (on error only, gh-488)
2020-01-15 14:54:31 +01:00
sebres
94b64055e1
Merge branch '0.11'
2020-01-15 14:53:28 +01:00
sebres
9f701bb611
Merge branch '0.10' into 0.11
2020-01-15 13:26:46 +01:00
sebres
05f9e53660
Merge branch '0.10-invariant-improve' into 0.10
2020-01-15 13:26:15 +01:00
sebres
d4c921c22a
amend to 31b8d91ba2: tag <family> is normally dynamic tag (ticket related), so better to replace it this way (may avoid confusing if tag is used directly during restore sane env process for both families); conditional replacement is not affected here
2020-01-15 13:22:55 +01:00
Sergey G. Brester
3f5c382a98
readme: amend to bump version (v.1.0.1 is master now)
2020-01-14 20:55:24 +01:00
sebres
bb0f732ae6
version bump (master is 1.0.x-dev now)
2020-01-14 20:38:26 +01:00
sebres
8694c54728
increase test stack size to 128K (on some platforms min size is greater then 32K), closes gh-2597
2020-01-14 11:51:27 +01:00
sebres
70e47c9621
Merge branch '0.10' into 0.11
2020-01-14 11:44:35 +01:00
sebres
ec37b1942c
action.d/nginx-block-map.conf: fixed backslash substitution (different echo behavior in some shells, gh-2596)
2020-01-14 11:39:13 +01:00
sebres
31a6c8cf5d
closes gh-2599: fixes splitwords for unicode string
2020-01-13 20:12:16 +01:00
sebres
b158f83aa3
testIPAddr_CompareDNS: add missing network constraint (gh-2596)
2020-01-13 12:37:19 +01:00
sebres
d004a2c79b
release 0.11.1 -- This is the Way
2020-01-11 11:01:00 +01:00
sebres
27fb4790fb
Merge branch '0.10' into 0.11
2020-01-10 15:17:54 +01:00
sebres
b25d8565fc
release 0.10.5 -- Deserve more respect a jedi's weapon must. Hrrrm, Yes
2020-01-10 13:34:46 +01:00
sebres
4e4bd43e5e
small amend for d1b7e2b5fb: double usage string removed, spacing fixed
...
generate-man: small fixing (avoid ../bin in usage, version fix
2020-01-10 13:28:20 +01:00
sebres
4860d69909
Merge branch '0.10' into 0.11
2020-01-09 20:55:00 +01:00
sebres
f77398c49d
filter.d/sshd.conf: captures Disconnected from ... [preauth], preauth phase only, different handling by extra (with supplied user only) and ddos/aggressive mode (normal mode is not affected, used there just as a helper with <F-NOFAIL> to capture IP for multiline failures without IP);
...
closes gh-2115, gh-2362.
2020-01-09 20:53:53 +01:00
sebres
d1b7e2b5fb
fail2ban-regex - several enhancements and fixes:
...
- improved usage output (don't put a long help if an error occurs);
- new option `--no-check-all` to avoid check of all regex's (first matched only);
- new option `-o`, `--out` to set token provided in output (disables check-all and outputs only expected data);
- test cases optimized and extended
2020-01-09 16:59:13 +01:00
sebres
dbc6590589
usage of failure-ID tag <F-ID>...</F-ID> causes raw handling automatically (avoid DNS-resolve for found ID)
2020-01-08 22:07:33 +01:00
sebres
ac41b8f3be
some logging level got changed between 0.10/0.11 (9 is lowest log level to capture messages in LogCaptureTestCase now)
2020-01-08 21:43:27 +01:00
sebres
587e4ff573
Merge branch '0.10' into 0.11
...
(conflicts resolved)
2020-01-08 21:27:23 +01:00
Sergey G. Brester
a15832e773
Merge pull request #2588 from sebres/0.10-invariant-improve
...
0.10 auto-reban, improved invariant check and conditional operations
2020-01-08 21:04:42 +01:00
sebres
f30b7ae244
update ChangeLog + spelling
2020-01-08 21:03:00 +01:00
sebres
17a34b1528
amend with missing parameter of actionreban in actionreader and coverage
2020-01-07 22:01:11 +01:00
sebres
f001f8de2a
automatic reban (repeat banning action) after repair/restore sane environment, if already logged ticket causes new failures (part of #980 , closes #1680 );
...
introduces banning epoch for actions and tickets (to distinguish or recognize removed set of tickets)
2020-01-07 21:28:32 +01:00
sebres
1a9bc1905d
auto-detection of IPv6 subsystem availability (important for not on-demand actions or jails, like pass2allow)
2020-01-07 17:01:47 +01:00
sebres
125da61bda
more cases covered, start in repair distinguish operations, on demand flag etc
2020-01-07 15:50:54 +01:00
sebres
b7fe33483a
coverage
2020-01-07 11:54:21 +01:00
sebres
a527fbcae5
small amend: if not on-demand, the families should be specified (or default), also avoids error "dictionary changed size during iteration"
2020-01-06 21:44:19 +01:00
sebres
67fd75c88e
pass2allow-ftp: inverted handling - action should prohibit access per default for any IP, so reset start on demand parameter for this action (will be started immediately).
2020-01-06 21:13:40 +01:00
sebres
165b7d6643
tests fixed, prepared for other conditional operations (for subnet usage), operations like repair/flush/stop considering started families (executed for started only)
2020-01-06 21:02:57 +01:00
sebres
3c42c7b9ef
**not ready** testActionsConsistencyCheck fixed, but several **broken** tests (todo: fix public interface like action.start()/stop()).
2020-01-06 21:02:56 +01:00
sebres
31b8d91ba2
**not ready** amend with more tests (some issue on stop?)
2019-12-27 21:58:06 +01:00
sebres
8f6ba15325
avoid unhandled exception during flush, better invariant check (and repair), avoid repair by unban/stop etc...
2019-12-27 21:30:41 +01:00
Sergey G. Brester
690a0050f0
Merge pull request #2567 from Mart124/bitwarden
...
New jail, Bitwarden
2019-12-13 18:31:21 +01:00
sebres
5dd85bf4f8
Merge branch '0.10' into 0.11
2019-12-12 21:45:50 +01:00
sebres
7e98073014
amend to f3dbc9dda1: don't need truncate (if the name with \0 exceeds 16 bytes, the string is silently truncated by prctl).
2019-12-12 21:45:09 +01:00
sebres
b2e8d610a0
small amend: adjust name of observer thread (more similar to other threads)
2019-12-12 21:31:26 +01:00
sebres
1bcb39c699
Merge branch '0.10' into 0.11
2019-12-12 21:29:13 +01:00
sebres
f3dbc9dda1
set real thread names (used for identification and diagnostic purposes, e. g. top -H, ps -e -T, pstree, etc)
2019-12-12 21:28:16 +01:00
Mart124
e763c657c4
Let's get back to WRN
2019-11-27 00:32:10 +01:00
Mart124
566cbcdde0
Update bitwarden
2019-11-27 00:14:18 +01:00
Mart124
d7b707b09d
Update bitwarden.conf
2019-11-27 00:09:22 +01:00
Mart124
869327e9b1
Update bitwarden.conf
2019-11-25 22:17:58 +01:00
Mart124
79caeaa520
Create bitwarden.conf
2019-11-25 22:05:29 +01:00
Mart124
30e742a849
Update jail.conf
2019-11-25 21:57:41 +01:00
Mart124
ef394b3cf0
Update jail.conf
2019-11-25 21:55:45 +01:00
Mart124
a3df1ab3f0
Create bitwarden
2019-11-25 21:50:16 +01:00
sebres
24d1ea9aa2
Merge branch '0.10' into 0.11
2019-11-25 01:58:55 +01:00
sebres
d5144e380e
filter: testing proper handling after time-drift or time-jump (DST-hole, NTP time correction backwards, etc), gh-2566
2019-11-25 01:46:07 +01:00
Sergey G. Brester
e4c2f303bd
Merge pull request #2550 from CPbN/centreonjail
...
Add Centreon jail
2019-11-15 01:53:20 +01:00
Sergey G. Brester
596c5cee7e
Merge pull request #2560 from sebres/gh-927-subnet
...
subnet implementation (filter, parsing tags)
2019-11-15 01:48:30 +01:00
Sergey G. Brester
e86e9b2ee9
Merge branch '0.10' into gh-927-subnet
2019-11-15 01:47:50 +01:00
Sergey G. Brester
9d263edfbb
Merge pull request #2563 from hvanmegen/patch-1
...
Updated sendmail-auth.conf for longer mail IDs
2019-11-15 01:41:13 +01:00
sebres
27e6b0021c
ChangeLog update gh-2563
2019-11-08 13:18:57 +01:00
sebres
0e8a8edb5e
filter.d/sendmail-*.conf: both filters have same __prefix_line now (and same RE for ID, 14-20 chars long, optional) + adjusted test cases (gh-2563)
2019-11-08 13:15:40 +01:00
Henry van Megen
a9200c5456
Added logline that fails at IDs with 15 chars (see gh-2563)
2019-11-08 12:43:02 +01:00
Henry van Megen
548e2e0054
sendmail-auth.conf: filter updated for longer mail IDs (up to 20, see gh-2562)
2019-11-08 12:42:09 +01:00
sebres
5cf064a112
monit: accepting both logpath's: monit and monit.log, closes gh-2495
2019-11-04 12:18:12 +01:00
sebres
e5d02bc2e9
grouped tags (<ADDR>, <HOST>, <SUBNET>) recognize IP addresses enclosed in square brackets, closes gh-2494
2019-11-04 12:11:00 +01:00
sebres
d44607a161
part of #927 - filter enhancement to parse IP sub-nets (IP/CIDR with correct recognition of IP-family),
...
provides new replacement tags for failregex to match subnets in form of IP-addresses with CIDR mask (gh-2559):
- `<CIDR>` - helper regex to match CIDR (simple integer form of net-mask);
- `<SUBNET>` - regex to match sub-net adresses (in form of IP/CIDR, also single IP is matched, so part /CIDR is optional);
2019-11-01 16:29:17 +01:00
CPbN
9e699646f8
Add Centreon jail
2019-10-24 14:37:18 +02:00
CPbN
18ba714f97
Add Centreon jail
2019-10-23 09:14:26 +02:00
sebres
3515d06979
Merge branch '0.10' into 0.11
2019-10-18 19:19:21 +02:00
sebres
5e3fef1631
Merge branch 'amend-gh-2254' into 0.10
2019-10-18 19:06:42 +02:00
sebres
85ec605358
nftables: amend to gh-2254 - implemented shutdown of action (proper clean-up) - at stop it checks now the last set was deleted and removes table completely (if table does not contain any set);
...
this is avoided if some sets were added manually or can be avoided via overwriting of parameter `_nft_shutdown_table`, for example:
banaction = nftables[_nft_shutdown_table=''][...]
2019-10-18 19:01:16 +02:00
sebres
51af193402
nftables: add options allowing to specify own table (default f2b-table) and chain (default f2b-chain)
2019-10-18 18:54:02 +02:00
sebres
955d690e56
regrouping expressions with curly braces, added more escapes (better handling in posix shell)
2019-10-18 18:34:48 +02:00
sebres
0824ad0d73
Merge branch '0.10' into 0.11
2019-10-18 12:04:38 +02:00
Sergey G. Brester
8b850864cf
amend to #2254 : update changelog
2019-10-18 12:00:17 +02:00
Sergey G. Brester
54298fe761
Merge pull request #2254
...
Nftables: isolate fail2ban rules into a dedicated table and chain
2019-10-18 11:43:38 +02:00
sebres
d1a73d3004
filter.d/apache-auth.conf:
...
- ignore errors from mod_evasive in `normal` mode (mode-controlled now) (gh-2548);
- extended with option `mode` - `normal` (default) and `aggressive`
close gh-2548
2019-10-18 11:26:19 +02:00
sebres
8c6a547215
Merge branch '0.10' into 0.11
2019-10-11 03:01:46 +02:00
sebres
50595b70fd
filter.d/mysqld-auth.conf: ISO timestamp format (dual time) within log message
...
(https://serverfault.com/questions/982126/fail2ban-fails-to-recognize-ip )
2019-10-11 01:31:07 +02:00
sebres
9e28b6c65f
filter.d/asterisk.conf: relaxing protocol RE-part before IP in RemoteAddress (gh-2531)
2019-09-26 21:46:26 +02:00
sebres
8ea00c1d5d
fixed mistake in config (semicolon after space as comment in configs?) and coverage, suppress errors by unsupported flush, better space handling in helper _nft_get_handle_id, etc
2019-09-25 13:47:29 +02:00
sebres
492205d30e
action.d/nftables.conf: implemented actionflush (allows flushing nftables sets resp. fast unban of all jail tickets at all)
2019-09-24 20:00:29 +02:00
sebres
abc4d9fe37
allow to use multiple protocols in multiport (single set with multiple rules in chain):
...
`banaction = nftables[type=multiport]` with `protocol="tcp,udp,sctp"` in jail replace 3 separate actions.
more robust if deleting multiple references to set (rules in chain)
2019-09-24 19:44:59 +02:00
sebres
c753ffb11d
combine nftables actions to single action:
...
- nftables-common is removed
- nftables-allports is obsolete, replaced by nftables[type=allports]
- nftables-multiport is obsolete, replaced by nftables[type=multiport]
2019-09-24 18:53:38 +02:00
sebres
c59d49da22
nftables-allports: support multiple protocols in single rule;
...
tests/servertestcase.py: added coverage for nftables actions
2019-09-24 18:46:41 +02:00
Ririsoft
dde51b4682
fix actionban/unban ip definition syntax
2019-09-24 13:01:14 +02:00
Monson Shao
1cda50ce05
Rewrite nftables variables based on nftables' logic.
...
Add an example for redirecting.
2019-09-24 13:01:13 +02:00
sebres
f51712d275
Merge branch '0.10' into 0.11
2019-09-11 19:41:30 +02:00
sebres
82ddaa5771
fix order of jail options in stream:
...
* be sure usedns is before all regex(s) in stream (this option is also allowed in the config of filter now)
* logpath after all log-related data (backend, date-pattern, etc)
2019-09-11 19:38:42 +02:00
sebres
990c410877
Merge branch '0.10' into 0.11
...
# Conflicts (resolved):
# fail2ban/client/jailreader.py
2019-09-11 16:18:09 +02:00
sebres
7b3ee3dadc
allow to set all standard options of filter (like prefregex, journalmatch, etc) directly in jail (without filter or supplying parameters to filter);
...
normalize stream generation of filter-related parameters across FilterReader and JailReader (uses stream generator of filter now);
test cases extended (testOverrideFilterOptInJail) to cover this possibility.
2019-09-11 16:14:46 +02:00
sebres
a36b70c7b5
filter.d/znc-adminlog.conf: support logging format of systemd-journal, bypass port after address (optional, removed end-anchor, see gh-2520)
2019-09-10 21:02:26 +02:00
sebres
fbd4bfc595
extend murmur test cases to cover systemd journal log-format (gh-2520, note we don't use any time-stamp as systemd-backend does not expect it)
2019-09-10 19:46:44 +02:00
sebres
822f8adb6a
Merge branch '0.10' into 0.11
2019-08-22 21:33:58 +02:00
sebres
e547927075
tests: extend server test cases for some stock jails (e. g. check issue with sendmail filters gh-2493 + covering maxmatches / dbmaxmatches in server tests)
2019-08-22 21:29:46 +02:00
sebres
65da15327e
curtail some bothering continuously repeatable debug messages of filters (backend-related) to level 4 (below extra heavy-debug, so simplifying debugging and testing with level 5)
2019-08-22 21:17:45 +02:00
sebres
16b3993be6
actions: improve conditional execution of some operations, also allow to start action on demand (by first ban if actionstart_on_demand enabled) for non-conditional actions (backwards compatible, so actionstart_on_demand is on per default only for the actions having family-conditional sections);
...
small bug fixing (stop/flush/restore env etc) and code simplification.
2019-08-22 21:05:38 +02:00
sebres
6b7825b8c8
closes gh-2506: don't increase attempt count if bantime.increment is not enabled for the jail
2019-08-22 14:11:08 +02:00
sebres
15734a923b
Merge branch '0.10' into 0.11
2019-07-29 14:25:19 +02:00
sebres
39d9133baa
amend to 7520d250b0 ( #2444 ): don't use default flags (SYSTEM) if journalfiles are specified (similar journalflags set to 0);
...
fix failure of testJournalFilesArg and cover both cases now.
2019-07-29 14:23:53 +02:00
sebres
1cdd618232
Merge branch '0.10' into 0.11
2019-07-29 13:26:37 +02:00
sebres
5d5253dd70
Merge branch '0.10' into 0.11
2019-07-29 13:25:49 +02:00
sebres
19052d9789
* Merge pull request #2406 from JoeHorn/0.11
...
support bind-9.11.0 log format
2019-07-29 13:23:25 +02:00
sebres
91923b5c07
don't need to match identifier exactly (@ is precise enough as prefix), not capturing group;
...
`prefregex` extended, more selective now (denied/NOTAUTH suffix moved from `failregex`, so no catch-all there anymore);
update ChangeLog
2019-07-29 13:21:00 +02:00
Sergey G. Brester
5a3859c163
Update named-refused
2019-07-29 13:06:51 +02:00
Joe Horn
4395469226
Update named-refused.conf
...
Log format changed since ver. 9.11.0
Ref. ftp://ftp.isc.org/isc/bind9/9.11.0/RELEASE-NOTES-bind-9.11.0.html
"The logging format used for querylog has been altered. It now includes an additional field indicating the address in memory of the client object processing the query."
2019-07-29 13:06:49 +02:00
Sergey G. Brester
a395361de8
Merge pull request #2467 from sebres/logtype-option-rfc5424
...
New option `logtype` value - `rfc5424`
2019-07-24 00:02:04 +02:00
Sergey G. Brester
70280bfa12
Update ChangeLog
2019-07-24 00:00:24 +02:00
sebres
581f13c2db
Merge branch '0.10' into 0.11
2019-07-22 19:07:15 +02:00
Sergey G. Brester
d3b5befe44
update changelog ( #2404 )
2019-07-22 12:50:48 +02:00
Sergey G. Brester
0dfd4f1f41
Merge pull request #2404 from benrubson/badprotocol
...
filter.d/sshd.conf: matches "Bad protocol version identification" in ddos and aggressive modes.
2019-07-22 12:47:39 +02:00
Sergey G. Brester
eb308d0fc8
add test for injection on version identification
2019-07-22 11:50:01 +02:00
Sergey G. Brester
119401fced
Merge pull request #2452 from benrubson/badips
...
Badips key is only used to retrieve list
2019-07-20 12:08:22 +02:00
Ben RUBSON
a98315386d
Update zzz-sshd-obsolete-multiline.conf
2019-07-19 17:59:16 +02:00
Sergey G. Brester
d5a5efcd5a
amend to #2174 for fail2ban.service, fix legacy path, closes gh-2474
2019-07-17 13:38:42 +02:00
sebres
0a209f01c2
Merge branch '0.10' into 0.11
2019-07-11 13:28:47 +02:00
Sergey G. Brester
7520d250b0
Merge pull request #2444 from sebres/gh-2392
...
systemd-backend: switched default flags to SYSTEM_ONLY(4)
2019-07-11 13:25:58 +02:00
sebres
af611db859
Merge branch '0.10' into 0.11
2019-07-10 12:47:03 +02:00
sebres
5e980afbb8
filter.d/apache-noscript.conf: closes #2466 - matches "Primary script unknown" without "\n" (optional now)
2019-07-10 12:45:53 +02:00
sebres
62b1712d22
amend to #2387 :
...
- common.conf: rewritten using section-based handling round about option logtype;
- option `logtype` extended with `rfc5424` to cover RFC 5424 log-format (see #2309 );
2019-07-09 21:48:43 +02:00
sebres
439f97fc52
Merge branch '0.10' into 0.11
2019-07-09 20:07:59 +02:00
sebres
595054639b
tests/samplestestcase.py: fixes retrieving of microseconds by epoch (and comparison within tests factory)
2019-07-09 20:07:14 +02:00
Sergey G. Brester
5bc8d73220
test_badips.py: parameter key is removed in #2452
2019-06-26 20:52:37 +02:00
benrubson
8b171f7d25
Badips key is only used to retrieve list
2019-06-26 18:34:20 +02:00
sebres
80f97eaf02
Merge branch '0.10' into 0.11
2019-06-26 17:29:08 +02:00
sebres
4a2f4226b8
testIpToName: fixed for reverse IP of google dns (resolving another name now), more dynamic now
2019-06-26 17:28:09 +02:00
Sergey G. Brester
8a386103c1
Update ChangeLog
2019-06-25 15:49:07 +02:00
Sergey G. Brester
978c2fa8dd
Merge pull request #2448 from sebres/norm-mail-actions
...
Normalization of mailing actions
2019-06-25 15:39:12 +02:00
sebres
e751be2c13
normalize, simplify and fix several mail actions (mail and sendmail actions are more similar now, sendmail is configurable via parameter mailcmd, etc);
...
added test covering sendmail-whois-lines
2019-06-15 23:14:41 +02:00
sebres
3d04a99d25
fail2ban-regex: (verbose only) avoid errors by dump of real options (if filter doesn't have some optional parameter, like datepattern)
2019-06-15 22:08:31 +02:00
sebres
5045c4bb00
Merge branch '0.10' into 0.11
2019-06-12 16:28:57 +02:00
sebres
809e7c4e82
Merge pull request #2264 from girst/0.11 (rebased to 0.10)
2019-06-12 16:28:32 +02:00
girst
a7dc3614c4
znc-adminlog: use <ADDR> instead of <HOST>
2019-06-12 16:26:34 +02:00
girst
b288ccd6b6
new filter: znc-adminlog
2019-06-12 16:25:50 +02:00
sebres
2e7a600851
Merge branch '0.10' into 0.11
2019-06-12 11:44:05 +02:00
sebres
326f5d4e3f
Merge fix of gh-2390
2019-06-12 11:43:07 +02:00
sebres
4c81338944
update ChangeLog (gh-2390)
2019-06-12 11:28:19 +02:00
sebres
22b9304562
action.d/badips.py: fix start of banaction on demand (which may be IP-family related), supplied action info with ticket instead of simulating it with dict;
...
(closes gh-2390)
2019-06-12 11:23:52 +02:00
sebres
9e44c30659
systemd-backend: switched default flags to SYSTEM_ONLY(4), that avoid to open the user session files, so can prevent "Too many open files" errors (like gh-2208) on a lot of user sessions;
...
(following Orion's proposal in gh-2392)
2019-06-12 00:42:01 +02:00
sebres
686a8bdc54
Merge branch '0.10' into 0.11
2019-06-12 00:13:39 +02:00
sebres
2725acb64b
amend to 809acb69e5: extended to avoid the vice versa race (too many outdated tickets to unban) - max count of outdated tickets is restricted also.
2019-06-12 00:11:26 +02:00
sebres
03b2b79c41
Merge branch '0.10' into 0.11
2019-06-11 15:51:10 +02:00
sebres
3326ec95ce
small amend (preparing to merge in 0.11): more precise test and avoid "expired bantime" (in 0.11)
2019-06-11 15:50:29 +02:00
sebres
93727abeb8
cherry-pick with_alt_time helper decorator from 0.11
2019-06-11 15:50:27 +02:00
sebres
809acb69e5
stability: avoid race condition - no unban if the bans occur continuously (e. g. banning action too slow, so new bans found each time during the default sleeptime);
...
now unban will happen not later than 10 tickets get banned regardless there are still active bans available (precedence of ban is 10 now);
closes gh-2410
2019-06-11 14:37:10 +02:00
sebres
0ed3a63151
Merge branch '0.10' into 0.11
2019-06-07 16:29:38 +02:00
sebres
e5ae113215
filter.d/postfix.conf: extended with new postfix filter mode errors to match "too many errors" (gh-2439),
...
also included within modes `normal`, `more` (`extra` and `aggressive`), since postfix
parameter `smtpd_hard_error_limit` is default 20 (additionally consider `maxretry`)
2019-06-07 16:14:02 +02:00
sebres
3b2f75414c
filter.d/postfix.conf: extended regexp's to accept variable suffix code in status of postfix for precise messages (gh-2442)
2019-06-07 15:40:55 +02:00
sebres
3d4044084a
Merge branch '0.10' into 0.11
2019-06-07 14:48:10 +02:00
sebres
8da9bfb83a
Update ChangeLog (gh-2302, rebased to 0.10)
2019-06-07 14:47:43 +02:00
Sergey G. Brester
7dbd3a07eb
cut comment to limit documented on abuseipdb, additionally use curl in quiet mode
2019-06-07 14:39:55 +02:00
Carlos Ferreira
7b73cb7639
Switch to AbuseIPDB API v2
2019-06-07 14:39:52 +02:00
sebres
759f7274f8
Merge branch '0.10' into 0.11
2019-06-05 12:28:44 +02:00
sebres
2e51897d7a
small amend to feba50e3c2 (typo fixed)
2019-06-04 20:40:48 +02:00
sebres
feba50e3c2
fixed resolve of FQDN: resolve of an external IPs and name will be preferred before the local domain (or a loopback), see gh-2438
2019-06-04 19:46:42 +02:00
sebres
ca49f2c71c
actions: provide <bantime> as integer value (for actions expecting timeout parameters)
2019-05-28 10:12:24 +02:00
sebres
c024c93ec6
fix sporadic test error (avoid purge timer-event execution in the middle of test)
2019-05-28 09:54:54 +02:00
sebres
7c7dfab8db
fixed missing return value (attempts) in addFailure in case of observed/banned tickets (could cause error '>=' not supported between instances of 'NoneType' and 'int' with python 3.x, gh-2432)
2019-05-28 09:21:55 +02:00
sebres
f48677db7d
Merge branch '0.10' into 0.11
2019-05-24 16:18:32 +02:00
sebres
3b51c005f8
update ChangeLog (multi-line parsing fix, gh-2431)
2019-05-24 16:17:06 +02:00
sebres
ffd366e17b
Merge branch '0.9' into 0.10
2019-05-24 16:01:27 +02:00
sebres
83f626c4aa
(grave) closes gh-2431: replace newlines in message from systemd journal (otherwise multi-line parsing is broken, because removal of matched string from multi-line buffer window is confused by extra new-lines, so they are retained and got matched on every followed message).
2019-05-24 15:53:16 +02:00
sebres
5137cd2ec8
Merge branch '0.10' into 0.11
2019-05-14 21:40:50 +02:00
sebres
49bf6132cc
amend for 3036ed1889: eliminate "invalid sequence" warnings
2019-05-14 21:40:33 +02:00
sebres
939f0d43e0
amend for 3036ed1889: resolve deprecated syntax (eliminate "invalid sequence" warnings)
2019-05-14 20:42:05 +02:00
sebres
f69a8693fc
Merge branch '0.10' into 0.11
2019-05-14 20:19:29 +02:00
sebres
607e965e7b
Merge branch 'sebres/0.10-travis-xenial' into 0.10:
...
- multi-distribution (trusty & xenial);
- python 3.8 (and new python/pypy minor versions on xenial);
2019-05-14 20:16:59 +02:00
sebres
08d2615020
small amend: review, simplification, etc
2019-05-14 20:04:44 +02:00
sebres
1cca374d04
.travis.yml: several distributions in matrix (trusty & xenial together)
2019-05-14 19:55:01 +02:00
sebres
d310c4992f
.travis.yml: coverage for python 3.8 (test with newest python/pypy versions)
2019-05-14 18:24:45 +02:00
sebres
3036ed1889
resolve deprecated syntax (eliminate "invalid sequence" warnings)
2019-05-14 18:22:55 +02:00
sebres
0426a24719
filter.d/postfix.conf: (closes gh-2426) filter extended to catch "5.1.1" (Recipient address rejected: User unknown in local recipient table) with RCPT (and some session-id instead of "NOQUEUE")
2019-05-14 15:27:20 +02:00
sebres
ca85ddc866
Merge branch '0.10' into 0.11
2019-05-10 16:23:50 +02:00
sebres
2b8e2707bb
Merge pull request #2298 from chtheis/0.11 (rebased to 0.10)
2019-05-10 16:22:58 +02:00
sebres
4d08bc4ad5
update ChangeLog
2019-05-10 16:22:25 +02:00
sebres
d8d71c5a22
action.d/helpers-common.conf: grep arguments are rewritten - using options -wF to match only whole words and fixed string (not as pattern)
2019-05-10 16:17:13 +02:00
chtheis
fa727586ff
Fix grep pattern to deal with Apache's error log
...
Apache's error log appends the port to the IP address, other logs don't.
2019-05-10 16:04:27 +02:00
sebres
74eac6c94f
Merge branch '0.10' into 0.11
2019-05-02 15:28:44 +02:00
sebres
23d2281e57
action.d/nginx-block-map.conf: small fix with better RE-rule for removal of ID (token/session) via sed (anchored now)
2019-05-02 15:22:45 +02:00
benrubson
5b2b680bfe
SSHd add Bad protocol version message
2019-05-02 11:42:45 +02:00
Sergey G. Brester
b318eb7e33
closes gh-2408: prevent execution of action abuseipdb for restored tickets
2019-04-29 10:45:37 +02:00
sebres
633b179b19
Merge branch '0.10' into 0.11
2019-04-26 13:35:43 +02:00
sebres
3d80e881c5
increase coverage (if python-systemd not available, so some tests may be skipped)
2019-04-26 13:29:19 +02:00
sebres
cd32f4a132
amend to ec681a3363 (PR gh-2387):
...
- specify default options (`logtype`) in default sections of filter-config (this allows to overwrite such options in Definition/Init sections within filter.local or includes also without setting that in the jail);
- fail2ban-regex: output real filter-options (after combine/interpolate) if verbose (`-vv`) or debug (`-l debug`).
2019-04-26 12:49:03 +02:00
sebres
c47bb523b7
Merge branch '0.10' into 0.11
2019-04-24 21:58:27 +02:00
Sergey G. Brester
7c9c751eb6
Merge pull request #2247 from Holston5/Holston5/mysqld-auth.conf
...
Update mysql logging command and fix mod_security filter
2019-04-24 21:57:19 +02:00
Sergey G. Brester
a7c48e7fe7
test case to cover two client entries message
2019-04-24 21:35:21 +02:00
Holston
422a2de7fe
updated
2019-04-24 21:35:19 +02:00
Holston
a581bf3f08
Fixed filter for Apache mod_security
2019-04-24 21:35:17 +02:00
Holston
5d6a84ba78
Updated to correct logging option
2019-04-24 21:35:15 +02:00
sebres
f0c5bd56f4
Merge branch '0.10' into 0.11 (conflicts resolved)
2019-04-19 13:20:38 +02:00
Sergey G. Brester
d67e42efa2
Merge pull request #2402 from sebres/maxentries-mem-saving
...
maxmatches: memory saving options
2019-04-19 12:51:04 +02:00
Sergey G. Brester
7d6db7391e
Update ChangeLog
2019-04-19 12:50:35 +02:00
sebres
3e5b8fdc6a
fixes coverage of dbmaxmatches = 0
2019-04-18 22:44:14 +02:00
sebres
46fc4c4615
protocol and documentation
2019-04-18 22:14:34 +02:00
sebres
4629e4320f
coverage and code review
2019-04-18 21:48:58 +02:00
sebres
852cb0362c
fix restoring of tickets from database if maxmatches of jail smaller as dbmaxmatches (so read fewer matches in memory):
2019-04-18 21:17:38 +02:00
sebres
25f1aa334e
fail2ban.conf: move default settings into DEFAULT section (to be more similar to jail.conf, Definition section overwrites the options, so it is backwards compatible)
2019-04-18 20:53:11 +02:00
sebres
0386df0042
introduced new options: dbmaxmatches (fail2ban.conf) and maxmatches (jail.conf);
...
setting `maxmatches` and `dbmaxmatches` to 0 saves memory usage and database size (closes gh-2118).
2019-04-18 20:31:39 +02:00
sebres
1083788e70
small amend (rename maxEntries -> maxMatches for consistency reasons)
2019-04-18 19:50:48 +02:00
sebres
5df78ad11f
fix corner cases by maxEntries = 0 (no matches should be saved), test cases extended to cover it + code review
2019-04-18 19:37:42 +02:00
sebres
5ebac4fe61
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2019-04-18 15:38:06 +02:00
sebres
337be4b36c
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.11
2019-04-18 13:47:44 +02:00
Sergey G. Brester
28c1da33dc
Merge pull request #2387 from sebres/logtype-option-journal
...
New backend-related option `logtype` (`journal` or `file`)
2019-04-18 13:27:42 +02:00
Sergey G. Brester
d920dd4014
Update ChangeLog
2019-04-18 13:19:21 +02:00
Sergey G. Brester
4a2c564945
Merge pull request #2388 from cepheid666/0.10
...
Update sendmail-reject with TLSMTA & MSA port IDs
2019-04-04 02:55:59 +02:00
Sergey G. Brester
ec9f698f5b
removed new-line
2019-04-04 02:55:09 +02:00
Sergey G. Brester
c09ac8ebed
small amend (typo)
2019-04-04 02:53:18 +02:00
Sergey G. Brester
6c7093c66d
minor amend, refolding branches (SP|SA -> S[PA])
2019-04-04 02:28:50 +02:00
Sergey G. Brester
7a463eb3f7
closes gh-2395: safe conversion of SYSLOG_PID or _PID (if journal entry contains a string instead of numeric)
2019-04-03 23:58:23 +02:00
Amir Caspi
76816285e8
Update sendmail-reject
...
Fixing timestamps to 2005 (oops)
2019-03-29 18:21:47 -06:00
Amir Caspi
7ac2f167f9
Update ChangeLog
...
Fixing typo I introduced in commit https://github.com/fail2ban/fail2ban/commit/eed1de0ceb992315c6824ca79e512df861bab39b
2019-03-29 17:49:22 -06:00
Amir Caspi
eed1de0ceb
Update ChangeLog
...
Updated to reflect sendmail-reject changes https://github.com/fail2ban/fail2ban/commit/9e1fa4ff73a1566ae0c381930b6eaae9880b0f29 and https://github.com/fail2ban/fail2ban/commit/ffd5d0db78af01afcdf7a2c615dc26b8558ad8f1
2019-03-29 17:47:52 -06:00
Amir Caspi
ffd5d0db78
Update sendmail-reject.conf
...
On some distros (e.g., CentOS 7), sendmail default config labels port 465 as TLSMTA and port 587 as MSA. Update failregex to reflect. Relevant loglines included in https://github.com/fail2ban/fail2ban/commit/9e1fa4ff73a1566ae0c381930b6eaae9880b0f29
2019-03-29 17:39:27 -06:00
Amir Caspi
9e1fa4ff73
Update sendmail-reject
...
Added loglines to show TLSMTA and MSA port IDs (RHEL/CentOS sendmail default for ports 465 and 587, respectively)
2019-03-29 17:38:30 -06:00
sebres
ced9828d04
filter.d/sendmail-reject.conf: fixed gh-2385 for some systems (e. g. CentOS): if only identifier set to sm-mta (no unit sendmail) for some messages.
2019-03-29 14:24:06 +01:00
sebres
1045003f49
fail2ban-regex: extended with same logic as fail2ban-server (sets logtype to journal if systemd backend is used (systemd-journal specified), to apply short prefix-line in filter)
2019-03-29 14:24:04 +01:00
sebres
ec681a3363
backend systemd sets logtype to journal automatically;
...
sshd-journal: new test covering sshd journal logging format (matches short prefix-line simulating output of formatJournalEntry);
samplestestcase-factory extended with new option `fileOptions` to set common filter/test options for whole test-file
2019-03-29 14:24:00 +01:00
sebres
e268bf97d4
introduces new configuration parameter "logtype" (default "file" for file-backends, and "journal" for journal-backends);
...
common.conf: differentiate "__prefix_line" for file/journal logtype's (speedup and fix parsing of systemd-journal);
samplestestcase.py: extends testSampleRegexsFactory to allow coverage of journal logtype;
closes gh-2383: asterisk can log timestamp if logs into systemd-journal (regex extended with optional part matching this)
2019-03-29 14:23:57 +01:00
sebres
eddd0d2f25
fail2ban-regex: fixed usage of foreign filter path with relative filename (outside of config-base directory): avoid join filter filename with 'filter.d'
2019-03-27 15:12:27 +01:00
Sergey G. Brester
0e5ce68d4c
Merge pull request #2348 from szepeviktor/deb-initd-retry
...
Safer, nicer, uniform Debian initd script - into 0.10
2019-03-27 14:00:40 +01:00
sebres
1e59d53bbe
fixed typo
2019-03-27 13:48:53 +01:00
sebres
17a4f81e23
Merge branch '0.10' into 0.11
2019-03-27 13:46:56 +01:00
sebres
320e55b8d5
Merge branch 'master' into 0.10 (merge point only, no functional changes as dovecot_log already owns it from common in 0.10)
2019-03-26 13:40:40 +01:00
sebres
6fe6ebe039
Merge branch 'fix-xarf-abuse-action' into 0.10 (closes gh-2372)
2019-03-18 10:06:55 +01:00
sebres
a7ccbd46dc
test cases extended to cover xarf-login-attack action
2019-03-16 00:13:22 +01:00
sebres
e8401a7e65
action.d/xarf-login-attack.conf: fixes gh-2372, correction for split of addresses, interpolation is shell-independent now, etc;
...
extended with option `boundary`, additionally dynamic boundary part is used (is not so predictable as it was previously);
2019-03-16 00:05:06 +01:00
sebres
ec2b5dc483
fixed log-level in error case (logging error instead of Level 39)
2019-03-15 22:28:08 +01:00
Sergey G. Brester
7a7a905ab2
0.9 - Merge pull request #2339 from cFire/master
...
Add override for dovecot failed logins on debian
2019-03-14 11:45:46 +01:00
sebres
7f0bba94ba
Merge pull request #2174 from eli-schwartz/0.11 (rebased)
2019-03-13 13:35:48 +01:00
Eli Schwartz
ebf2f28294
tmpfiles.d: don't use legacy directory path
...
systemd 239 (released June 22) introduces a new warning for tmpfiles.d
snippets touching paths in /var/run instead of the canonical /run
See https://github.com/systemd/systemd/commit/a2d1fb882c4308bc10362d971f333c5031d60069
Update to use the preferred path.
2019-03-13 13:34:16 +01:00
sebres
4e2c7b9fdd
Merge branch '0.10' into 0.11
2019-03-12 17:01:03 +01:00
sebres
741cf8fb0e
Merge branch 'master-0.9' into 0.10
2019-03-12 16:58:08 +01:00
sebres
f3cea45d2a
Merge pull request #2290 from james-choncholas/0.11 (rebased)
2019-03-12 16:56:09 +01:00
sebres
1a9527e6a4
fixed catch-all on user (and simplifying)
2019-03-12 16:53:36 +01:00
jim
a7f3ba87f6
filter.d/sogo-auth.conf: fixes gh-2289 - matching auth-failures when behind a proxy;
...
(broken by commit 72b06479a5 ), replacement for gh-2290.
2019-03-12 16:50:04 +01:00
sebres
324f0ed7cc
Merge branch '0.10' into 0.11
2019-03-01 12:36:07 +01:00
Sergey G. Brester
415818d803
Merge pull request #2356 from sebres/0.10-th-stack-size
...
default thread stack size
2019-03-01 12:33:03 +01:00
Sergey G. Brester
6c14f1987f
Update ChangeLog
2019-03-01 12:31:17 +01:00
sebres
32ba74463f
coverage - move to another tests (directly covering server)
2019-02-24 18:43:23 +01:00
sebres
f6468e753b
resolves py3.x compat issues in tests
2019-02-24 17:14:53 +01:00
sebres
fffeb7785c
code review
2019-02-24 16:56:13 +01:00
sebres
3c70fe298a
closes gh-969: introduces new section [Thread] and option stacksize to configure default stack-size of the threads running in fail2ban. Example:
...
```ini
[Thread]
stacksize = 32
```
2019-02-24 16:45:14 +01:00
Sergey G. Brester
af18993ba2
Merge pull request #2245 from benrubson/loglevel
...
badips.py: extended option `loglevel` to supply different log-level to the summary
2019-02-22 14:25:03 +01:00
Sergey G. Brester
410a9804b1
Update ChangeLog
2019-02-22 14:23:05 +01:00
sebres
3fcb0a868d
test-cases: availability of badips-service - avoid sporadic errors (like "The handshake operation timed out") during setup of tests
2019-02-22 14:07:11 +01:00
sebres
5126068099
loglevel and shortloglevel combined to single parameter loglevel, below an example logging summary with NOTICE and rest with DEBUG log-levels:
...
action = badips.py[... , loglevel="debug, notice"]
2019-02-22 14:05:19 +01:00
Ben RUBSON
34edec297b
Add changelog entry
2019-02-22 13:33:08 +01:00
benrubson
689938ee99
Add a shortloglevel badips.py option
2019-02-22 13:32:46 +01:00
sebres
a3b7a0525a
Merge branch '0.10' into 0.11
2019-02-22 13:22:52 +01:00
sebres
140243328f
coverage: try to avoid sporadic "coverage decreased" in CI
2019-02-22 13:20:40 +01:00
Sergey G. Brester
7e46ceed7e
Merge pull request #2353 from Yannik/patch-3
...
Add asterisk ipv6 test cases with and without port (related to #2317 )
2019-02-22 13:09:21 +01:00
sebres
3d7b072a15
covering short form of IPv6 (written-out full form of IPv6 is safe, no matter with or without square brackets)
2019-02-22 12:50:34 +01:00
Yannik Sembritzki
62acaae327
Add asterisk ipv6 test cases with and without port (related to #2317 )
2019-02-22 12:43:07 +01:00
Sergey G. Brester
d3f6d6ffdd
Merge pull request #2286 from crazy-max/0.10
...
New filter `traefik-auth`
2019-02-21 22:27:04 +01:00
Sergey G. Brester
dcede9b3f1
comment rewritten (belongs to the filter)
2019-02-21 22:26:28 +01:00
Sergey G. Brester
d84fb8a4b1
regex rewritten (more secure now, resolves catch-all vulni)
2019-02-21 22:19:04 +01:00
sebres
9ed35c423a
Merge branch '0.9' into 0.10 (gh-2317)
2019-02-21 20:13:54 +01:00
Sergey G. Brester
5c44ca714f
Merge pull request #2317 from Yannik/patch-2
...
Fix asterisk filter not catching attackers when port is logged (in pjsip module)
2019-02-21 20:09:05 +01:00
sebres
e046b09c8a
coverage for get ban --with-time
2019-02-21 17:56:31 +01:00
sebres
e44cd671b2
Merge branch '0.10' into 0.11 (conflicts resolved, tests fixed)
2019-02-21 17:29:04 +01:00
sebres
883864c774
optimizes processing of server-configuration stream by start and reload (no interim outputs produced, several calls of get-functions avoided also).
2019-02-21 15:54:56 +01:00
sebres
34dba44816
MANIFEST: forgotten test file
2019-02-21 15:50:12 +01:00
Sergey G. Brester
487e19420e
Merge pull request #2351 from sebres/0.10-multi-ban-unban-in-jail
...
fail2ban-client: multi ban/unban and attempt for set jail
2019-02-21 15:42:00 +01:00
Sergey G. Brester
a48d50efc0
Update ChangeLog
2019-02-21 14:37:07 +01:00
sebres
fc92021211
coverage and few enhancements
2019-02-21 14:36:18 +01:00
sebres
2dd3c546dd
small code review (normalization and duplicated codes removal)
2019-02-20 16:48:11 +01:00
sebres
00a6717953
fail2ban-client: extended with new feature which allows to inform fail2ban about single or multiple attempts (failure) for IP (failure-ID), syntax:
...
set <JAIL> attempt <IP> [<failure1> ... <failureN>]
2019-02-20 16:47:53 +01:00
sebres
84cec5e861
implements gh-2349: fail2ban-client set jain banip/unbanip ip1 .. ipN extended to ban/unban multiple tickets;
...
reorganized banning facilities (addBannedIP moved from filter to actions in order to ban directly without implication of fail-manager in between.
2019-02-20 14:56:00 +01:00
sebres
4a829cb51b
Merge branch '0.10' into 0.11
2019-02-18 17:19:33 +01:00
sebres
e30ebb1f3b
closes gh-2277: fixed and optimized cache facilities (operations on OrderedDict are not atomic); increased max-size of IPAddr cache; don't cache raw objects (it is fast enough).
2019-02-18 17:05:11 +01:00
sebres
14f997231d
add test case to cover gh-2277, testOverflowedIPCache testing overflow of IP-cache multi-threaded (2 "parasite" threads flooding cache)
2019-02-18 16:56:43 +01:00
Viktor Szépe
824afbf52d
Fix whitespaces
2019-02-17 09:12:30 +00:00
Viktor Szépe
24b0e048d1
Normalizing quote usage in initd
2019-02-17 09:08:59 +00:00
Yaroslav Halchenko
c545315192
ENH: travis - run shellcheck on files/debian-initd
2019-02-17 09:08:43 +00:00
Yaroslav Halchenko
62f957973d
ENH: disable shell check for $DAEMON_ARGS expansion
2019-02-17 09:08:32 +00:00
Viktor Szépe
dfd2a2063d
Safer, nicer, uniform Debian initd script
2019-02-17 09:08:29 +00:00
Yaroslav Halchenko
31e6ec3c5b
Merge pull request #2323 from todgru/fix-spelling-abuseipdb-conf
...
fix: correct spelling category
2019-02-15 17:08:45 -05:00
Cool Fire
27526e431b
Changes static logfile string to variable
...
Since we don't want to re-declare a log file name we already
have a varialbe for, use the existing variable to set dovecot_log.
2019-02-13 10:10:24 +01:00
Cool Fire
b31a018e7c
Add override for dovecot failed logins on debian
2019-02-13 10:01:14 +01:00
sebres
5a54a44559
provide more meaningful error-message if invalid datepattern set;
...
fail2ban-regex: catch errors/exceptions by set of parameter, more verbose output if needed (`-v` or log-level `debug` would produce output of call-stack additionally).
2019-02-12 14:36:40 +01:00
sebres
1647d0090e
Merge branch '0.10' into 0.11
2019-02-11 19:19:44 +01:00
Sergey G. Brester
c819a18a0a
Update ChangeLog
2019-02-11 19:15:11 +01:00
sebres
e651bc7866
amend to #1622 : jail-reader supports now multi-line option for multi-line action parameter:
...
logpath = a.log
b.log
c.log
action = ban[...]
= log[logpath="%(logpath)s"]
closes gh-2341, ultimate fix for gh-976
2019-02-11 11:54:58 +01:00
todgru
39ed016a1e
fix: correct spelling category
2019-01-14 22:08:38 -08:00
sebres
89c611064d
test-cases: be sure the test-files always written with new-line at end
2019-01-14 19:00:42 +01:00
sebres
d88ce7181c
Merge branch '0.10' into 0.11
2019-01-07 01:51:59 +01:00
Sergey G. Brester
4108e04ab4
Update ChangeLog
2019-01-07 01:50:44 +01:00
sebres
a13fdcf4f7
closes gh-2314: extended regex for mysql 8.0.13 if used logging with details (e. g. log-error-verbosity = 3, so log output has few additional words enclosed in brackets after "[Note]").
2019-01-07 01:34:12 +01:00
Sergey G. Brester
53684af0e3
Merge pull request #2315 from psvi/ban_list
...
New command `fail2ban-client get <JAIL> banip`
2019-01-07 01:11:28 +01:00
sebres
59688d7cd5
move helper to test, normalize invocations in order to emphasize assert comparison.
2019-01-07 00:05:27 +01:00
sebres
963e14c685
resolve sporadic timing errors (unban if ban still not occurred, resp. get list of IPs if not yet banned);
...
simplify helper procedure for testJailBanList.
2019-01-06 23:49:05 +01:00
sebres
4b934c784d
normalized time to string calls.
2019-01-06 23:33:28 +01:00
sebres
f959f58e15
extend protocol (command-line) and regenerate man's
2019-01-06 22:45:48 +01:00
sebres
df97fd33cf
ip-list is sorted now (by end of ban) per default;
...
extended with new option `--with-time` to provide more pretty and informative result (separated by new-line, including time strings: time of ban + ban-time = end of ban):
192.0.2.1 2019-01-06 22:24:48 + 300 = 2019-01-06 22:29:48
192.0.2.2 2019-01-06 22:24:48 + 600 = 2019-01-06 22:34:48
also it is possible now to provide separator-character as extra-parameter after `get <jail> banip ?sep-char?` (default is space).
removed unneeded test-cases (test code-base minimization) and unexpected manually changed files.
2019-01-06 22:31:23 +01:00
Sergey G. Brester
67247999ff
closes #2313 : missing dependency to nftables.service
2019-01-06 17:03:09 +01:00
SP
7f5f7017db
ENH: added new test cases for fail2ban-client get <JAIL> banip command (gh-1916)
2019-01-04 18:00:38 +03:00
Yannik Sembritzki
547504873e
Add test case for new asterisk pjsip log syntax which includes the port
2019-01-03 23:59:38 +01:00
Yannik Sembritzki
6b4404b1bc
Fix asterisk filter not catching attackers when port is logged ( Fixes #2316 )
2019-01-03 23:55:42 +01:00
SP
3d477d229d
ENH: added new command fail2ban-client get <JAIL> banip to get the banned ip addresses (gh-1916)
2019-01-03 23:55:35 +03:00
sebres
c9ba695ba3
minor, no cover for 3.x (2.6 only)
2018-12-28 00:04:15 +01:00
sebres
966fa1be89
Merge branch '0.10' into 0.11
2018-12-27 20:09:15 +01:00
sebres
4a4780be04
test-cases: prevent sporadic timing errors (unban if ban still not occurred)
2018-12-27 18:10:09 +01:00
sebres
0298c8a31e
closes gh-2277: fixed cache-object clean-up process (if max-size reached) used multi-threaded (del can throw KeyError if get/unset changes the list);
...
additionally OrderedDict is used now for cache (if available, so >= 2.7) - avoids (slow) search of expired items in full cache and always prefers older objects to remove (like FIFO).
2018-12-27 18:07:23 +01:00
sebres
2010dda6fa
Merge branch '0.10' into 0.11
2018-12-19 12:20:10 +01:00
Alexander Koeppe
df9b352bac
Update information reg. ipdns.py as successor for dnsutils.py
2018-12-19 12:17:44 +01:00
Sergey G. Brester
cadcc69bc0
minor amend for better readability
2018-12-17 18:42:28 +01:00
Sergey G. Brester
3fa54559e5
Update ChangeLog
2018-12-17 18:39:31 +01:00
Sergey G. Brester
f87a43487e
Merge pull request #2287 from angeloc/0.11
...
setup.py: adding option `--without-tests` to skip building and
installing of tests files
2018-12-17 18:37:08 +01:00
Sergey G. Brester
c540babfb6
matches not empty username only
2018-12-17 12:30:46 +01:00
CrazyMax
7cdabdd7ae
Update traefik-auth failregex
2018-12-14 19:06:09 +01:00
sebres
c1ccabc1f9
fixed read of included config-files (.local overwrites options of .conf for config-files included with before/after)
2018-12-11 15:43:25 +01:00
sebres
9b96a7de89
fix of SafeConfigParserWithIncludes
2018-12-11 15:39:43 +01:00
sebres
0245777c84
SafeConfigParserWithIncludes: fixed read of included config-files (expands with localized version, so inc.local overwrites options of inc.conf for config-files included with before/after);
...
added new test to cover this case.
2018-12-11 14:48:48 +01:00
CrazyMax
90516d6b67
Add login success example for traefik-auth
2018-11-28 00:37:24 +01:00
Sergey G. Brester
3b8842e618
Merge pull request #2284 from jedie/patch-1
...
Add link to https://fail2ban.readthedocs.io in README
2018-11-26 13:12:52 +01:00
Sergey G. Brester
c4c713ca6e
Update README.md
2018-11-26 13:10:30 +01:00
Angelo Compagnucci
9b918bba2f
setup.py: adding option to install without tests
...
Tests files are not always needed especially when installing on low
resource systems like an embedded one.
This patch adds the --without-tests option to skip building and
installing of tests files.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com >
2018-11-26 08:47:36 +01:00
CrazyMax
a160c38211
Fix UTC Time mismatch
2018-11-24 23:16:27 +01:00
CrazyMax
a8fbdd6a87
Fix UTC Time mismatch
2018-11-24 23:13:50 +01:00
CrazyMax
a51f82770b
New filter traefik-auth
2018-11-24 22:44:44 +01:00
Jens Diemer
52f6bfc2df
Add link to https://fail2ban.readthedocs.io in README
2018-11-23 15:47:37 +01:00
sebres
b49c1ab4b3
Merge branch '0.10' into 0.11
2018-11-21 13:06:44 +01:00
sebres
555b29e8e6
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2018-11-21 13:05:42 +01:00
Sergey G. Brester
c40e4c7bad
Merge pull request #2279 from sebres/sshd-filter-gh-2239
...
sshd filter enhancements (gh-2239)
2018-11-21 11:50:32 +01:00
Sergey G. Brester
0ac5c8941c
Update ChangeLog
2018-11-20 12:39:38 +01:00
sebres
1c1d2cc435
introduces new failregex-flag tag <F-MLFGAINED> signaled that the access to service was gained (ATM used similar to <F-NOFAIL>, but does not added to matches);
...
filter.d/sshd.conf: extended with new rules:
- Disconnecting ...: Change of username or service not allowed
- Disconnected from ... [preauth] (extra/aggressive mode only)
2018-11-19 21:19:57 +01:00
Sergey G. Brester
189c3f964b
Merge pull request #2276 from dienteperro/patch-1
...
"be" instead of "me" in shorewall.conf
2018-11-15 21:47:33 +01:00
dienteperro
0df221b54b
"be" instead of "me" in shorewall.conf
2018-11-15 14:34:51 -05:00
sebres
657b147c0d
fixed dependency issue if setup invoked using python 3.x: invocation of 2to3 takes place after setup (and __init__.py) loaded;
...
closes gh-2255.
2018-10-10 12:25:53 +02:00
sebres
d518868691
Merge branch '0.10' into 0.11
2018-10-09 22:13:43 +02:00
sebres
e99635650a
dnsToIp and other DNSUtils primitives uses sets instead of lists now (speed-up search of ip, e. g. ignoreself/ignoreip check process)
2018-10-09 18:24:50 +02:00
sebres
f9f7e29295
Merge branch '0.10' into 0.11 (version bump after r.0.10.4)
2018-10-04 13:08:25 +02:00
sebres
0ae02ba2a1
version bump (back to dev-version)
2018-10-04 11:57:56 +02:00
sebres
aa565eb80e
release 0.10.4 - ten-four-on-due-date-ten-four
2018-10-04 11:26:22 +02:00
Shane Forsythe
8614ca8c41
Update proftpd.conf
...
proftpd 1.3.5e can leave inconsistent error message if ftp or mod_sftp is used
Oct 2 15:45:31 ftp01 proftpd[5516]: 10.10.2.13 (10.10.2.189[10.10.2.189]) - SECURITY VIOLATION: Root login attempted
Oct 2 15:45:44 ftp01 proftpd[5517]: 10.10.2.13 (10.10.2.189[10.10.2.189]) - SECURITY VIOLATION: Root login attempted.
Fix regex to make trailing period optional, otherwise brute force attacks against root account using ftp are not blocked correctly.
2018-10-02 17:24:33 -04:00
Sergey G. Brester
1752c19b6f
Merge pull request #2205 from benrubson/patch-1
...
Add loglevel option to badips.py
2018-10-02 13:12:03 +02:00
Sergey G. Brester
65676baf8c
fixed py3 incompatibility (for some reasons this file seems to be excluded from 2to3), anyway not needed, because int-type is already checked in str2LogLevel
2018-10-02 13:00:20 +02:00
Sergey G. Brester
4b751c84c3
badips.py: Rewrite new bool option "log" as "loglevel" and revert default to log-level (DEBUG).
2018-10-02 12:32:15 +02:00
sebres
a462966cf6
Merge branch '0.10' into 0.11
2018-09-27 13:13:28 +02:00
sebres
6067579464
Fixed action parameter timeout: it is a time (integer), so avoid to convert it to string (for replacement); fix substituteRecursiveTags using auto-convert to string.
...
Closes gh-2241.
2018-09-27 12:51:57 +02:00
sebres
17da4943df
use short log-names for special pure numeric log-level (e.g. "Level 25" could be truncated by short formats)
2018-09-26 21:00:51 +02:00
sebres
6b52f90ad6
Merge branch '0.10' into 0.11
2018-09-21 15:54:16 +02:00
sebres
2a4c47ea32
.travis.yml: coveralls doesn't support python 2.6 now
2018-09-21 15:31:37 +02:00
sebres
58b510a5be
filter.d/domino-smtp.conf:
...
- recognizes failures logged using another format (something like session-id, IP enclosed in square brackets);
- failregex extended to catch connections rejected for policy reasons (gh-2228);
2018-09-21 14:14:00 +02:00
sebres
8a0c06ba9e
Merge branch '0.10' into 0.11
2018-09-14 11:01:40 +02:00
sebres
08f3f12f10
fix sporadic test-cases fails: change debug transmitter-message (sometimes confused with expected "Server ready" of server), better syntax for internal subst _use_flush;
2018-09-14 10:59:59 +02:00
sebres
d01fe9d22a
action.d/*.conf: correct comments for actionstart/actionstop
2018-09-12 16:01:57 +02:00
Ben RUBSON
9d7c0e00c1
Also log number of IPs removed/added
2018-09-08 09:28:42 +02:00
Sergey G. Brester
5b0c3e75d3
Merge pull request #2189 from yarikoptic/bf-initd-exit
...
debian-initd: exit with non-0 if fail, account that 255 is "Ok" exit code, use 255 explicitly instead of -1
2018-09-06 13:54:16 +02:00
Ben RUBSON
70e53b55c5
Typo
2018-08-19 22:39:18 +02:00
Ben RUBSON
ec4c4b12c1
Add yes/no log option to badips.py
2018-08-19 22:35:09 +02:00
sebres
714fd8c915
Merge branch '0.10' into 0.11
2018-08-14 16:01:00 +02:00
sebres
e392f510e2
fix sporadic time-related (multi-threaded) assertion errors (message was not found in the log).
2018-08-14 15:37:23 +02:00
Sergey G. Brester
ee207d8c31
Merge pull request #2151 from benrubson/merge
...
Apache SNI error / misredirect attempts rules are combined in one regex
2018-08-14 14:56:49 +02:00
Ben RUBSON
77b35b8db7
Improvement
2018-08-14 14:07:32 +02:00
sebres
addd26ae55
Merge branch '0.10' into 0.11
2018-08-14 11:13:15 +02:00
sebres
e2a255d104
fixed typo in comments by "ignoreself" parameter
2018-08-14 11:11:19 +02:00
sebres
606761b3c7
Merge branch '0.10' into 0.11
2018-08-03 12:06:13 +02:00
sebres
6ad9bb56a0
Update ChangeLog
2018-08-03 12:05:40 +02:00
sebres
e995d5a0b6
filter.d/freeswitch.conf: provide mode parameter, allows to avoid matching of messages like auth challenge (REGISTER) (see gh-2163) (currently extra as default to be backwards-compatible), see comments in filter how to set it to mode normal.
2018-08-03 11:42:15 +02:00
sebres
bc2dbacc9a
filter.d/freeswitch.conf: provide compatibility for log-format from gh-2193:
...
- extended with new default date-pattern `^(?:%%Y-)?%%m-%%d[ T]%%H:%%M:%%S(?:\.%%f)?` to cover
`YYYY-mm-dd HH:MM::SS.ms` as well as `mm-dd HH:MM::SS.ms` (so year is optional);
- more optional arguments in log-line (so accept [WARN] as well as [WARNING] and optional [SOFIA] hereafter);
2018-08-03 11:22:30 +02:00
Yaroslav Halchenko
ae359f6f05
BF: $value not $code
2018-07-24 14:29:43 -04:00
Yaroslav Halchenko
298f2c066a
BF: account that now code 255 is the one to say "it is Ok, we are already running/stopped"
2018-07-24 13:24:29 -04:00
Yaroslav Halchenko
f323eceec7
BF: debian-initd, exit with exit code in logend_msg_wrapper
...
and do it unconditionally on the verbosity level
2018-07-24 13:24:29 -04:00
Yaroslav Halchenko
d9b9b6ba22
RF: exit codes are positive, so exit(255) instead of exit(-1)
2018-07-24 13:24:24 -04:00
sebres
eb1156b099
Merge branch '0.10' into 0.11
2018-07-18 15:57:39 +02:00
sebres
22d37cdce2
sshd: fixed failregex for ddos (resp. aggressive) mode, to cover "authenticating user" case in log-message:
...
Connection closed by authenticating user root 192.0.2.10 ... [preauth]
tests extended (also with few injection tries).
closes gh-2185.
2018-07-18 15:31:04 +02:00
sebres
64d9e164cf
extends samples test-case factory to see the matched regex number and expression in assert message (helps if some similar regexp's available in filter)
2018-07-18 15:30:06 +02:00
sebres
d92381aaa9
fail2ban-regex: ignore lines having not empty match of <F-NOFAIL> from failregex (not a failure, so count as ignored and not as matched).
2018-07-18 15:23:56 +02:00
sebres
6a81cc9d8c
Merge branch '0.10' into 0.11
2018-07-17 15:18:44 +02:00
sebres
8fe07e29ad
filter.d/dovecot.conf: failregex enhancement to catch disconnected with "proxy dest auth failed";
...
closes gh-2184
2018-07-17 15:06:42 +02:00
sebres
4c18a04439
Merge branch '0.10' into 0.11
2018-07-11 13:22:48 +02:00
sebres
94ffd00328
fixes initialization bug if sys.stdout.encoding is None (closes gh-2177).
2018-07-11 13:21:53 +02:00
sebres
d65d7fd4d0
Merge branch '0.10' into 0.11
2018-07-10 20:04:48 +02:00
Sergey G. Brester
cc321b78da
Merge pull request #2176 from sebres/ignore-cache
...
Introduces cache for ignore-facilities (for `ignoreip`, `ignoreself` and `ignorecommand`)
2018-07-10 19:31:50 +02:00
sebres
f8f01d5ab7
introduced new option ignorecache to improve performance of ignore failure check (using caching of ignoreip, ignoreself and ignorecommand)
2018-07-09 14:58:39 +02:00
sebres
9b6d17d07e
extend ignorecommand to use actions-similar replacement (ticket-based now, so capable to interpolate all possible tags)
2018-07-09 13:01:16 +02:00
sebres
57f2d9e31c
Merge branch '0.10' into 0.11
2018-07-06 18:06:54 +02:00
Sergey G. Brester
11c1bf0149
Update ChangeLog
2018-07-06 18:05:59 +02:00
Daniel Dương
a719ba81e9
Fix cymru reference link
2018-07-06 17:50:51 +02:00
sebres
d9b9bb5f40
Merge pull request #2125 from jodlajodla/0.11 (rebased)
2018-07-06 17:43:30 +02:00
sebres
1e44b3f085
systemd no cover (currently unsupported by travis)
2018-07-06 17:42:28 +02:00
Jan Sušnik
54a04b3a6a
Fixed data type of journal flags from str to int
2018-07-06 17:32:34 +02:00
Jan Sušnik
df33322f9f
Added test to prove bug when specifying journal flags to systemd backend
2018-07-06 17:32:32 +02:00
Sergey G. Brester
75330568d9
Merge pull request #2168 from dpavlin/dovecot-add-F-USER
...
dovecot: collect F-USER and variants
2018-07-06 17:16:43 +02:00
sebres
f7962469a9
Merge pull request #2173 from mattsta/fix/findtime-backsearch-on-file-load (rebased)
2018-07-06 17:11:35 +02:00
sebres
1eb93e2556
filter.py: repair start-time of initial seek to time (regardless the position of findtime option in config);
...
jailreader.py: additionally relocate the option `logpath` after all log-related data (backend, date-pattern, etc) that may be needed by the first usage (gh-2173).
Thanks to Matt Stancliff (mattsta)
2018-07-06 17:04:10 +02:00
Matt Stancliff
00a0e98041
Load logpath only after findtime is configured
...
When new log paths are configured, their start offset is immediately determined
by a filter searching for (now - findTime).
But, since findTime is configured *after* the log is loaded and
searched, logs are only searched back by the default 10 minute findTime,
regardless of user configuration of jail settings.
So, findTime must be configured before logpath or else the default findtime
is used, which ignores any findtime time defined by the user.
This fixes new reads on startup for actual log files. The systemd filter
always performed as expected due to being setup after the jail's
findtime config submission.
2018-07-06 16:42:36 +02:00
sebres
6e40cb12ab
fix ban-time correction of restored tickets, could be set to persistent (-1) if increment allowed and no maxtime was specified.
2018-07-06 15:53:42 +02:00
sebres
9de1657aab
Merge branch '0.10' into 0.11
2018-07-06 11:43:56 +02:00
sebres
857d6954c4
Merge pull request #2171 from sebres/0.10-fix-decoding-issues
2018-07-06 11:42:48 +02:00
sebres
d0945120bf
ChangeLog
2018-07-06 11:41:05 +02:00
sebres
73e89df912
amend to bcf557990e: wrong logging syntax will not throw an error anymore (logged now, as logging is safe)
2018-07-05 23:04:38 +02:00
sebres
bcf557990e
relocate exception-safe logging from database json-handler to common logger handling, using injection on _log-method of Logger class;
...
additionally provides more info if handler/conversion failed (with double protection inside catch-case);
tests/utils.py: log handler "_MemHandler" of LogCaptureTestCase fixed now to be safe also (test-cases only);
tests/misctestcase.py: the safe logging of all possible constellations is covered in testSafeLogging now.
2018-07-05 22:36:30 +02:00
sebres
06f2130575
typo/indent fix (no functional changes)
2018-07-05 19:27:07 +02:00
sebres
6ce67a6d21
coverage
2018-07-05 16:27:36 +02:00
sebres
bd54d472b3
extend test-cases to check the database is still operable (not locked) after all the errors during the simulation
2018-07-05 16:23:33 +02:00
sebres
7c0ac467bb
getCurrentBans: ignore tickets with the ban-time changed after correction (if other max ban-time of jail as in the database)
2018-07-05 13:54:37 +02:00
sebres
76cb1c64ce
Merge branch '0.10-fix-decoding-issues' into 0.11
2018-07-04 20:47:34 +02:00
sebres
3be82a9ce9
coverage
2018-07-04 20:16:11 +02:00
sebres
5a4b47464b
a bit optimized helpers
2018-07-04 18:37:25 +02:00
sebres
7dffa7a2a1
coverage related, after default encoding change
2018-07-04 18:01:39 +02:00
sebres
c81de46d21
remove some no cover pragma's - covered now
2018-07-04 17:17:21 +02:00
sebres
48c2cbfa0b
improve failure-message of assertNotLogged in case of single match given
2018-07-04 17:05:36 +02:00
sebres
7c9146feb3
ticket can contains bytes now (if deserialized from json by py3.x)
2018-07-04 17:04:12 +02:00
sebres
930cc6c8f1
improve adapter/converter handlers working on invalid characters in sense of json and/or sqlite-database;
...
both should be additionally exception-safe, so avoid possible errors in log-handlers (concat, str. conversion, etc);
test cases extended to cover any possible variants (invalid chars in unicode, bytes, str + unterminated char-sequence) with both cases (with replace of chars, with and without errors inside adapter-handlers).
2018-07-04 17:03:04 +02:00
sebres
85fd1854bc
minimize influence of implicit conversions errors (between unicode, bytes and str), provide new universal helper uni_string, which uses safe explicit conversion to string (also if default encoding is ascii); avoid conversion errors on wrong-chars by replace tags.
2018-07-04 16:51:18 +02:00
Dobrica Pavlinusic
6f1e789f31
dovecot: collect F-USER and variants
...
We are prefering ruser= if availble because this are credentials
presented to dovecot from remote client.
2018-06-30 16:16:03 +02:00
sebres
227550684a
**interim** try to fix several conversion errors
2018-06-29 22:02:41 +02:00
sebres
79350e916e
fixes issue with wrong-chars in string items of CallingMap by its representation, additionally don't calculate values implicitly (may be unexpected for some constellations resp. too slow in DEBUG)
2018-06-29 18:33:24 +02:00
Sergey G. Brester
ddff67acb3
Update README.md
...
removed travis-test refernce to 0.9th branch
2018-06-28 14:17:18 +02:00
sebres
1aebd55f26
Merge branch '0.10' into 0.11
2018-06-14 15:57:59 +02:00
sebres
2f5059ebfb
test-cases: rewrite dirty-read algorithm of _MemHandler to avoid sporadic reset of dirty flag by too fast logging;
...
prevents sporadic tests-failures (too often by pypy) if waiting for some log-message (that was mistakenly swallowed up from cache-mechanism, so was logged but "dirty" flag is already reset)
2018-06-14 15:57:46 +02:00
sebres
0eaa0ecd86
Merge branch '0.10' into 0.11
2018-06-14 12:36:22 +02:00
sebres
8cbe1e6b13
Merge pull request #2155
2018-06-14 12:35:57 +02:00
cheese1
43db4411de
small typo
2018-06-14 12:35:04 +02:00
sebres
9fdc6e0e82
Merge branch '0.10' into 0.11
2018-06-11 14:36:35 +02:00
sebres
8ec225e20a
Merge pull request #2153
2018-06-11 14:36:17 +02:00
sebres
38631d0cd4
fix test-case from gh-2153 (test-suite running in year 2005)
2018-06-11 14:34:28 +02:00
Boris Gulay
34f363f6af
Added test case for updated dovecot failregex.
2018-06-11 14:30:12 +02:00
Boris Gulay
a923cd209b
filter.d/dovecot.conf: failregex enhancement to catch sql password mismatch errors;
2018-06-11 14:30:10 +02:00
benrubson
f54f6caece
Merge Apache SNI error / misredirect attempts rules
2018-06-09 10:19:27 +02:00
sebres
47d3a1213c
Merge branch '0.10' into 0.11
2018-05-28 19:15:18 +02:00
sebres
61e30949b3
Merge branch '0.10-short-version' into 0.10
2018-05-28 19:13:00 +02:00
sebres
f220aba26f
minor: added missing new-line (no functional changes)
2018-05-28 19:09:41 +02:00
sebres
e36f4667ab
fail2ban-client, fail2ban-server and fail2ban-regex will return version without logo info, additionally option -V can be used to get version in normalized machine-readable short format;
...
closes gh-2122.
2018-05-28 19:07:38 +02:00
Sergey G. Brester
a3cb1dbd4d
Update jailreader.py
...
changed log-level of annoying message "no file(s) found for glob" to NOTICE - this is rather a warning (not error).
2018-05-25 19:42:28 +02:00
Sergey G. Brester
f5f5423cc9
Merge pull request #2138 from glaslos/patch-1
...
replacing badly scaling png badges with svg
2018-05-24 14:15:34 +02:00
Lukas Rist
c256bfc02e
replacing badly scaling png badges with svg
2018-05-22 13:13:39 +02:00
sebres
7a3932efc0
amend for 1b4ba602ba: use common bool-converter
2018-04-26 16:52:40 +02:00
sebres
532cb35aa8
Merge branch '0.10' into 0.11
2018-04-26 16:48:37 +02:00
sebres
1b4ba602ba
normalize bool conversion, introduced common helper function _as_bool
2018-04-26 16:48:23 +02:00
sebres
eba8bd4faa
Merge branch '0.10' into 0.11
2018-04-26 16:24:53 +02:00
sebres
60b36c4213
rewritten preventive measure to convert "unexpected" type before pickled in CS-protocols: don't convert all basic types now (also bool, int etc).
...
Fixed bug with ignoreself option, which reached fail2ban-server as string 'False' (and not as boolean), so no matter which value was set - it results always in True (see gh-2078).
2018-04-26 16:24:35 +02:00
sebres
0d40dd42b1
Merge branch '0.10' into 0.11
2018-04-26 13:43:15 +02:00
sebres
e01981cc72
tweak performance a bit (filter.py: inIgnoreIPList: changed default of parameter log_ignore=True, mostly used against filter-calls)
2018-04-25 19:13:56 +02:00
sebres
a208b11796
added log message if ignored by ignoreself rule (similar to both other rules ignoreip and ignorecommand), and test covered now;
2018-04-25 19:06:03 +02:00
sebres
4099897be0
test dummy action first
2018-04-17 19:10:31 +02:00
Sergey G. Brester
9f3a80a21a
Update ChangeLog
2018-04-17 19:08:48 +02:00
sebres
bba7a6c5cf
amend to (gh-2067) / b34ae5999e: fix parameter in config (dynamic parameters stating with '_' are protected and don't allowed in command-actions);
...
the interpolation of hostsdeny is test-covered now;
closes gh-2114.
2018-04-17 18:59:24 +02:00
sebres
a92f25b48e
Merge branch '0.10' into 0.11
2018-04-09 14:44:52 +02:00
sebres
22e9ccb387
amend to 5f021aa648: void throw a socket error on shutdown for already closed connection;
...
closes gh-2109
2018-04-09 14:19:48 +02:00
sebres
0707695146
Merge branch '0.10' into 0.11, version bump
...
# Conflicts resolved:
# fail2ban/server/database.py
2018-04-05 12:58:11 +02:00
sebres
8069eef50c
badips: try to fix sporadic test errors if badips-server timed out resp. not available (502 bad gateway or similar).
2018-04-05 12:31:29 +02:00
sebres
414469c102
Merge '0.10.3.fix1' into 0.10
2018-04-05 00:41:29 +02:00
sebres
ac0d441fd6
0.10.3.fix1: version bump
2018-04-05 00:21:30 +02:00
sebres
cb0f4cbb32
test_badips.py: amend to 2ff65f5d3c:
...
increase timeout in normal mode + catch timeout exceptions to skip the test (avoid sporadic CI errors if badips gets slowly).
2018-04-05 00:17:00 +02:00
sebres
c1923f9644
update ChangeLog
2018-04-04 23:32:22 +02:00
sebres
34b586b51e
fix for JSON serialization bug for set object (gh-2103): currently there are only users, so simply serialized as a list.
2018-04-04 23:28:44 +02:00
sebres
187514eda7
bump version (0.10.3 -> 0.10.4.dev1)
2018-04-04 20:17:26 +02:00
sebres
0a50f2e19e
next release of 0.10: bump version, update ChangeLog, man's and MANIFEST etc.
2018-04-04 19:44:09 +02:00
sebres
70d099bbd6
Merge branch '0.10' into 0.11
2018-04-04 18:59:44 +02:00
sebres
5dfba17663
Merge pull request #2064 from mgrant0/0.11 (rebased)
...
Sendmail logs IPv6 addresses with the prefix 'IPv6:'. Changed <HOST> to (?:IPv6:<IP6>|<IP4>)
2018-04-04 18:59:13 +02:00
sebres
4a8506fcca
update ChangeLog
2018-04-04 18:57:41 +02:00
Michael Grant
57bc502d5c
Update sendmail-reject.conf
2018-04-04 18:52:36 +02:00
Michael Grant
2ab6a5ae62
Update sendmail-auth.conf
2018-04-04 18:52:35 +02:00
Michael Grant
87520e8008
Sendmail logs IPv6 addresses with the prefix 'IPv6:'. Added (IPv6:)? before all <HOST> regexes to match the IPv6 address (but not the prefix).
2018-04-04 18:52:33 +02:00
sebres
aac6398517
Merge branch '0.10' into 0.11
2018-04-04 18:02:05 +02:00
sebres
2ff65f5d3c
test_badips.py: increase timeout in normal mode (avoid sporadic CI errors if badips gets slowly).
2018-04-04 18:01:51 +02:00
sebres
1fdad90b4d
Merge branch '0.10' into 0.11
2018-04-04 16:49:57 +02:00
Sergey G. Brester
521de5edfd
Merge pull request #2101 from mercurytoxic/mercurytoxic-patch-1
...
Fixes abuseipdb curl cypher error and comment $f2bV_matches
2018-04-04 16:48:56 +02:00
Sergey G. Brester
d9525ad3aa
Update ChangeLog
2018-04-04 16:47:18 +02:00
Luis Aranguren
fc76ccf192
Fixes abuseipdb curl cypher error and comment $f2bV_matches
...
Fixed https://github.com/fail2ban/fail2ban/issues/2044 #2044
and used https://github.com/fail2ban/fail2ban/issues/2039 to fix comment in abuseipdb.com only showing $f2bV_matches
2018-04-04 16:39:16 +02:00
Sergey G. Brester
7bbc26d67e
Merge pull request #2097 from benrubson/sni
...
Detect Apache SNI error / misredirect attempts
2018-04-04 16:31:38 +02:00
Sergey G. Brester
28ae32f0ca
Update ChangeLog
2018-04-04 16:31:14 +02:00
sebres
f877980da9
Merge branch '0.10' into 0.11
2018-04-04 15:55:59 +02:00
sebres
02bae2962d
fixed test cases: www.epfl.ch seems to change again the static IP address, tests rewritten using dynamic mechanism (via resolver).
2018-04-04 15:24:59 +02:00
benrubson
bd74f7ba8b
Detect Apache SNI error / misredirect attempts, typos
2018-04-04 00:20:58 +02:00
sebres
e786dbf132
New logging parameter padding, default enabled, excepting the SYSLOG (for backwards compatibility purposes);
...
Closes gh-2099.
2018-04-03 17:58:17 +02:00
sebres
7dfd61f462
Merge branch '0.10' into 0.11-2
2018-04-03 14:14:44 +02:00
sebres
8423f017e7
Merge branch 'sshd-ddos-mode-closed-preauth' into 0.10
2018-04-03 14:12:35 +02:00
Sergey G. Brester
4ee7af742a
Merge pull request #2090 from sebres/fix-sshd-filter-suff
...
sshd, multi-line failures, alternate groups capture, etc.
2018-04-03 14:08:46 +02:00
sebres
4ee07adde6
Merge branch '0.10' into fix-sshd-filter-suff
...
# Conflicts resolved:
# fail2ban/server/filter.py
2018-04-03 13:30:57 +02:00
sebres
50d7c649ba
Skip several test-cases of systemd backend, if journal seems to be not available (e. g. no rights to read journal);
...
Closes gh-2100
2018-04-03 12:39:37 +02:00
sebres
fd0471927d
badips: increase age for /list/cat in the test-cases (default 24h is too short, so the tests can sporadic fail)
2018-04-03 11:53:03 +02:00
sebres
4963295729
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2018-04-03 11:43:58 +02:00
benrubson
30dc22fb2e
Detect Apache SNI error / misredirect attempts
2018-03-29 11:36:49 +02:00
Sergey G. Brester
088192ea9f
Merge pull request #1960 from comradekingu/patch-1
...
https, "Fail2Ban", other language improvements
2018-03-22 11:44:50 +01:00
Sergey G. Brester
9710c8c996
minor fix with reindent
2018-03-22 11:43:15 +01:00
Sergey G. Brester
02114ea073
Merge pull request #1912 from alxnorden/patch-1
...
Update README.md with clarifications
2018-03-22 11:10:06 +01:00
Sergey G. Brester
1b8840d333
Update README.md
2018-03-22 11:09:49 +01:00
Sergey G. Brester
8796c3b27e
Merge pull request #2093 from ravage84/patch-1
...
Improve wording
2018-03-22 11:02:50 +01:00
sebres
218905c924
performance optimization: findFailure, search regex etc, handling with buffer/tuple-lines optimized (especially multi-regex resp. multi-lines filters)
2018-03-22 10:16:40 +01:00
Marc Würth
077f58b228
Improve wording
2018-03-21 17:53:05 +01:00
Sergey G. Brester
67df796f93
Merge pull request #2088 from sebres/fix-gh-2073
...
filter.d/apache-noscript.conf: extended to match "Primary script unknown", got from php-fpm module
2018-03-21 09:56:38 +01:00
sebres
79019967a7
datepattern: fix epoch/long-epoch name, if custom pattern specified
2018-03-20 23:34:18 +01:00
Sergey G. Brester
6dc9c23a25
fixed typo in pragma-comment
2018-03-20 23:14:43 +01:00
Sergey G. Brester
80725ae870
Update sshd
...
comment/minimalistic: no functional change
2018-03-20 19:02:44 +01:00
sebres
e5735b9951
ChangeLog updated
2018-03-20 18:54:25 +01:00
sebres
4f6532f810
filter.d/sshd.conf: mode ddos (and aggressive) extended to catch Connection closed by ... [preauth], so in DDOS mode it causes failure now on closed within preauth stage;
...
at least using both modes can ban port-scanners and prevent for other annoying "intruders", closing connection within preauth-stage (see gh-2085 for example).
2018-03-20 18:54:22 +01:00
sebres
cd7f1354c6
remove end-anchors for expressions that are precise enough (with clear flow, simple branches, without catch-all's, etc.)
2018-03-20 18:47:42 +01:00
sebres
ed7d5d8ea1
ChangeLog updated
2018-03-20 16:04:42 +01:00
sebres
c31eb1c562
quick optimization: normalizes pam-generic prefregex (more similar to the same regex within sshd-filter) + datepattern anchored now;
2018-03-20 16:00:21 +01:00
sebres
4129f940bb
revert non-empty incremental multi-line failure merge (just simply overwrite method used ATM);
...
revert sshd test case (better to use last given failure-id, so ipv6 instead ipv4, e. g. because of some wrong multi-line-id recognition);
improved output on AssertionError in samples-testcase factory.
2018-03-20 15:27:59 +01:00
sebres
25cc42129a
hold all user names affected by interim attempts in order to avoid forget a failures after success login:
...
intruder (as legitimate user) firstly tries to login with another user-name (brute-force), so hopes to reset failure counter by succeeded login;
this is fixed and covered in tests now;
sshd-filter extended to cover multiple-login attempts (also fully implements gh-2070);
2018-03-20 13:09:05 +01:00
sebres
a9c94686b6
fixed multiple regexs matched
2018-03-20 09:09:42 +01:00
sebres
5603055a58
failregex: introduced capturing alternate groups, for example non-empty values of alt_user_1, alt_user_2 will overwrite user if it is empty (or alt_host -> host, etc.)
2018-03-20 09:05:02 +01:00
sebres
8028d3940d
amend with better match of optional suffix-groups;
...
remove end-anchors for expressions are precise enough (with clear flow, simple branches, without catch-all's, etc.);
2018-03-19 17:29:26 +01:00
sebres
66d2436f21
filter.d/sshd.conf: extend suffix with optional port, move it to prefregex at end outside of the content
2018-03-19 16:50:49 +01:00
sebres
7b3442c4e2
amend to 185cb998e7: capture error prefix outside of the failure content;
2018-03-19 14:53:56 +01:00
sebres
185cb998e7
make prefregex more precise in order to avoid catch the content for non failure lines
2018-03-19 14:38:47 +01:00
sebres
8763cf0a36
ChangeLog updated
2018-03-19 14:26:51 +01:00
sebres
e8ffab28fb
filter.d/apache-noscript.conf: extended to match "Primary script unknown", got from php-fpm module.
2018-03-19 14:23:24 +01:00
Sergey G. Brester
20fffc44c1
Merge pull request #2087 from sebres/fix-recidive-by-syslog
...
filter.d/recidive.conf: fixed if logging into systemd-journal (SYSLOG)
2018-03-19 14:08:46 +01:00
sebres
a6fb33bdec
filter.d/recidive.conf: fixed if logging into systemd-journal (SYSLOG) with daemon name in prefix, gh-2069
2018-03-09 13:56:38 +01:00
sebres
2e533a3a3a
better handling of default date templates (bounds, replacement using own expressions ...{DATE}..., etc.)
2018-03-09 13:54:04 +01:00
sebres
ce6ca0029a
minimize log output in trace case (index instead of full-regexp by "matched" log-line)
2018-03-07 16:27:42 +01:00
sebres
a3739bbf27
trim name and add one space after padding
2018-03-07 16:25:54 +01:00
sebres
71b19d9eba
stability of time-related test-cases: a bit increased timeouts; code normalization, review and coverage
2018-03-07 15:25:27 +01:00
Sergey G. Brester
92f19d0604
Merge pull request #2067 from fail2ban/sebres-fix-hostdeny-ipv6
...
action.d/hostdeny.conf: fixes IPv6 syntax
2018-03-07 12:35:07 +01:00
sebres
5b63ad17c6
stability of the test-cases: avoid echoing of server-ready in configure thread, if heavy-debug (only answer from new internal command "server-status").
2018-03-05 21:54:18 +01:00
Sergey G. Brester
b16aafe233
Update ChangeLog
2018-03-05 19:42:05 +01:00
Sergey G. Brester
b34ae5999e
action.d/hostdeny.conf: fixes IPv6 syntax
...
differentiate the IPv4 and IPv6 syntax (where it is enclosed in square brackets)
2018-03-05 19:35:10 +01:00
sebres
ccb1daf30a
Merge branch '0.10' into 0.11
2018-03-02 21:42:07 +01:00
sebres
cfc3979c84
Merge branch '0.10' with 'socket-stability-fix'
2018-03-02 21:40:13 +01:00
sebres
1bdda6c8eb
cache coverage
2018-03-02 21:39:13 +01:00
sebres
96836cb199
fix several errors (shutdown in test-cases during stop communication, better error handling by unpickle/deserialization, etc)
2018-03-02 21:39:08 +01:00
sebres
29bedd70d5
socket stability and coverage: cherry picked from 0.11 version (avoid many sporadic unhandled exceptions)
2018-03-02 21:31:19 +01:00
sebres
2b282ead09
Merge branch '0.10' into 0.11
2018-03-02 19:48:15 +01:00
Sergey G. Brester
9f969e7aab
Merge pull request #2062 from MatthieuBarbu/patch-2
...
filter.d/sshd.conf: fixed normal and ddos-mode regex (extended with port)
2018-03-02 19:31:10 +01:00
sebres
caa2bdfee6
amendment for gh-2061: it looks like the port was added here also
2018-03-02 19:24:47 +01:00
sebres
a3bcbe2d1b
backwards-compatibility, test-cases and ChangeLog update
2018-03-02 19:15:10 +01:00
MatthieuBarbu
6b5516b851
fix sshd rule #2
...
in line 58, rule don't match with "%(__suff)s" but work fine if I replace with "%(__on_port_opt)s"
Debian 9 stretch : fail2ban 0.10.3
2018-03-02 18:40:36 +01:00
Sergey G. Brester
e9a43f739c
Merge pull request #2061 from MatthieuBarbu/patch-1
...
fix sshd rule (space before "11:" is optional now)
2018-03-02 18:19:24 +01:00
sebres
1d7aa2ff21
filter.d/sshd.conf: rewrite fix (for new ssh log-format) backwards compatible + test-cases extended to cover both cases
2018-03-02 18:17:17 +01:00
MatthieuBarbu
9f5c873526
fix sshd rule
...
just remove the space before ":11" line 52 because don't match on my Debian 9 stretch...
I don't know if this is wrong on all OS
2018-03-02 17:53:35 +01:00
sebres
5ea76789c6
Merge branch '0.10' into 0.11
2018-03-02 17:18:37 +01:00
sebres
5f021aa648
shutdown sockets before close, avoid socket leakage by use of the explicit socket close in async_chat;
...
better error handling with error counting, differentiate special case ([Errno 24] Too many open files), with resulting stop of the server
(avoid flood the log file, closes gh-991 and similar issues);
restored auto-garbage, because of non-reference-counting python's (like pypy), otherwise it may leak there on objects like unix-socket, etc.
2018-03-02 17:08:23 +01:00
sebres
fa520f36c3
stability test-cases fix: avoid rare sporadic error on start of server (threaded in foreground);
...
additionally show the log output of the thread-server in case of any error there.
2018-03-02 17:00:01 +01:00
sebres
8c291cad38
filter.d/asterisk.conf: fixed failregex prefix by log over remote syslog server (gh-2060)
2018-03-02 09:17:04 +01:00
Ben RUBSON
b112250ef0
(Free)BSD IPFW does not allow 2 identical rules ( #2054 )
...
ipfw actionban fixed to allow same rule added several times (and actionunban to ignore error by deletion of missing rule)
2018-02-27 10:18:59 +01:00
Ben RUBSON
857767f04b
Add 'any' badips.py bancategory ( #2056 )
...
action.d/badips.py: allow `any` as bancategory to retrieve IPs from all categories
2018-02-27 10:12:22 +01:00
sebres
47a7f83a0b
Merge branch '0.10' into 0.11
2018-02-26 19:30:54 +01:00
sebres
07fcb24ff6
Merge pull request #2057 from benrubson/https
...
Use httpS with badips
2018-02-26 18:50:35 +01:00
Sergey G. Brester
117dcca414
Merge pull request #2059 from benrubson/str
...
badips.py, solve a str() issue - expected string, IPAddr found
2018-02-26 18:42:32 +01:00
sebres
933670d034
pragma: no cover - availability (once after error case only)
2018-02-26 18:35:30 +01:00
sebres
f52c67238a
action.d/badips.py: code review, ban command covered, debug log-messages, etc;
2018-02-26 18:16:20 +01:00
sebres
095a909c84
action.d/badips.py: increases score in test-cases (5 now, ssh/3 returns to large list, which can cause timeout if badips server to busy);
2018-02-26 18:14:44 +01:00
benrubson
8ed892b8bb
Changelog
2018-02-26 16:15:29 +01:00
benrubson
fce2a50165
badips.py, solve a str() issue under FreeBSD
2018-02-26 15:55:21 +01:00
benrubson
9a8add0ef0
changelog
2018-02-26 10:28:51 +01:00
benrubson
e2665d39fd
Use httpS with badips
2018-02-26 09:58:37 +01:00
sebres
a5155f55e7
Merge branch '0.10' into 0.11
2018-02-21 09:31:35 +01:00
Sergey G. Brester
7070664772
Merge pull request #2048 from sebres/exim-too-many-errors
...
Exim-filter: too many errors
2018-02-21 09:25:42 +01:00
Sergey G. Brester
879f580c9a
Update ChangeLog
2018-02-19 15:59:45 +01:00
sebres
e636567d23
filter.d/exim.conf: failregex extended with SMTP call dropped: too many syntax or protocol errors.
2018-02-19 09:50:46 +01:00
sebres
19a5a2f8c0
filter.d/murmur.conf: fixed detection of failures reading from journal (systemd-backend only):
...
- extended with optional prefix for the systemd-journal (with second date-pattern as optional match);
- added `journalmatch` filtering;
closes gh-2043
2018-02-09 11:43:55 +01:00
sebres
3e15343343
fail2ban-regex: bug fixed, if running over systemd-journal and journalmatch missing in filter.
2018-02-09 11:34:02 +01:00
sebres
730e760666
Merge branch '0.10' into 0.11
2018-02-06 18:19:50 +01:00
sebres
98f4d70371
fixed cymru-info resolved to answers with multiple data-records (as comma-separated list now)
2018-02-06 18:00:50 +01:00
Sergey G. Brester
3b8b9c4acf
README: extended systemd-prerequirements: python-systemd package
2018-02-06 17:02:23 +01:00
sebres
5c2fba0398
Merge branch '0.10' into 0.11
2018-02-01 19:41:26 +01:00
sebres
f1661d35ea
fix sporadic error, wait for shutdown/exit messages by assert-check, better prevention of dual (parallel) stop
2018-02-01 18:30:00 +01:00
sebres
2c03f5ad28
simple syntax change (wrong escape in string): no functional changes
2018-02-01 18:04:04 +01:00
sebres
201ae0dac2
Merge branch '0.10' into 0.11
2018-01-31 12:20:34 +01:00
Sergey G. Brester
3a1c386958
Update ChangeLog
2018-01-31 12:18:56 +01:00
Sergey G. Brester
0e0e478483
Merge pull request #2038 from sebres/long-epoch-and-epoch-pattern
...
Long epoch and epoch pattern
2018-01-31 12:13:46 +01:00
sebres
dcbf904876
allow to parse milliseconds as float + more test cases;
...
normalize capturing with epoch-pattern match - similar to `{DATE}` should capture and cut out the whole pattern match from the log-line;
2018-01-31 11:07:49 +01:00
sebres
3e8098d427
python 3.x compatibility: fix replacement string (may fail with errors like bad escape \d ..., etc)
2018-01-31 11:07:48 +01:00
sebres
442b0b1c59
extends date-detector with long epoch (LEPOCH) to parse milliseconds/microseconds posix-dates;
...
provide opportunity to specify own regex-pattern to match epoch date-time, e. g. "^\[{EPOCH}\]";
closes gh-2029
2018-01-31 11:07:46 +01:00
Sergey G. Brester
01f3df03c8
Merge pull request #2034 from sebres/0.10_/fix-gh-2028
...
0.10 - extend section-related interpolation, fix gh-2028
2018-01-31 11:04:06 +01:00
sebres
0ed11817c1
restore coverage: no cover for normally unreachable scopes (only if test cases failed)
2018-01-30 13:30:31 +01:00
sebres
0be0e43d47
amend to 03b577d7b9: add new-line after matches via tag <br> without usage of interim variable
2018-01-30 12:52:26 +01:00
sebres
03b577d7b9
action.d/blocklist_de.conf: fixed tag substitution (in 0.10 it can be variables supplied via shell-arguments), expand <matches> with trailing newline;
...
tests extended;
closes gh-2028
2018-01-30 12:27:03 +01:00
sebres
435f359a06
allow substitute section-related parameters like <Definition/option> in all config-readers as well as during substitute after supply of init arguments;
...
test cases extended;
2018-01-30 12:15:36 +01:00
sebres
f547a7c7b1
LogCaptureTestCase: use almost non-blocking handling by getvalue/_is_logged (especially important in tests with waiting for logged via assertLogged(..., wait=TO)):
...
- try to acquire lock without blocking, if not possible - return cached/empty (max 5 times, otherwise do lock);
- minimized time of the lock of messages list;
- avoid sporadic dead-locking during cross lock together with lock within handling of self._strm.
2018-01-26 20:25:11 +01:00
sebres
4942578de0
Merge branch '0.10' into 0.11
2018-01-24 20:36:22 +01:00
sebres
5f3ba289d6
restore code coverage (decreased in latest "fixes") - no cover for unreachable cases;
2018-01-24 20:03:46 +01:00
sebres
faab77cc79
Merge branch '0.10' into 0.11, with resolved conflicts.
2018-01-24 17:56:58 +01:00
sebres
ac9d5f61e7
rewrite keywords reserved in python 3.7 (async -> nonsync)
2018-01-24 15:50:19 +01:00
Sergey G. Brester
6b7cca07ae
Merge pull request #2025 from yarikoptic/bf-0.10-debian
...
A number of fixes toward making tests pass while building Debian pkg for 0.10.2
2018-01-24 08:42:36 +01:00
sebres
7a757645bb
introduces new decorator/conditional helper in order to skip some STOCK-related test-cases (if running outside of stock-config environment).
2018-01-23 22:06:22 +01:00
sebres
9af9ec25f5
allow to override use_stock_cfg values (used as default value now), e. g. actions rest filters only, reject d1afbb566f0304487b5d578b4aacef8e647ee74b
2018-01-23 22:06:20 +01:00
Yaroslav Halchenko
3f51c158cd
Added manpage (still would need tuning) for fail2ban-python
2018-01-23 22:06:18 +01:00
Yaroslav Halchenko
a5b9128fcc
BF: RF test for "being a root" to check if actually can read the file
2018-01-23 22:06:16 +01:00
Yaroslav Halchenko
49be8de902
BF: look for system.journal also under system-state-logs (i.e. /var/log)
...
as it happens on Debian systems
2018-01-23 22:06:14 +01:00
Yaroslav Halchenko
2f0bc491e2
BF: use tests.utils.CONFIG_DIR instead of hardcoded "config" in fail2banclienttestcase
...
Since otherwise cannot provide custom path to the config via env var
and thus cannot test in a build directory which is out of source
2018-01-23 22:06:12 +01:00
Allan Nordhøy
d7e320b96d
reverting linux indentation
2018-01-23 21:09:53 +01:00
Sergey G. Brester
3ac6166b48
Merge pull request #2027 from yarikoptic/bf-0.10-review
...
Minor spelling typos etc
2018-01-23 19:45:44 +01:00
Yaroslav Halchenko
527bb9a7c3
dos2unix for helpers-common.conf
...
Original report: http://bugs.debian.org/888110
2018-01-23 08:48:36 -05:00
sebres
077a45cc93
Merge branch '0.11-fix-get-current-bans-v2' into 0.11
2018-01-23 09:42:11 +01:00
sebres
7526f50706
amend to a54b401ee2 (0.11-fix-get-current-bans):
...
- differentiate between unknown ban-time after upgrade (-2) and persistent ban-time (-1);
- better handling to correct current ban-time, uses `bantime.maxtime` (if increment allowed) or `bantime` of jail;
- extended test-cases in order to cover the change of `bantime.maxtime`.
2018-01-23 09:41:43 +01:00
Yaroslav Halchenko
ba2538ba04
DOC: minor typos spotted around comments etc
2018-01-22 21:39:56 -05:00
Yaroslav Halchenko
af2de7ff2f
RF: COND_FAMILIES - use tuple
...
no need for a dict where tuple would be preferable (deterministic order)
2018-01-22 21:08:44 -05:00
sebres
7e1bc59f80
code review after merge (removed unnecessary code-pieces resp. code-duplication)
2018-01-22 11:10:22 +01:00
sebres
05951a23a5
Merge branch '0.10' into 0.11
2018-01-22 11:08:25 +01:00
sebres
8cfd97a68f
skip a testRepairDb if no sqlite3 command-helper available; code review (removed unnecessary code-pieces resp. code-duplication)
...
closes #2026
2018-01-22 10:42:33 +01:00
Sergey G. Brester
757ff8a7d4
Merge pull request #2022 from sebres/0.11-fix-get-current-bans
...
0.11: fix get current bans (after upgrade DB)
2018-01-22 10:00:57 +01:00
sebres
9440956575
Update ChangeLog
2018-01-19 19:37:37 +01:00
sebres
a54b401ee2
upgrade database: update new created bips table with entries from table bans (allows restore current bans after upgrade from version <= 0.10);
...
algorithm of restore current bans after restart changed: update the restored ban-time (and therefore end of ban) of the ticket with ban-time of jail (as maximum), for all tickets with ban-time greater (or persistent); not affected if ban-time of the jail is unchanged between stop/start.
2018-01-19 19:35:31 +01:00
sebres
0a4a76c4c4
Merge branch '0.10' into 0.11
2018-01-19 12:32:48 +01:00
sebres
9d5f20aab2
FilterPyinotify: fixed sporadic test-case error (multi-threaded) - 'NoneType' object has no attribute 'stop'.
2018-01-19 12:32:24 +01:00
sebres
c50875ccf6
Update ChangeLog: all major 0.11 changes combined in 0.11th block now
2018-01-19 11:41:54 +01:00
sebres
aa47937d4f
Merge branch '0.10' into 0.11: bum version after release of 0.10.2
2018-01-18 16:47:13 +01:00
sebres
9a38d5697f
bump version (0.10.2 -> 0.10.3.dev1)
2018-01-18 16:40:48 +01:00
sebres
1ca3df877b
Merge branch '0.10' into 0.11
2018-01-18 14:32:00 +01:00
sebres
38b3290516
Merge branch '0.10' into 0.11
2018-01-17 16:43:45 +01:00
sebres
576eeb70dd
Merge branch '0.10' into 0.11
2018-01-15 18:17:18 +01:00
sebres
416240e80e
Merge branch '0.10' into 0.11
2018-01-15 17:21:23 +01:00
sebres
0befbfd766
Merge branch '0.10' into 0.11
2018-01-11 20:23:55 +01:00
sebres
5ddab17089
Merge branch '0.10' into 0.11
2018-01-11 13:28:31 +01:00
sebres
da86ebca31
Merge branch '0.10' into 0.11
2018-01-11 11:21:02 +01:00
sebres
039ac7c7c4
Merge branch '0.10' into 0.11
2018-01-11 10:29:46 +01:00
sebres
0e68c9a720
Merge branch '0.10' into 0.11
2018-01-10 12:22:31 +01:00
sebres
a83a6c38e4
Merge branch '0.10' into 0.11
...
# Conflicts:
# fail2ban/server/database.py
2018-01-09 12:25:30 +01:00
Serg G. Brester
2deb356356
Update observer.py
...
Change log-level to debug for purge-event message
2018-01-08 10:14:50 +01:00
sebres
19c2d24c29
merge point
2017-12-22 17:22:11 +01:00
sebres
5028f17f64
Merge branch '0.10' into 0.11, rewrite updateDb because it can be executed after repair, and some tables can be missing.
...
# Conflicts:
# fail2ban/server/database.py
# fail2ban/tests/fail2banclienttestcase.py
# fail2ban/tests/sockettestcase.py
2017-12-22 17:05:45 +01:00
sebres
309a1cb337
restore timeout for ipset-based actions: on some systems ipset created without default timeout may cause "Kernel error received: Unknown error -1" (gh-1994);
...
thus new option `default-timeout` introduced (because of dynamical bantime in 0.10, it cannot be used here).
2017-12-06 02:38:10 +01:00
sebres
2179db3692
Merge branch '0.10' into 0.11
2017-12-06 01:41:29 +01:00
sebres
7e5d8f37fd
Merge branch '0.10' into 0.11
...
# Conflicts:
# config/action.d/firewallcmd-ipset.conf
# fail2ban/server/jail.py
# fail2ban/tests/servertestcase.py
2017-12-06 00:14:23 +01:00
sebres
cc153888d5
Merge branch '0.10' into 0.11
2017-12-01 15:55:10 +01:00
sebres
5cc0abbb02
Merge branch '0.10' into 0.11
...
# Conflicts:
# fail2ban/tests/fail2banclienttestcase.py
2017-11-28 16:37:51 +01:00
sebres
12b55bb8cc
Merge remote-tracking branch '0.10' into 0.11
2017-11-27 12:02:46 +01:00
sebres
95f29f457a
Merge branch '0.10' into 0.11
2017-11-24 13:45:43 +01:00
sebres
8aeaaf06ee
Merge branch '0.10' into 0.11
2017-11-23 22:57:21 +01:00
Allan Nordhøy
855f5d0ced
to be found
2017-11-11 14:03:15 +01:00
Allan Nordhøy
fe9e85c71d
"Fail2Ban", other language improvements
2017-11-10 23:56:10 +01:00
sebres
70b933f405
Merge branch '0.10' into 0.11
2017-11-06 18:57:53 +01:00
sebres
12419b75f2
Merge branch '0.10' into 0.11
...
# Conflicts:
# fail2ban/tests/servertestcase.py
2017-10-30 14:02:41 +01:00
sebres
a99513a43e
version bump (0.11.0.dev0) after merge 0.10
2017-10-18 19:05:20 +02:00
sebres
76f5e3659e
Merge branch '0.10' into 0.11
2017-10-18 19:03:08 +02:00
Alex
8175a53826
Update README.md with clarifications
...
+ Added new user clarification for installing from source with git clone.
? Right now it is not clear where the fail2ban-0.11.0.tar.bz2 is available for download.
+ Added command for checking fail2ban version.
2017-10-10 23:15:56 +02:00
sebres
93634dd822
Merge branch '0.10' into 0.11
2017-10-04 14:25:02 +02:00
sebres
6c1d481135
Merge branch '0.10' into 0.11
2017-10-04 09:57:43 +02:00
sebres
037a0be3ae
Merge branch '0.10' into 0.11
2017-10-02 15:43:55 +02:00
sebres
e0fede621e
Merge branch '0.10' into 0.11
2017-09-08 11:33:19 +02:00
sebres
32058ed268
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.11
2017-09-01 10:37:52 +02:00
sebres
b80692f602
Merge branch '0.10' into 0.11
2017-08-18 15:44:43 +02:00
sebres
9dc9477e71
Merge branch '0.10' into 0.11 (pull request gh-1868)
2017-08-18 14:03:40 +02:00
sebres
eca63ab32a
No functional changes, just merge point for "PR #1867 cherry picked into 0.10".
2017-08-18 13:33:25 +02:00
Serg G. Brester
579d2477f5
Merge pull request #1867 from distler/0.11
...
Tweaks to action.d/pf.conf: introduced parameter `block` with default `block quick`
2017-08-17 17:34:05 +02:00
Jacques Distler
d646d06e91
Tweaks to action.d/pf.conf
...
Document recent changes.
Add an option to customize the pf block rule (surely, what the user
really wants, here, is "block quick").
2017-08-17 09:13:32 -05:00
sebres
fdcd847f4a
Merge branch '0.10' into 0.11
2017-08-16 21:26:00 +02:00
sebres
870a33247b
Merge branch '0.10' into 0.11
2017-08-16 20:54:53 +02:00
sebres
aa140f0fa7
Merge branch 0.10 to 0.11, restores merge-point after rebased PR gh-1866 (mistakenly created and merged on 0.11th base);
2017-08-16 17:58:52 +02:00
Serg G. Brester
7c01a9c7b9
Merge pull request #1866 from koeppea/patch-1
...
Update pf.conf fixing #1863 : erroneous flush of all rulesets, also not created with fail2ban.
2017-08-16 17:49:30 +02:00
sebres
3f83b22de2
action.d/pf.conf: anchored call arguments combined as <pfctl> parameter;
...
test cases fixed;
2017-08-16 11:58:39 +02:00
Alexander Köppe
55baf93635
Update pf.conf fixing #1863
...
Fix #1863
Introduce own PF anchors for fail2ban rules.
2017-08-16 11:33:45 +02:00
sebres
099e35103f
Merge branch '0.10' into 0.11
2017-08-14 18:31:52 +02:00
Serg G. Brester
409de18a65
Update README.md
...
0.11: CI stats, etc.
2017-08-10 15:45:50 +02:00
Serg G. Brester
b5dd5adb08
Merge pull request #1460 from sebres/0.10-full
...
0.11 ban-time-incr
2017-08-10 15:23:18 +02:00
sebres
1c06a8b1ef
0.11 - prepared new development edition: README.md, ChangeLog, version.py
2017-08-10 15:19:43 +02:00
sebres
d2c39d2e45
Merge branch '0.10' into 0.10-full
...
# Conflicts:
# fail2ban/server/database.py - resolved and test-case with persistent ban-time fixed/extended (bantime presents in database)
2017-06-16 09:35:27 +02:00
sebres
8403eab2c4
Merge branch '0.10-incr-dynamic-bantime' into 0.10-full
2017-05-17 21:30:20 +02:00
sebres
17a03ebc11
changelog update / typos fixed
2017-05-17 21:03:35 +02:00
sebres
1842f30359
[ticket] remove unneeded code - ticket will be just wrapped from FailTicket to BanTicket;
...
normalize increment of ban-count or time (count increased in BanManager now, some dual increments fixed in the test-cases);
introduced new action-tag `<bancount>`, that is always incremented by each ban (starting by 1), opposite to tag `<bantime>` which can be prolonged retarded (up to 10 seconds)
2017-05-17 19:54:52 +02:00
sebres
157a85451a
[tickets] use slots in ticket (saves memory, and have better performance); uses the same ticket between Fail- and BanManagers, so makes possible operate with more actual data between workers (e. g. ban count and time by increment from observer)
2017-05-17 17:58:26 +02:00
sebres
b893356c49
avoid sporadic errors on time-related test-cases: observer can prolong ticket (increase ban-time) before banning, so blocked before banFound called, to test prolong case.
2017-05-17 15:40:24 +02:00
sebres
c21b4e4d56
[ban-time-incr] prolong ban, dynamic bantime, etc.:
...
- dynamic bantime: introduces new action-tag `<bantime>` corresponds to the current ban-time of the ticket;
Note: because it is dynamic, it should be normally removed from `jail.conf` (resp. `jail.local`).
- introduced new action command `actionprolong`, used for prolongation of the timeout (ban-time of the ticket);
- removed default `timeout` from `actionstart` of several actions;
- faster and safer function escapeTag (replacement at once in one run, '\n' and '\r' escaped also);
2017-05-17 13:25:06 +02:00
sebres
54729f9ef3
Merge branch '0.10' into 0.10-full
2017-05-17 12:24:01 +02:00
sebres
6724de54e6
Merge branch '0.10' into 0.10-full
2017-05-17 11:35:33 +02:00
sebres
ef975307c4
errors on closed socket are too sporadic to cover it (prevents "coverage decreased" over and over again)
2017-03-14 16:24:45 +01:00
sebres
5ff63b66a0
Merge branch '0.10' into 0.10-full
2017-03-14 13:36:32 +01:00
sebres
3cf068670c
Merge branch '0.10' into 0.10-full
2017-03-14 11:47:38 +01:00
sebres
875295320e
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full
2017-03-13 02:12:39 +01:00
sebres
bae38a9fdf
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full
2017-03-01 15:24:28 +01:00
sebres
4b53c6b975
socket, asyncserver: several fixes, python version dependency removed + test coverage extended
2017-02-28 19:52:44 +01:00
sebres
9129a414e3
small fix (missing import of logging) + test coverage
2017-02-28 17:04:01 +01:00
sebres
28b5262976
Merge branch '0.10' into 0.10-full
2017-02-28 15:14:51 +01:00
sebres
fa20b0aff2
Merge branch 'py-3.6-compat' into 0.10-full
2017-02-15 19:18:35 +01:00
sebres
a4ec017d1c
Merge branch '0.10' into 0.10-full
2017-02-15 09:26:01 +01:00
sebres
8c54675750
fix sporadic time related errors after fail2ban restart resp. reload jail:
...
- ValueError: need more than N values to unpack
- empty banip from restoreCurrentBans, etc.
2017-01-23 11:45:29 +01:00
sebres
0636b3247d
observer fix: wait it becomes idle in reload test case (complete writing of failures to database);
2017-01-23 09:52:04 +01:00
sebres
8e2711681c
small performance fix after merge with 0.10
2017-01-23 09:51:52 +01:00
sebres
99634638ba
Merge branch '0.10' into 0.10-full
2017-01-23 09:51:36 +01:00
sebres
ce2b4fe634
amend after newest merge of 0.10:
...
- database duplicate code removed resp. merged with incr. version;
- ignores expired ban ticket directly in ban manager;
- don't change start of ban time for restored tickets in restoreCurrentBans (because of possible timing issues in the test-cases);
- small code review;
2016-10-15 19:53:54 +02:00
sebres
cbfecea112
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full
2016-10-15 19:19:58 +02:00
sebres
53adc9d84a
Merge branch 0.10-full with 0.10
...
Resolved several conflicts and code review after merge
2016-10-14 19:55:20 +02:00
sebres
18ebd9ac21
Merge branches 0.10-full and 0.10
2016-08-17 18:00:25 +02:00
sebres
3bbbe640c0
MANIFEST update for release ban-time-incr version of 0.10
2016-07-15 10:48:02 +02:00
sebres
922213f3d9
Merge tag '0.10.0a1' into 0.10-full
2016-07-15 10:32:42 +02:00
sebres
334bfd50ff
Merge branch '0.10' into 0.10-full
2016-06-12 15:12:50 +02:00
sebres
facda17945
Prevent travis failure with "The log length has exceeded the limit of 4 MB. The job has been terminated"
2016-06-10 02:12:11 +02:00
sebres
12ff119841
Merge branch 'ban-time-incr' into 0.10-full
2016-06-09 22:50:31 +02:00
sebres
e3ab10196e
Merge remote-tracking branch 'remotes/gh-origin/f2b-perfom-prepare-716-cs-0.10' into 0.10-full
2016-06-09 22:13:48 +02:00
sebres
1ec6782f32
fix test cases by testing with multi-threaded execution (wait for threaded execution done)
2016-03-06 18:37:52 +01:00
sebres
bf0adc1fdf
Merge remote-tracking branch 'f2b-perfom-prepare-716-cs' into ban-time-incr (+ conflicts resolved)
2016-03-06 15:12:48 +01:00
sebres
27659c85e6
Merge remote-tracking branch 'master' into f2b-perfom-prepare-716-cs
2016-02-15 21:03:51 +01:00
sebres
70c329e235
increase verbosity for travis/py3 (currently "debug", use "heavydebug" for more details if needed)
2016-02-15 20:44:35 +01:00
sebres
95af3c63ac
increase readability and details level by increased verbosity
2016-02-15 20:42:12 +01:00
sebres
0fef5022f0
reader bug fix: prevent to silent "load" of not existing jail;
...
coverage of test cases increased;
2016-02-15 20:41:20 +01:00
sebres
4ec70d7851
code review, timeout fix, better tracing (and test coverage) by start of server/client (with or without fork)
2016-02-15 19:19:31 +01:00
sebres
6cd19894e9
some compatibility fixes (prevent forking of testcase-process, code review), wait 4 server ready, test cases fixed (py2/py3)
2016-02-15 14:41:12 +01:00
sebres
0e11d81adb
several bug fixed: fork in client-server test cases prohibited, all worker threads daemonized (to prevent hanging on exit).
2016-02-11 21:39:06 +01:00
sebres
f120877756
client/server (bin) test cases introduced, ultimate closes #1121 , closes #1139
...
small code review and fixing of some bugs during client-server communication process (in the test cases);
2016-02-11 17:57:23 +01:00
sebres
4d696d69a0
starting of the server (and client/server communication behavior during start and daemonize) completely rewritten:
...
- client/server functionality moved away from bin and using now the common interface (introduced in fail2bancmdline);
- start in foreground fixed;
- server can act as client corresponding command line;
- command "restart" added: in opposite to "reload" in reality restarts the server (new process);
- several client/server bugs during starting process fixed.
2016-02-11 08:56:12 +01:00
sebres
3fda77227e
temporary commit (move client/server from bin)
2016-02-11 08:52:41 +01:00
sebres
44490664f5
try to start server in foreground
...
# Conflicts:
# fail2ban/server/server.py
2016-02-10 22:00:42 +01:00
sebres
6daa152c0c
Merge branch 'f2b-perfom-prepare-716' into ban-time-incr
2015-12-29 19:53:07 +01:00
sebres
b3d4ce291e
start observer together with the server (parametrized to prevent constantly start/stop of observer by addJail in test cases)
2015-12-29 19:52:16 +01:00
sebres
9d4f163e88
code review and minor repair after merge with performance branch (changed naming convention, wrong resolved conflicts, etc)
2015-12-29 17:36:00 +01:00
sebres
21f058a9f7
Merge remote-tracking branch 'remotes/gh-origin/f2b-perfom-prepare-716' into ban-time-incr
2015-12-29 14:04:41 +01:00
sebres
386da502ba
Merge remote-tracking branch 'master' into 'ban-time-incr'
2015-07-13 16:19:33 +02:00
sebres
d5ebe542f9
Merge branch 'master' into 'sebres:ban-time-incr'
2015-01-05 19:14:51 +01:00
sebres
27bc2e012d
Merge remote-tracking branch 'master' into sebres:ban-time-incr
2014-12-05 17:41:45 +01:00
sebres
ef7f3230ec
added a test case for upgrade database from v2 (additionally to existing v1);
2014-12-03 10:54:32 +01:00
sebres
4dbc77dbbb
code review, test case extended;
2014-12-02 11:57:43 +01:00
sebres
697da99f8f
code review and few new test cases
2014-12-02 01:01:10 +01:00
sebres
5ca275876b
Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr
2014-12-01 23:28:58 +01:00
sebres
5dc1a583b4
Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr
...
Conflicts:
fail2ban/server/actions.py
fail2ban/server/database.py
fail2ban/tests/databasetestcase.py
fail2ban/tests/servertestcase.py
2014-12-01 13:57:51 +01:00
sebres
595edc8d46
increase code coverage
2014-10-28 21:57:16 +01:00
sebres
c1db282fcd
Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr
2014-10-28 16:38:26 +01:00
sebres
286ef6aa87
code review
2014-10-26 22:14:57 +01:00
sebres
361c220846
Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr;
...
normalize code to python >= 2.6;
2014-10-25 19:05:53 +02:00
sebres
3c01dcb01f
Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read-fix1' into ban-time-incr
2014-10-24 05:55:25 +02:00
sebres
2b1e645eb4
Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read-fix1' into ban-time-incr
2014-10-24 05:12:18 +02:00
sebres
293a5066d2
normalizing time config entries: use time abbreviation (str2seconds) for all time options such 'dbpurgeage', 'bantime', 'findtime', ex.: default '1d' instead '86400';
...
code review and test case extended;
2014-10-24 01:32:04 +02:00
sebres
48cd1262fe
Merge 'upstream/master' into sebres:ban-time-incr
2014-10-23 23:34:43 +02:00
sebres
8f2561e289
Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read' into ban-time-incr
2014-10-20 01:37:36 +02:00
sebres
f1d8272693
bug fix (in master): option 'dbpurgeage' was never set (default always) by start of fail2ban, because of invalid sorting of options ('dbfile' should be always set before other database options) / python3 compatibility fix
2014-10-20 01:35:02 +02:00
sebres
1ba48f8627
Merge remote-tracking branch 'remotes/origin/cache-config-read-820' into ban-time-incr
2014-10-09 15:41:52 +02:00
sebres
ec77338e0c
Merge remote-tracking branch 'sebres:cache-config-read-820' into ban-time-incr
2014-10-09 15:13:22 +02:00
sebres
20e6989c73
Merge 'upstream/master' into ban-time-incr:
...
Merge remote-tracking branch 'sebres:cache-config-read-820' into ban-time-incr:
config cache optimized - prevent to read the same config file inside different resources multiple times;
test case: read jail file only once;
+ optimized merge: use OrderedDict.update instead of merge in cycle;
2014-10-08 16:37:07 +02:00
sebres
704357467a
test case for check the read of config files will be cached;
2014-10-07 14:30:51 +02:00
sebres
f70656cdd7
caching of read config files, to make start of fail2ban faster, see issue #820
2014-10-02 22:29:09 +02:00
sebres
e6127a278e
The tricky bug fixed - last position of log file will be never retrieved ( #795 ):
...
addJail (executed before addLog) early uses a "INSERT OR REPLACE" statement to update "enabled" to 1 (and add jail the first time used at once), but this syntax in sqlite always deletes an entry (cause of constraint) and inserts it again, so because of CASCADE all log entries with this jail will be also deleted from logs table.
2014-09-25 18:29:10 +02:00
sebres
7688db2628
observer: logging optimized, some log messages switched to debug level (because long time stable)
2014-09-24 15:22:48 +02:00
sebres
145a9fb891
filter, datedetector, datetemplate: performance optimizing of combination datedetector.matchTime/getTime2, because early getTime search a template and call template.matchTime again (so the date parsing was really executed twice, now just once);
...
debug logging optimized;
added info line log "Start Fail2ban ..." after changed logging target;
2014-09-24 13:21:37 +02:00
sebres
2b38d46fb5
actions: bug fix in lambdas in checkBan, because getBansMerged could return None (purge resp. asynchronous addBan), make the logic all around more stable;
...
test cases: extended with test to check action together with database functionality (ex.: to verify lambdas in checkBan);
database: getBansMerged should work within lock, using reentrant lock (cause call of getBans inside of getBansMerged);
2014-09-23 19:57:55 +02:00
sebres
6c2937affc
python3/pypy compatibility fix + removing obsolete code
2014-09-16 18:12:21 +02:00
sebres
96de888ac7
python3/pypy compatibility fix
2014-09-16 17:51:57 +02:00
sebres
0dce32405f
python3 compatibility fix
2014-09-16 17:27:21 +02:00
sebres
c1637e97b2
now polling backend only: prevent completely read of big files first time (after start of service), initial seek to start time using half-interval search algorithm (see issue #795 ):
...
disabled for gamin and pyinotify backends;
2014-09-16 17:06:49 +02:00
sebres
930678cc0e
Merge remote-tracking branch 'remotes/upstream/master' into ban-time-incr
2014-09-16 13:53:15 +02:00
sebres
53a30a2d42
prevent completely read of big files first time (after start of service), initial seek to start time using half-interval search algorithm (see issue #795 )
2014-09-16 13:50:32 +02:00
sebres
62c755c1d5
Merge remote-tracking branch 'upstream/master' into ban-time-incr
...
Conflicts resolved:
fail2ban/server/database.py
fail2ban/tests/servertestcase.py
delBan modified (if manually unban):
delete from "bips" also (bad ips)
delete all tickets of this ip, also if currently not banned
2014-08-15 11:39:55 +02:00
sebres
6d2b596bb4
observer inherits from JailThread + test cases for bad run;
2014-07-08 10:56:19 +02:00
sebres
e70406d5a1
@commitandrollback decorator added; missing logging module reference added;
2014-07-07 10:28:46 +02:00
sebres
00b7205a3c
Merge remote-tracking branch 'remotes/upstream/master', fix test cases (see bellow)
...
Conflicts resolved:
ChangeLog
fail2ban/server/filter.py
fail2ban/server/jail.py
fail2ban/tests/actionstestcase.py
Test cases fixed:
testBanActionsAInfo - fail ticket with current time (otherwise ticket will be ignored - ban time too old)
testFail2BanExceptHook - use local sys.__excepthook__ to check was really executed and prevent write error in stderr.
2014-06-24 14:02:24 +02:00
sebres
de0beeff9f
new test cases added (increase coverage);
...
prepared to merge with upstream/master;
2014-06-24 12:39:53 +02:00
sebres
819e4eb540
relict of obsolete code removed;
2014-06-19 18:06:07 +02:00
sebres
ccf2521a6d
Merge branch 'master' of https://github.com/fail2ban/fail2ban into ban-time-incr;
...
Conflicts in ChangeLog resolved;
obsolete imports removed;
2014-06-19 17:40:00 +02:00
sebres
6ecd7ddddf
testExecuteTimeout fixed: give a test still 1 second, because system could be too busy
2014-06-10 13:45:29 +02:00
sebres
a82cc3bcbf
prevent to early exit from main loop (tast case bug by multi-threaded execution / wait for completion);
...
idle state fixed (if observer really sleeps only);
2014-06-10 13:24:13 +02:00
sebres
00fdf5ce0a
test cases extended;
...
code review
2014-06-10 12:31:55 +02:00
sebres
bb6655e696
small fix and clarifying code and log messages
2014-06-10 10:24:55 +02:00
sebres
bb0a181056
testcases extended and observer optimized to run test cases faster;
...
code review
2014-06-07 04:37:06 +02:00
sebres
e7bd8ed619
not used import removed
2014-06-06 19:52:42 +02:00
sebres
70080b112a
Merge branch 'master' of https://github.com/fail2ban/fail2ban into ban-time-incr
2014-06-06 19:46:38 +02:00
sebres
681bc2ef07
observer functionality introduced (asynchronous events in separate service thread);
...
ban time increment feature nearly completely moved into observer;
purge database will be called hourly in observer;
bug fixing and code review;
2014-06-06 18:44:59 +02:00
sebres
02055ba4eb
ignore already known tickets (from filter after restart);
...
bug fixing and optimizing;
2014-06-05 14:09:43 +02:00
sebres
8fd083a1ea
Merge remote-tracking branch 'remotes/kwirk/sebres-strptime-bug' into ban-time-incr
2014-05-15 17:12:11 +02:00
sebres
addfea6614
static method forgotten;
2014-05-15 15:16:53 +02:00
sebres
ec3ed0e4ae
introduced string to seconds (str2seconds) for configuration entries with time;
...
todo: expands it for all time config entries;
2014-05-14 16:01:35 +02:00
sebres
f492aa7ac9
remove affected check, to delete jails always (pass testPurge)
2014-05-14 12:32:30 +02:00
sebres
99c9cbf470
code review, manually ban uses by addFailure the count "maxRetry" directly;
...
log ticket time (found in line)
2014-05-14 12:17:28 +02:00
sebres
d22ab320e2
"magic" formula for auto increasing of retry count for known (bad) ip, corresponding banCount of it
...
(one try will count than 2, 3, 5, 9 ...)
2014-05-14 11:21:31 +02:00
sebres
0121e09907
default formula faster and more readable, comparable with "multipliers", like 2**N, default factor for both solutions is 1 now
2014-05-07 13:28:04 +02:00
sebres
7d17fb5c6c
python >= 3.x, local variable 'lastBanTime' reference bug fixed
2014-05-06 20:55:41 +02:00
sebres
a4837da899
Merge branch 'ban-time-incr' of https://github.com/sebres/fail2ban into ban-time-incr
2014-05-06 20:32:23 +02:00
sebres
3a75c8a752
ban time incr: 2st test case added (code optimized for test cases), to test both stand-alone:
...
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 20:30:12 +02:00
sebres
6c8327e39f
indentation level fix
2014-05-06 20:24:49 +02:00
sebres
14167ed778
ban time incr: 2st test case added (code optimized for test cases), to test both stand-alone:
...
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 20:14:23 +02:00
sebres
237706e39f
ban time incr: 1st test case added, to test it stand-alone:
...
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 17:57:11 +02:00
sebres
c48e404e63
option "multipliers" added, how proposed from @yarikoptic;
...
the calculate formula is rewritten to lambda / compiled solution (up to 10 million times per seconds);
code review;
2014-05-06 16:07:16 +02:00
sebres
ccacfc1047
code review
2014-05-05 15:17:22 +02:00
sebres
ccf07c4b21
- some bug fixed to pass all test cases;
...
- database_v1.db/bans/jail-name bug fixed - cause of different jail name in jails and bans, in test case (by updateDb): FOREIGN KEY constraint failed:
$ sqlite3 fail2ban/tests/files/database_v1.db
sqlite> select distinct jail from bans;
DummyJail #16244880 with 0 tickets
sqlite> select distinct name from jails;
DummyJail #29162448 with 0 tickets
sqlite> update bans set jail = (select distinct name from jails);
2014-05-05 14:47:50 +02:00
sebres
6f7c9b7d0f
introduced new feature "ban time exponential increasing":
...
"bantimeextra.enabled" in jail.conf allows to use database for searching of previously banned ip's to increase a default ban time using special formula,
by default, each next ban it will be original banTime * 1, 2, 4, 8, 16, 32...
see "jail.conf" for some other options of "bantimeextra";
additional we can configure a little randomization of ban time, to prevent "clever" botnets calculate exact time IP can be unbanned.
WARNING: by first start the server upgrades sqlite database (table "bans" will recreated with another schema);
2014-05-05 12:38:54 +02:00