Sergey G. Brester
8f83242c25
suppress unneeded info (moved to debug level)
...
CI / build (3.9) (push) Canceled after 0s
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 (pypy2) (push) Canceled after 0s
CI / build (pypy3) (push) Canceled after 0s
see #3186
2021-12-20 15:39:57 +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
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
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
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
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
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
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
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
sebres
1627d4f573
filter.d/sendmail-auth.conf: user not found, closes gh-3030
2021-05-25 23:16:29 +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
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
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
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
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
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
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
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
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
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
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
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
sebres
27e435a7f5
fix cymru test cases
2020-12-22 20:36:01 +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
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
a107a8e7d2
setup.py: cherry-pick from 0.11 (option --without-tests)
2020-11-23 14:59:45 +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
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
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
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
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
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
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
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
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
ad51fb7e1e
partial cherry-pick fd25c4cbb8 ( #2768 )
2020-08-24 16:41:22 +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
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
sebres
309c8dddd7
action.d/nftables.conf (type=multiport only): fixed port range selector (replacing : with -)
2020-06-24 19:20:36 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
49bf6132cc
amend for 3036ed1889: eliminate "invalid sequence" warnings
2019-05-14 21:40:33 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
sebres
89c611064d
test-cases: be sure the test-files always written with new-line at end
2019-01-14 19:00:42 +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
67247999ff
closes #2313 : missing dependency to nftables.service
2019-01-06 17:03:09 +01: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
sebres
c9ba695ba3
minor, no cover for 3.x (2.6 only)
2018-12-28 00:04: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
Alexander Koeppe
df9b352bac
Update information reg. ipdns.py as successor for dnsutils.py
2018-12-19 12:17:44 +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
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
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
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
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
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
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
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
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
e2a255d104
fixed typo in comments by "ignoreself" parameter
2018-08-14 11:11:19 +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
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
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
94ffd00328
fixes initialization bug if sys.stdout.encoding is None (closes gh-2177).
2018-07-11 13:21:53 +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
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
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
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
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
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
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
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
sebres
1b4ba602ba
normalize bool conversion, introduced common helper function _as_bool
2018-04-26 16:48:23 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
5f3ba289d6
restore code coverage (decreased in latest "fixes") - no cover for unreachable cases;
2018-01-24 20:03:46 +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
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
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
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
9a38d5697f
bump version (0.10.2 -> 0.10.3.dev1)
2018-01-18 16:40:48 +01:00
sebres
a45488465e
prepare release: bump version, update ChangeLog, man's and MANIFEST etc.
2018-01-18 14:49:01 +01:00
sebres
81b61fe30c
ChangeLog update
2018-01-18 14:19:55 +01:00
sebres
f69e28adfc
action.d/pf.conf: compatibility fix - recognizes that parameter port specified as empty, with or without braces (should be more backwards compatible to 0.9 now).
2018-01-18 14:05:22 +01:00
sebres
ed22ddbbbb
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2018-01-17 16:42:56 +01:00
Sergey G. Brester
37f5a6975e
Merge pull request #2015 from BenediktSeidl/nginx-http-auth--spaces-fix
...
nginx-http-auth: match usernames with spaces
2018-01-17 16:40:54 +01:00
sebres
63e906b2c1
regex rewritten: a bit fewer vulnerable now and using non-capturing groups, test-cases extended in order to cover trying of injection on user name
2018-01-17 16:35:32 +01:00
Benedikt Seidl
fed6c49c2d
nginx-http-auth: match usernames with spaces
...
# Conflicts:
# ChangeLog
2018-01-17 16:35:31 +01:00
Sergey G. Brester
9a8c4a9869
Merge pull request #2018 from riceru/patch-1
...
lighttpd-auth.conf: new log-format (http_auth -> mod_auth)
2018-01-17 12:14:38 +01:00
Sergey G. Brester
b6c6565a7e
regex updated using non-capturing groups
2018-01-16 14:23:47 +01:00
Sergey G. Brester
9a46590486
extended test-cases to cover new log-format (http_auth -> mod_auth)
2018-01-16 14:20:51 +01:00
riceru
6a1bbbf101
Update lighttpd-auth.conf
...
I have lighttpd 1.4.45 (Debian 9) and auth error log is different.
Now printing mod_auth and not http_auth.
I think that the change was in Lighttp 1.4.42
2018-01-16 12:39:55 +00:00
sebres
2b7b0da943
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2018-01-15 18:16:43 +01:00
sebres
2bce0c5e3e
file-filter's: provide stop function in order to explicitly delete/stop monitoring of each file.
2018-01-15 18:00:15 +01:00
sebres
81c86fa83f
Remove annoying error-message "rm_watch: cannot remove WD=2, Errno=Invalid argument (EINVAL)", logged from pyinotify-module if rm_watch called with non-existing watch file descriptor (probably multi-threaded issue by dual-remove).
...
Closes gh-1865
2018-01-15 17:12:07 +01:00
sebres
b644d2d73f
should fix sporadic coverage decrease (don't cover "return", because too sporadic to get idle in pyinotify-callback);
2018-01-11 20:23:22 +01:00
sebres
7516cd025d
fixed restoring sane environment (via stop/start) if invariant check failed: bypass possible errors in stop (if start/check succeeded hereafter);
...
test cases extended to cover such situation.
Closes gh-1997
2018-01-11 13:21:36 +01:00
Serg G. Brester
7e05976ead
action.d/hostsdeny.conf: actionunban rewritten using sed, also dots in IP were escaped now.
...
Closes #2000
2018-01-11 12:38:34 +01:00
sebres
29e1fe9479
micro-fix: delete temporary file (forgotten in test-case test_move_dir by reassign to directory)
2018-01-11 11:15:58 +01:00
Serg G. Brester
6251fcf5f7
Merge pull request #2014 from sebres/sshd-fix-connects-with-mult-pub-keys
...
stop ban of legitimate users with multiple public keys (e. g. git, etc)
2018-01-11 10:27:35 +01:00
sebres
1c0fc73e48
Update ChangeLog
2018-01-11 10:27:38 +01:00
sebres
2112145eb4
stop ban of legitimate users with multiple public keys (e. g. git, etc), thereby
...
differentiate between "invalid user" (going banned earlier) and valid users with public keys, for which the rejects of not valid public keys (failures) will be retarded up to "Too many authentication failures" resp. disconnect without success (accepted public key).
2018-01-10 19:07:20 +01:00
sebres
314e402fe0
filter.d/sendmail-auth.conf - extended daemon for Fedora 24/RHEL - the daemon name is "sendmail" (gh-1632)
2018-01-10 14:49:06 +01:00
sebres
c36fbdf743
test cases extended in order to cover firewallcmd-ipset with allports
2018-01-10 12:13:07 +01:00
sebres
c30144b37a
Merge branch '0.9' into 0.10
...
# Conflicts:
# config/action.d/firewallcmd-ipset.conf
# config/filter.d/asterisk.conf
# Merge-point after cherry-pick, no changes:
# fail2ban/client/jailreader.py
# fail2ban/helpers.py
2018-01-10 12:05:26 +01:00
Serg G. Brester
029cd5aa24
Update ChangeLog
2018-01-10 11:47:59 +01:00
Serg G. Brester
597a27576e
Merge pull request #1908 from GetPageSpeed/firewallcmd-ipset-allports
...
New ban mode `allports` for `firewallcmd-ipset`. Closes #1167
2018-01-10 11:43:44 +01:00
sebres
131b94e11e
firewallcmd-ipset-allports: implemented in action.d/firewallcmd-ipset.conf now (action.d/firewallcmd-ipset-allports.conf removed), usage:
...
banaction = firewallcmd-ipset[actiontype="<allports>"]
2018-01-10 10:58:03 +01:00
Danila Vershinin
c190631f88
New ban action firewallcmd-ipset-allports. Closes #1167
2018-01-10 10:58:01 +01:00
sebres
3d9a112c8f
cherry-pick newer version of extractOptions, in order to avoid large discrepancy between 0.10 and 0.9 config-parsers:
...
allow to use dual parameter lists (coming through substitutions), e. g.: `name[p1=0, p2="..."][p3='...']`;
simplified explanation: `][` treats as `,` in new version.
cherry-picked from 0.10.
2018-01-10 10:57:59 +01:00
Serg G. Brester
82f8bd8639
Merge pull request #2011 from Yannik/patch-1
...
Fix filter not catching asterisk requests with quote character in username (fixes #2010 )
2018-01-10 09:27:29 +01:00
Serg G. Brester
f7e2d3610b
Update ChangeLog
2018-01-09 21:19:01 +01:00
Serg G. Brester
a1d1498561
Restore log-entries not affected by #2011
2018-01-09 21:13:02 +01:00
sebres
f6d0c86533
test cases extended: flush jail in database
2018-01-09 12:16:37 +01:00
sebres
2c69c0e7e5
flush jail in database: bulk remove of all IPs in the database (e. g. reload --unban).
2018-01-09 12:15:56 +01:00
Yannik Sembritzki
aab54bb0dd
don't replace normal test case with specialized test case
2018-01-08 22:29:43 +01:00
Yannik Sembritzki
94f0b15c32
Allow faster parsing of hosts without ' characters in them
2018-01-08 14:54:32 +01:00
Yannik Sembritzki
eaf5e88692
replace actual offenders ip with 1.2.3.4
2018-01-03 19:00:09 +01:00
Yannik Sembritzki
184202c6aa
remove duplicate testcase
2018-01-03 18:49:38 +01:00
Yannik Sembritzki
a53ee46ad4
add test for asterisk pjsip attack with quote in username
2018-01-03 18:48:11 +01:00
Yannik Sembritzki
b28dfb965a
Fix filter not catching asterisk requests with quote character in username ( fixes #2010 )
2018-01-03 18:39:30 +01:00
sebres
1e39c2600c
cherry-pick from 0.11: changes in updateDb because it can be executed after repair, and some tables can be missing.
2017-12-22 17:21:11 +01:00
sebres
277edd5fe5
amend to pull request #2004 : merge remote-tracking branch 'sebres/auto-repair-database' into 0.10
2017-12-22 16:21:22 +01:00
sebres
ab3d03beec
Better variant of repair database: recreate all tables/indices, that can be missing after supposedly successful rescue
2017-12-22 16:13:57 +01:00
Serg G. Brester
75f00a3a6c
Merge pull request #2004 from sebres/auto-repair-database
...
Automatically recover or recreate corrupt persistent database
2017-12-22 14:31:25 +01:00
Serg G. Brester
b104da2800
Merge pull request #2005 from sebres/0.10
...
Stability fix for fail2banclienttestcase, avoid sporadic coverage decrease.
2017-12-22 14:27:20 +01:00
sebres
a10d544ddc
coverage: fix another sporadic coverage decrease, if idle mode never reached in some test-cases (e. g. by slowly reloading of jails).
2017-12-22 14:12:19 +01:00
sebres
80932af406
coverage: testErrorsInLoop should avoid sporadic coverage changes, if some communication errors not occurred sometimes.
2017-12-22 13:29:35 +01:00
sebres
a1fd2c507e
method waitForServerEnd renamed into stopAndWaitForServerEnd (because will also stop the server)
2017-12-22 13:00:29 +01:00
sebres
1ad587ac7c
Stability fix for fail2banclienttestcase:
...
- provide waitForServerEnd method for decorator `with_foreground_server_thread`, to wait for real server stop if needed;
- accept any exit code in decorator `with_foreground_server_thread`, because multi-threaded, thus server can exit in-between;
- fix sporadic fail "AssertionError: 'Banned 5 / 5, 5 ticket(s)' was not found" (if some tickets will be processed earlier,
thus not as chunk but separately), so in case of:
Banned 1 / 1, 1 ticket(s) in 'nginx-blck-lst'
Banned 4 / 5, 5 ticket(s) in 'nginx-blck-lst'
2017-12-22 12:36:01 +01:00
Serg G. Brester
2d23f35d26
Update ChangeLog
...
typo: missing newline restored.
2017-12-21 22:50:54 +01:00
sebres
79443210ad
Update ChangeLog
2017-12-21 22:49:57 +01:00
sebres
9374de59f3
Automatically recover or recreate corrupt persistent database (e. g. if failed to open with 'database disk image is malformed').
...
Closes #1465
2017-12-21 22:38:54 +01:00
Serg G. Brester
61109d5c4f
Merge pull request #1996 from meke/firewallcmd-new_actioncheck_error
...
firewallcmd-new actioncheck Error
2017-12-09 15:59:40 +01:00
root
79f414c6a2
fix <family> typo
2017-12-09 15:55:45 +01:00
root
7c63eb2378
In the CentOS7 and epel environment, result of "firewall-cmd -direct -get -chains ipv4 filter" is displayed one line
...
Changed to be multiple lines with reference to firewallcmd-multiport.conf
2017-12-09 15:55:45 +01:00
Serg G. Brester
95a87077f7
Merge pull request #1995 from sebres/firewallcmd-ipset-flush
...
action.d/firewallcmd-ipset.conf: extended with actionflush to bulk unban resp. flush ipset
2017-12-06 11:43:01 +01:00
sebres
bf6667d4da
better (sane) stop server handling, AsyncServer.stop_communication back-ported to 0.10 (cherry-picked from 0.11);
2017-12-06 01:38:39 +01:00
sebres
6ccaa03e00
action.d/firewallcmd-ipset.conf: extended with actionflush to bulk unban resp. flush ipset
2017-12-06 01:10:56 +01:00
sebres
aa9cefc3f8
proper stop server in the test cases (quit should stop all server-side threads, also if server was not really started);
...
fix-up for run_with_except_hook: avoid very sporadic error "'NoneType' object has no attribute 'exc_info'" (https://bugs.python.org/issue7336 ),
only extremely fast systems are affected ATM (2.x / 3.x), if thread ends nothing is available in .
2017-12-06 01:09:04 +01:00
sebres
2712f72650
Merge remote-tracking branch 'master' into 0.10
2017-12-06 00:09:52 +01:00
Serg G. Brester
ad658a0a95
Merge pull request #1989 from sebres/logging-options
...
New server logging options
2017-12-06 00:07:51 +01:00
Serg G. Brester
f96761927d
Merge pull request #1969 from RaidForums/patch-1
...
Update nginx-limit-req filter.
2017-12-05 23:51:18 +01:00
sebres
cc9ff31c9c
Update ChangeLog: action.d/firewallcmd-ipset.conf: fixed create of set for ipv6 (missing family inet6, gh-1990)
2017-12-05 23:35:34 +01:00
sebres
e384acca5f
action.d/firewallcmd-ipset.conf: fixed create of set for ipv6 (missing family inet6)
2017-12-05 23:34:03 +01:00
Kevin Maradona
6c705d572b
filter.d/nginx-limit-req.conf: nginx limit-req log-level can be set to warn or error therefore having this regex will include both of them.
2017-12-05 22:31:54 +01:00
sebres
55143ce1d9
coverage increase
2017-12-05 19:32:13 +01:00
sebres
f9833ddee4
Update ChangeLog
2017-12-05 18:55:47 +01:00
sebres
1bf6636446
Introduced new parameters for logging within fail2ban-server;
...
Usage `logtarget = target[facility=..., datetime=on|off, format="..."]`:
- `facility` - specify syslog facility (default `daemon`, see https://docs.python.org/2/library/logging.handlers.html#sysloghandler
for the list of facilities);
- `datetime` - add date-time to the message (default on, ignored if `format` specified);
- `format` - specify own format how it will be logged, for example for short-log into STDOUT:
`fail2ban-server -f --logtarget 'stdout[format="%(relativeCreated)5d | %(message)s"]' start`;
Closes gh-1980
2017-12-05 18:54:21 +01:00
sebres
de97dedba0
move extractOptions from JailReader to helpers (common usage server- / client-side);
2017-12-05 17:49:22 +01:00
Serg G. Brester
ff987b60cd
Merge pull request #1988 from sebres/exim-aggressive
...
Exim aggressive
2017-12-05 17:30:10 +01:00
Serg G. Brester
b0ba1aa846
Update ChangeLog
2017-12-05 16:24:04 +01:00
sebres
ffd6b9f6de
jail.conf: extended with new parameter mode for the filters supporting it;
2017-12-05 16:09:18 +01:00
sebres
2b68882502
filter.d/exim.conf: provides mode "aggressive" to ban flood resp. DDOS-similar failures;
...
Closes #1983
2017-12-05 16:07:53 +01:00
sebres
7f89fbc33f
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-12-01 15:53:11 +01:00
Serg G. Brester
f834e7826d
Merge pull request #1979 from peternowee/fix-exim-lowercase-auth
...
Exim failregex: Include lower/mixed case AUTH
2017-12-01 15:22:09 +01:00
Peter Nowee
e4bbaf3d58
Update ChangeLog
2017-12-01 15:01:48 +01:00
Serg G. Brester
f1c89f6631
Merge pull request #1981 from sebres/datedetector-dual-space
...
datedetector: extended default date-patterns (allows extra space between the date and time stamps)
2017-12-01 10:48:00 +01:00
sebres
5547697401
ChangeLog and typo
2017-12-01 10:16:14 +01:00
sebres
2e437937c3
datedetector: extended default date-patterns (allows extra space between the date and time stamps);
...
* introduces 2 new format directives (with corresponding `%Ex` prefix for more precise parsing):
- %k - one- or two-digit number giving the hour of the day (0-23) on a 24-hour clock,
(corresponds %H, but allows space if not zero-padded).
- %l - one- or two-digit number giving the hour of the day (12-11) on a 12-hour clock,
(corresponds %I, but allows space if not zero-padded).
* mysqld-auth test extended to cover new date-format in log.
Closes gh-1639
2017-11-30 17:06:37 +01:00
Serg G. Brester
cbd63d9cd5
added test to cover quoted injecting on AUTH command
2017-11-30 12:45:11 +01:00
Serg G. Brester
4f63180611
Avoid injection using quotes after auth command;
...
Added non-greedy fallback for quoted something (with lookahead simulated possessive greedy catch of non-quoted parts `[^"]*(?=")`).
Note that because host-info's are hereafter (with foreign input in-between), we would not use greedy or non-greedy catch-alls (`.*` or `.*?`) here (preventing performance losses).
2017-11-30 12:32:24 +01:00
Serg G. Brester
f59df2e156
Avoid any injecting on protocol (e. g. tries using camel-case)
...
The phrase "AUTH command used when not advertised" is precise enough as anchor here, so prevent by any foreign-input (any auth protocol error).
2017-11-29 20:55:48 +01:00
Peter Nowee
aa158ac05f
Exim failregex: Include lower/mixed case AUTH
...
When reporting the error `AUTH command used when not advertised`, Exim
starts with `SMTP protocol error in "........."`. Here, Exim logs the
SMTP command as it was provided by the connecting client.
https://github.com/Exim/exim/blob/exim-4_89+fixes/src/src/smtp_in.c#L2850
According to RFC 5321 (SMTP) "[..] a command verb [..] MAY be encoded
in upper case, lower case, or any mixture of upper and lower case with
no impact on its meaning."
https://tools.ietf.org/html/rfc5321#section-2.4
Lower case `auth login` brute-force attempts were seen in the wild and
were not caught by the current failregex.
This commit makes the failregex case-insensitive for the `AUTH`
command, so that lower case (`auth`) or mixed case (`aUtH`) now also
match. The failregex was already case-insensitive for the command
arguments (e.g. `AUTH login` already matched).
2017-11-29 15:14:43 +01:00
SlowRiot
660d57e6ba
updating my email address
2017-11-29 10:43:15 +01:00
sebres
fbf89e8cdd
typo in indent (spaces to tabs)
2017-11-28 16:32:16 +01:00
Serg G. Brester
f917b4346b
Merge pull request #1974 from sebres/nginx-block-map
...
session-related blacklisting via nginx
2017-11-28 16:27:21 +01:00
sebres
55c2a9968a
remove lacking [Init] section check ([Init] section not necessary anymore for actions also);
...
fix sporadic error by shutdown server in with_foreground_server_thread decorator (if shutdown too fast, but end-phase still does not reached the tester-thread);
2017-11-28 16:14:17 +01:00
sebres
b62ab2d51e
ChangeLog updated
2017-11-28 13:46:57 +01:00
sebres
76f2865883
implemented new action "action.d/nginx-block-map.conf", used in order to ban not IP-related tickets via nginx (session blacklisting in nginx-location with map-file);
2017-11-28 13:42:41 +01:00
Serg G. Brester
4fa0f48fa1
Merge pull request #1970 from sebres/fix-gh-1876
...
Fix logging to systemd-journal (gh-1876)
2017-11-27 10:04:38 +01:00
sebres
6db9ae8574
ChangeLog updated
2017-11-26 23:35:11 +01:00
sebres
af0f7e93ce
better handling by start/stop of server in foreground mode;
...
don't call logging.shutdown because part of exit in fail2bancmdline.
2017-11-26 23:06:35 +01:00
sebres
f31195a4fc
added new logtarget "SYSOUT" to log from fail2ban working in foreground as systemd-service (in opposite to "STDOUT" don't log time-stamps).
2017-11-26 23:03:29 +01:00
sebres
100b531aff
travis: add build for python 3.7-dev and switch to newest pypy3.3 in travis
2017-11-24 13:33:20 +01:00
sebres
7bf5980def
no root option if testing within virtualenv (fixed now).
2017-11-24 13:20:19 +01:00
sebres
fa007bfa7c
remove build folder, if created through setup-process in test
2017-11-24 12:57:55 +01:00
sebres
eac80966c5
Fix scripts-root within fail2ban.service (relative install root-base directory).
...
This is amend for e3b061e94b .
Closes gh-1964
2017-11-24 12:54:45 +01:00
sebres
6db8db04f8
Merge branch 'master' into 0.10: fixed test-cases covering dns2ip (IP of www.epfl.ch changed)
2017-11-23 22:46:17 +01:00
sebres
5708b8b90e
fixed test-cases covering dns2ip (IP of www.epfl.ch changed)
2017-11-23 22:42:51 +01:00
sebres
159957ab88
filter.d/sshd.conf: extended failregex for modes "extra"/"aggressive": now finds all possible (also future) forms of "no matching (cipher|mac|MAC|compression method|key exchange method|host key type) found", see "ssherr.c" for all possible SSH_ERR_..._ALG_MATCH errors;
...
obsolete (multi-line buffered) variant extended also.
Closes gh-1943, gh-1944
2017-11-23 22:21:42 +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
7e756da2b9
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-11-06 18:56:31 +01:00
Serg G. Brester
4cd3b2d4c9
Merge pull request #1955 from sebres/fix-initial-config
...
config/paths-*.conf: initial values and normalization
2017-11-06 18:30:13 +01:00
Serg G. Brester
ee80c52430
Update ChangeLog
2017-11-03 14:15:54 +01:00
sebres
eba68a8f37
config/paths-common.conf: Added initial values for syslog_authpriv, syslog_mail in order to avoid errors while parsing/interpolating configuration;
...
Note the systemd-backend does not need the logpath at all;
Some defaults normalized (minimized configs, don't need to overwrite values in distribution-related path if equal).
2017-11-03 14:15:07 +01:00
Serg G. Brester
c06f3c3fb8
Merge pull request #1812 from jpotter/patch-1
...
Replace port imap3 with imap
2017-11-03 14:05:57 +01:00
Serg G. Brester
4d10c615c4
Update ChangeLog
...
typo
2017-11-03 14:05:17 +01:00
Serg G. Brester
8b26fd2778
Update ChangeLog
2017-11-03 14:03:47 +01:00
Serg G. Brester
9876dd44f9
replace port imap3 with imap everywhere, since imap3 is not a standard port and old rarely (if ever) used and missing on some systems
...
(see gh-1942)
2017-11-03 14:03:06 +01:00
Jeff Potter
4a2fc8b7e8
Include imap (port 143) in courier-auth ports
...
imap was missing from the list of ports, preventing fail2ban from blocking connections on standard IMAP port 143.
2017-11-03 14:01:19 +01:00
Serg G. Brester
a87af7bf41
Merge pull request #1948 from itoffshore/alpine
...
gentoo-initd: add descriptions
2017-11-03 13:30:18 +01:00
Stuart Cardall
18d2761dc0
gentoo-initd: add descriptions
...
add descriptions to stop syslog errors for extra_started_commands when running:
rc-service ipset describe
Oct 28 15:13:30 xxxx daemon.warn /etc/init.d/fail2ban[26446]: ^[[1m^[[36mreload^[[m: no description
Oct 28 15:13:30 xxxx daemon.warn /etc/init.d/fail2ban[26447]: ^[[1m^[[36mshowlog^[[m: no description
2017-11-01 22:19:14 +01:00
sebres
b615a98540
jail.conf: avoid overwriting of default value of the parameter chain of several actions (where default chain != INPUT);
...
test-cases extended to cover the same logic (use `<known/chain>` instead of fix value `INPUT`);
Closes gh-1949
2017-10-30 13:32:52 +01:00
Serg G. Brester
e07a8cda07
Update jail.conf
...
Documentation of parameters for action blocklist_de, closes gh-1940
2017-10-27 15:26:17 +02:00
Serg G. Brester
2409c4506a
Merge pull request #1917 from martin61/patch-1
...
add ip6tables.service ipset.service in systemd unit
2017-10-20 12:39:46 +02:00
martin61
5db497017a
add ip6tables.service ipset.service in systemd unit
2017-10-19 16:44:18 +02:00
Serg G. Brester
1a8fb6290d
Merge pull request #1926 from sebres/0.10-pf-actionflush
...
action.d/pf.conf: wildcard anchoring example + bulk-unban with command `actionflush`
2017-10-19 16:35:46 +02:00
sebres
0e66e3cc57
Merge branch 'master' into 0.10
...
# Conflicts:
# config/filter.d/asterisk.conf
2017-10-18 19:00:23 +02:00
Serg G. Brester
0aeb91d1e2
Merge pull request #1929 from miken32/patch-1
...
Remove invalid (vulnerable) regex using IP from foreign input (not the originator).
2017-10-18 18:54:43 +02:00
Serg G. Brester
d81405adbc
Update ChangeLog
...
typo
2017-10-18 18:52:55 +02:00
Serg G. Brester
b6ab0aa83f
Update ChangeLog
...
more detailed entry
2017-10-18 18:52:12 +02:00
Michael Newton
894a05b843
Update ChangeLog
2017-10-18 09:26:51 -07:00
Michael Newton
3f715e8577
Remove tests
2017-10-17 14:46:11 -07:00
Michael Newton
d5d1fe679f
Remove invalid regex
...
Resolves #1927
2017-10-17 14:44:23 -07:00
sebres
a1b863fcf6
action.d/pf.conf: extended with bulk-unban, command actionflush in order to flush all bans at once (by stop jail, resp. shutdown of fail2ban)
2017-10-17 20:12:48 +02:00
sebres
667f48817b
Merge pull request #1925 from sebres/0.10-fix-pf-multiport:
...
action.d/pf.conf: fix multiport syntax
2017-10-17 16:09:50 +02:00
sebres
3c4910a3e2
ChangeLog entry + note for possible incompatibility.
2017-10-17 16:06:39 +02:00
sebres
8726c9fb0a
pf.conf: enclose ports in braces, multiple ports expecting this syntax ... any port {http, https}.
...
Note this would be backwards-incompatible change (for the people already enclosing multiports in braces in jail.local).
closes gh-1915
2017-10-17 13:46:29 +02:00
Serg G. Brester
c6029bbef6
Merge pull request #1919 from IdahoPL/IdahoPL-patch-1
...
Update pf.conf commet to fix syntax error
2017-10-17 12:40:51 +02:00
Łukasz Wąsikowski
a4f94d2619
Update pf.conf
...
Fix comment, because current one won't work:
cat /etc/pf.conf
anchor f2b {
sshd
}
# service pf reload
Reloading pf rules.
/etc/pf.conf:2: syntax error
New version:
cat /etc/pf.conf
anchor f2b {
anchor sshd
}
# service pf reload
Reloading pf rules.
2017-10-17 12:39:25 +02:00
Serg G. Brester
c42dd6941c
Merge pull request #1921 from harry-wood/patch-1
...
typo
2017-10-16 10:50:11 +02:00
Harry Wood
ea1b663f85
typo
...
spell "positive" (...but also somebody should finish this sentence)
2017-10-16 01:15:58 +01:00
sebres
028f32b74b
bump version (0.10.1 -> 0.10.2.dev1)
2017-10-12 14:00:41 +02:00
sebres
351abeb4ff
prepare release: bump version, update ChangeLog, man's and MANIFEST etc.
2017-10-12 13:46:46 +02:00
sebres
ceff489a46
amend to a4459765ef: irrelevant condition removed
2017-10-04 14:24:21 +02:00
sebres
a4459765ef
pyinotify/polling: test filter reaction by delete of watching file, better detection of pending file (avoid errors in fail2ban.log during log-rotation).
...
Closes gh-1865 for filterpyinotify ("cannot remove WD=2").
2017-10-04 14:17:00 +02:00
sebres
e71f16f6ba
Merge branch 'master' into 0.10
...
# Conflicts resolved:
# config/filter.d/dovecot.conf
2017-10-04 09:57:18 +02:00
sebres
ea36e1b3fc
filter.d/dovecot.conf: fixed failregex to recognize pam_authenticate failures with "Permission denied" (gh-1897)
2017-10-04 09:55:37 +02:00
Serg G. Brester
32deb828a1
Merge pull request #1904 from sebres/no-dup-ignoreip-fix-1900
...
Avoid exact duplicates by addIgnoreIP (closes gh-1900)
2017-10-04 08:41:40 +02:00
sebres
d1fad22ac1
Avoid exact duplicates by addIgnoreIP (closes gh-1900)
2017-10-02 15:59:14 +02:00
sebres
8c804a2290
Merge branch 'master' into 0.10
...
# Conflicts resolved:
# config/filter.d/postfix-rbl.conf
# config/filter.d/postfix-sasl.conf
# config/filter.d/postfix.conf
# fail2ban/tests/files/logs/postfix-sasl
2017-10-02 15:41:30 +02:00
sebres
a2120a9de5
filter.d/postfix-*.conf - added optional port regex (closes gh-1902)
2017-10-02 15:31:55 +02:00
Serg G. Brester
6140a0f2d4
Merge pull request #1894 from sbraz/nftables-ipv6
...
Fix nftables actions for IPv6 addresses, fixes #1893
2017-09-13 09:14:39 +02:00
Serg G. Brester
6149df5216
Update ChangeLog
2017-09-12 09:27:16 +02:00
Louis Sautier
152c9d27d5
Fix nftables actions for IPv6 addresses, fixes #1893
...
* add [Init?family=inet6] to nftables-common.conf and make nftable
expressions more modular
* change "ip protocol" to "meta l4proto" in nftables-allports.conf
since the former only works for IPv4
2017-09-11 23:32:53 +02:00
Serg G. Brester
fbd46f29f2
Merge pull request #1891 from sbraz/openrc
...
Fix Gentoo init script's shebang
2017-09-11 12:24:10 +02:00
Serg G. Brester
72ad904f58
Update ChangeLog
2017-09-11 12:22:43 +02:00
Louis Sautier
2ce0ffb977
Fix Gentoo init script's shebang
...
Use openrc-run instead of runscript.
https://github.com/OpenRC/openrc/commit/5d5856c193768d24f11d5f0533e48c39526aef5c
2017-09-11 12:19:33 +02:00
Serg G. Brester
8be4569d51
Update ChangeLog
...
several fixes of 0.10th branch
2017-09-08 11:32:08 +02:00
sebres
b185e7cb04
Merge remote-tracking branch 'upstream/master' into 0.10
2017-09-08 11:11:05 +02:00
Serg G. Brester
983b128c54
Update ChangeLog
...
several fixes of 0.9th branch
2017-09-08 11:07:48 +02:00
Serg G. Brester
5221693ce0
Merge pull request #1889 from sebres/0.10-small-optim-review
...
0.10 small optimization & review, config-reader, pretty-dump, etc.
2017-09-08 10:57:27 +02:00
sebres
462b534469
restrict saving of previous known values to section-related (don't overwrite with the values of other sections, especially like "INCLUDES", etc.)
2017-09-07 20:00:45 +02:00
sebres
e20f6204d3
don't put parameters starting with known/ to the ready stream (intermediate options only), makes streams and dumps of configuration shorter and better readable
2017-09-07 19:32:14 +02:00
sebres
b698a74902
introduces new command-line options --dp, --dump-pretty to dump the configuration using more human readable representation;
...
allow dump of configuration, also if log-file is not available (warning only)
2017-09-07 19:31:38 +02:00
Serg G. Brester
fd83260bd8
jail "pass2allow-ftp" should supply blocktype to action
...
closes gh-1884
2017-09-07 18:51:08 +02:00
Serg G. Brester
bb97e66627
Merge pull request #1882 from coderua/patch-1
...
Add Jorgee Vulnerability Scanner protect
2017-09-07 15:52:31 +02:00
Serg G. Brester
99a9a9136e
Merge pull request #1887 from fail2ban/exim-gh-1886
...
filter.d/exim.conf: fixed failregex for case of flood attempts with `D=0s`
2017-09-07 15:47:20 +02:00
Serg G. Brester
db121a6f85
Update exim
...
Test case covers flood attempts with `D=0s`
2017-09-07 15:32:35 +02:00
Serg G. Brester
2cd02b731b
filter.d/exim.conf: fixed failregex for case of D=0s
...
Closes gh-1886
2017-09-07 15:28:46 +02:00
sebres
4bc226a692
optimized regex
2017-09-05 10:59:16 +02:00
Vladimir Chumak
fafefc0293
Add Jorgee Vulnerability Scanner protect
...
Details for Jorgee Vulnerability Scanner: https://www.symantec.com/security_response/attacksignatures/detail.jsp?asid=30164
2017-09-05 10:56:43 +02:00
sebres
acd9e8155b
Merge pull request #1376 from j-marz/master:
...
Added ZoneMinder filter
2017-09-04 11:52:10 +02:00
sebres
4163f32968
small review, prefix replaced with %(_apache_error_client)s from apache-common.conf include
2017-09-04 11:48:01 +02:00
john
ac95449bbb
changed zoneminder regex as per Sebres and yarikoptic recommendations
2017-09-04 11:37:09 +02:00
john
7013729a1f
removed redundant options for zoneminder from jail.conf
2017-09-04 11:37:05 +02:00
john
5c3a666380
fixed incomplete regex after adding anchors
2017-09-04 11:37:03 +02:00
john
3d45fd2713
implemented yarikoptic's suggestions in fail2ban pull request #1376
2017-09-04 11:37:00 +02:00
john
776d463e92
added missing colon to failJSON
2017-09-04 11:36:58 +02:00
john
4d8ba7b668
fixed test log file
2017-09-04 11:36:55 +02:00
john
44c4496e49
added sample log files
2017-09-04 11:36:53 +02:00
john
08878d22dd
added zoneminder.conf filter
2017-09-04 11:36:50 +02:00
john
a90f6c4ae8
added zoneminder jail and filter
...
# Conflicts:
# config/jail.conf
2017-09-04 11:36:47 +02:00
sebres
c312962029
filter.d/dovecot.conf: partially cherry-pick to 0.9 PR #1880 from sebres/0.10-fix-dovecot-regex ( d926e11a5c)
...
fixed failregex (without new mode aggressive)
2017-09-01 10:57:41 +02:00
Serg G. Brester
d926e11a5c
Merge pull request #1880 from sebres/0.10-fix-dovecot-regex
...
filter.d/dovecot.conf: fixed failregex + new mode aggressive
2017-09-01 10:36:22 +02:00
sebres
2cfc53c08e
remove capturing groups
2017-09-01 10:25:09 +02:00
sebres
9b8563f35e
- fixes regex for message imap-login: Disconnected (auth failed, X attempts) ... has to many variations on additional info after <HOST>,
...
leave it end-anchored because variable part `user=<[^>]*>` (before `<HOST>`) to avoid injecting, but can be safe rewritten using `[^>]*` in opposite to "greedy" `user=<[^>]*>`.
- introduces mode `aggressive` and extends regex for this mode to match:
* no auth attempts (previously removed in gh-601, because of lots of false positives on misconfigured MTAs)
* disconnected before auth was ready
* client didn't finish SASL auth
2017-09-01 09:56:21 +02:00
Serg G. Brester
a287d0a05c
Merge pull request #1872 from kmzby/master
...
Added filter for phpMyAdmin+syslog
2017-08-25 12:22:58 +02:00
Serg G. Brester
569283063b
Merge pull request #1874 from sebres/fix-f2b-setup
...
setup.py: fix several setup facilities
2017-08-25 12:22:31 +02:00
Pavel Mihadyuk
4c1abe1cbf
phpmyadmin-syslog: removed excess file, fixed test, updated failregex
2017-08-23 16:56:18 +03:00
sebres
f451cf34b3
don't check return code by dry-run: returns 256 on some python/setuptool versions.
2017-08-23 13:20:51 +02:00
sebres
e3b061e94b
- files/fail2ban.service renamed as template to files/fail2ban.service.in;
...
- setup process generates `build/fail2ban.service` from `files/fail2ban.service.in` using distribution related bin-path;
- bug-fixing by running setup with option `--dry-run` (note: specify option `--dry-run` before `install`, like `python setup.py --dry-run install`);
- test cases extended to cover dry-run.
2017-08-23 13:01:29 +02:00
Pavel Mihadyuk
d09304b897
phpmyadmin-syslog: added default jail config
2017-08-22 19:00:48 +03:00
Pavel Mihadyuk
41994fcb56
Added filter for phpMyAdmin+syslog (>=4.7.0)
2017-08-22 18:46:40 +03:00
Pavel Mihadyuk
5b4bc2aafd
Added filter for phpMyAdmin+syslog (>=4.7.0). Closes #1713
2017-08-22 18:20:01 +03:00
sebres
1d5fbb95ae
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-08-18 15:44:22 +02:00
Serg G. Brester
124e5587c6
Merge pull request #1869 from sebres/fix-gh-1389
...
action.d/bsd-ipfw.conf: replace not posix-compliant grep option
2017-08-18 15:43:05 +02:00
Serg G. Brester
b0e5efb631
bsd-ipfw.conf: sh-compliant redirect of stderr together with stdout
2017-08-18 15:26:09 +02:00
sebres
3be32adefb
Replace not posix-compliant grep option: fgrep with -q option can cause 141 exit code in some cases (see gh-1389).
2017-08-18 14:37:29 +02:00
sebres
8e6b4346dc
avoid using "ANSI_X3.4-1968" as preferred encoding, if missing environment variables 'LANGUAGE', 'LC_ALL', 'LC_CTYPE', and 'LANG'
...
(especially critical if default value `encoding = auto` configured).
As PoC and coverage (this case fails without this "fix"):
$ env -i PATH="$PATH" bin/fail2ban-testcases --fast --no-network testAddBanInvalidEncoded
2017-08-18 13:41:58 +02:00
Jacques Distler
f84e58e769
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-18 13:31:34 +02:00
sebres
69a6d0e653
amend to 10c0d95401: order in cymru-info can variate on each level,
...
sorted using key=str (otherwise `['nxdomain', u'US'] != ['US', 'nxdomain']` may occur on some python versions).
2017-08-16 21:23:42 +02:00
sebres
a3c6bb601d
Fixes version, causes "UserWarning: Normalizing '0.10.1dev1' to '0.10.1.dev1'" during setup-process.
2017-08-16 20:50:33 +02:00
sebres
72bd666797
Fixes representation of IPAddr (likely the string representation, enclosed in single-quotes).
2017-08-16 20:50:06 +02:00
sebres
10c0d95401
prevent sporadic assert errors on nested lists/dict differ at some level (mostly causes on python 3.4 because of different dict hashing);
...
introduces new test assertion routine `asesertSortedEqual` for comparison regardless elements order (regarding level/nestedOnly arguments).
2017-08-16 20:48:18 +02:00
sebres
33874d6e53
action.d/pf.conf: anchored call arguments combined as <pfctl> parameter;
...
test cases fixed;
2017-08-16 17:51:07 +02:00
Alexander Köppe
f6ccede2f1
Update pf.conf fixing #1863
...
Fix #1863
Introduce own PF anchors for fail2ban rules.
2017-08-16 17:51:05 +02:00
sebres
19e59fff3e
ChangeLog: added incompatibility list (compared to v.0.9)
2017-08-16 15:38:44 +02:00
sebres
08646bc339
Always supply jail name as name parameter (if not specified explicit in the action parameters action[name=...]).
...
Avoid usage of the same chains (etc.) if someone use `action` instead of `banaction` jail parameter.
2017-08-16 13:14:42 +02:00
sebres
e5169d8f84
pyinotify: be sure possible IOError/OSError by remove monitor (log-rotate? normally not raises) are handled properly.
2017-08-16 11:37:22 +02:00
sebres
7867228146
closes part of gh-1865: fixed "Retrieving own IPs of localhost failed: inet_pton() argument 2 must be string, not int"
...
some python-versions resp. host configurations causes returning of integer (instead of ip-string)
2017-08-16 10:45:37 +02:00
sebres
d1de20dd41
Move some ticket-independent tag replacements from ActionInfo to ADD_REPL_TAGS (will be wrapped in replaceTag into calling map).
...
Thus tags `<fq-hostname>` and `<sh-hostname>` could be used without ticket (a. g. in `actionstart` etc.).
Closes gh-1859.
2017-08-14 18:29:36 +02:00
sebres
28076618fd
back to development edition: README.md, ChangeLog, version.py
2017-08-09 17:37:40 +02:00
sebres
c60784540c
version bump: release 0.10.0
2017-08-09 16:53:05 +02:00
sebres
30219b54c4
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-08-09 16:38:29 +02:00
Serg G. Brester
c540217844
Update ChangeLog
...
action.d/cloudflare.conf - Cloudflare API v4 implementation (gh-1651)
2017-08-09 16:34:37 +02:00
Serg G. Brester
c0eb7752a8
Merge pull request #1651 from szepeviktor/patch-9
...
Introduce Cloudflare API v4
2017-08-09 16:28:52 +02:00
Serg G. Brester
2ed8a38eca
Update cloudflare.conf
...
Switch to API v1 to API v4 per default
2017-08-09 16:27:53 +02:00
Serg G. Brester
da7072d40e
Merge pull request #1846 from Chocobozzz/patch-3
...
Fix empty logfile.log in xarf login attack action
2017-08-09 16:21:47 +02:00
sebres
94b163936a
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
...
Removed init section (not needed in filter for 0.10).
# Conflicts:
# config/filter.d/sendmail-reject.conf
2017-08-09 16:16:31 +02:00
Serg G. Brester
af25a9d203
Merge pull request #1566 from opoplawski/journalmatch
...
Add sendmail journalmatch options
2017-08-09 16:14:10 +02:00
Orion Poplawski
84f552881c
Add sendmail journalmatch options
2017-08-09 16:03:34 +02:00
Serg G. Brester
5b7375c614
Merge pull request #1638 from roedie/shorewall-ipv6
...
Add shorewall IPv6 support
2017-08-09 15:54:57 +02:00
Serg G. Brester
9a3716465b
Merge pull request #1750 from sebres/0.10-fix-default-backend
...
fixes default backend handling (as default used value of `%(default/backend)s`...
2017-08-09 15:49:45 +02:00
sebres
7549f44ded
code review: removed unused (unneeded) code, coverage increase...
2017-08-09 15:36:36 +02:00
sebres
6f4fde2c29
Update changelog and man/jail.conf.5
2017-08-08 21:50:38 +02:00
sebres
9a768c19d0
Fixes raw to interpolated value by recursive substitution. Avoid too deeply recursive extended interpolation cross sections (test covered now);
2017-08-08 21:48:50 +02:00
sebres
0782b28460
allow usage of "-" character in the name of sections by extended interpolation (like %(my-section/some-value)s).
2017-08-08 21:13:49 +02:00
sebres
e52f483557
Config reader's: introduced new syntax %(section/option)s, in opposite to extended interpolation of python 3 ${section:option} work with all supported python version in fail2ban and this syntax is like our another features like %(known/option)s, etc.;
...
Variable `default_backend` switched to `%(default/backend)s`, so totally backwards compatible now, but now the setting of parameter `backend` in default section of `jail.local` can overwrite default backend also.
Test cases extended: test targeted section options "section/option" (default and cross sections options);
2017-08-08 20:21:44 +02:00
sebres
5ce8d4f741
fixes default backend handling (as default used value of known/backend, which can now be overridden in default section of jail.local);
...
introduces fallback for `known/option`: interpolate missing `known/option` as `option` from default section
2017-08-08 18:41:15 +02:00
sebres
51c54b3253
ChangeLog entry for 9a42ce12f4
2017-08-08 13:04:36 +02:00
sebres
8f76a052ec
rebuild man's and MANIFEST
2017-08-08 13:00:10 +02:00
sebres
9a42ce12f4
amend to gh-1792: introduced new fail2ban-regex option "--timezone" ("--TZ"), to set time-zone used by convert of time format.
2017-08-08 12:55:13 +02:00
sebres
2fe1479484
Merge branch '_0.9/gh-1849' into 0.10
2017-08-07 18:07:36 +02:00
sebres
5c538fb658
Recognize "unknown user" for additional auth-methods (pam, passwd-file, ldap, sql, etc); simplifying regular expressions (put "unknown user" and "invalid credentials" together as one regex).
2017-08-07 18:04:09 +02:00
sebres
cb0f7ba4b9
Merge amend to PR #1850 : removed greedy catch-all
2017-08-07 15:25:37 +02:00
sebres
0ef5b7c4d4
small amend to gh-1850: removed greedy catch-all at end.
2017-08-07 15:24:16 +02:00
Serg G. Brester
047d516661
Merge pull request #1850 from MarcelWaldvogel/ejabberd-17-06
...
Support ejabberd 17.06 log format
2017-08-07 15:16:34 +02:00
Marcel Waldvogel
ebd1e2c969
Add testcase
2017-07-29 20:05:25 +02:00
Marcel Waldvogel
daf57547c6
Parse ejabberd 17.06 output
...
E.g.:
2017-07-29 08:24:04.773 [info] <0.6668.0>@ejabberd_c2s:handle_auth_failure:433 (http_bind|ejabberd_bosh) Failed c2s PLAIN authentication for test@example.ch from ::FFFF:192.0.2.3: Invalid username or password
2017-07-29 19:58:06 +02:00
Bigard Florian
f4551d02c9
Fix empty logfile.log in xarf login attack action
...
Fix empty 3rd MIME part which contains the attack evidence (logfile.log).
2017-07-25 13:44:29 +02:00
sebres
1a562bed0f
Merge remote-tracking branch 'master' into 0.10
...
# Conflicts:
# config/filter.d/asterisk.conf
2017-07-19 08:57:23 +02:00
Serg G. Brester
babb76cb3c
Merge pull request #1839 from sebres/asterisk-patch
...
Asterisk improvements
2017-07-19 08:50:05 +02:00
sebres
a5b62a7f36
failregex extended and simplified (partially ported from gh-1409).
2017-07-18 16:34:22 +02:00
sebres
098abae4e6
Remove greedy catch-all before <HOST>, make regex more universal, fewer prone to errors (should avoid future changes, if some optional parameters coming again before/after RemoteAddress) + non-captured groups now.
...
Test for possible injection (5.6.7.8 in session-id) already available, line 59 (thus already covered).
2017-07-18 16:09:53 +02:00
sebres
2ea22b9d30
test coverage for gh-1427
2017-07-18 15:46:53 +02:00
Kirill
4c0c7b97c0
Update asterisk.conf to new log message
...
I got an issue like this:
[2016-05-15 22:53:00] SECURITY[26428] res_security_log.c: SecurityEvent="FailedACL",EventTV="2016-05-15T22:53:00.203+0300",Severity="Error",Service="AMI",EventVersion="1",AccountID="admin",SessionID="0x7fb580001518",LocalAddress="IPV4/TCP/0.0.0.0/5038",RemoteAddress="IPV4/TCP/78.129.227.4/62389",SessionTV="1970-01-01T03:00:00.000+0300"
# [sebres] rebased to current master and resolving conflicts.
2017-07-18 15:40:32 +02:00
Serg G. Brester
34cb55fd91
Merge pull request #1695 from benrubson/issue1693
...
Apache, detect syslog prefix
2017-07-14 02:05:23 +02:00
sebres
a12ac4242b
ChangeLog updated
2017-07-12 11:59:42 +02:00
sebres
0e33125129
be more precise using common __prefix_line expression (set _daemon to recognize apache and httpd only)
2017-07-12 11:59:02 +02:00
sebres
b561af45ef
apache-common.conf: introduced parameter logging for possibility to match lines, if apache logs into syslog/systemd journal;
...
added test cases to cover `apache-auth[logging=syslog]`.
2017-07-12 11:45:44 +02:00
benrubson
10cc7e6e59
Apache, detect syslog prefix, add test
2017-07-12 11:39:20 +02:00
benrubson
b662cf03ac
Apache, detect syslog prefix, simple example
2017-07-12 11:36:34 +02:00
Serg G. Brester
6c030c5e10
Merge pull request #1717 from szepeviktor/patch-11
...
Updated xarf-specification repo URL in xarf action
2017-07-12 09:54:15 +02:00
Serg G. Brester
99b668a3cc
Merge pull request #1390 from khumarahn/xxx
...
ensure /var/run/fail2ban is created in systemd service file
2017-07-11 15:53:42 +02:00
Serg G. Brester
4126b16e7c
Merge pull request #1828 from sebres/filter-ejabberd-auth-gh-993
...
Accept new format for filter ejabberd-auth
2017-07-11 15:43:28 +02:00
Serg G. Brester
5dcbcb99b9
Merge pull request #1648 from hlein/master
...
gentoo-initd: wait up to 30 seconds on "stop" to avoid errors.
2017-07-11 15:41:48 +02:00
sebres
c9385a2e04
ChangeLog updated
2017-07-11 15:28:04 +02:00
sebres
7217ef5c9e
filter.d/ejabberd-auth.conf: fixed ejabberd filter - accept new log-format with wait_for_sasl_response instead of wait_for_feature_request + optional part "IP " (gh-993)
2017-07-11 15:25:51 +02:00
Serg G. Brester
ad9f364800
Merge pull request #1827 from sebres/filter-roundcube-fix-gh-1303
...
Filter roundcube: fixed gh-1303 - X-Real-IP or/and X-Forwarded-For after host
2017-07-11 15:21:04 +02:00
sebres
ea3a6aa971
ChangeLog updated
2017-07-11 15:02:59 +02:00
sebres
dae4988aea
filter.d/roundcube-auth.conf: fixes failregex not working with X-Real-IP or/and X-Forwarded-For (gh-1303)
2017-07-11 14:59:24 +02:00
sebres
00456b8270
review: documentation, small enhancement of fail2ban-client to test time abbreviation format:
...
fail2ban-client --str2sec 1d12h30m
2017-07-11 14:03:00 +02:00
sebres
89f2dbb97b
small bug fix (missing - by option --timeout, wrong module reference)
2017-07-11 14:01:42 +02:00
Serg G. Brester
d334a36a60
Merge pull request #1825 from sebres/_0.10/postfix-filter-opti
...
0.10 - postfix filter optimizations
2017-07-11 12:34:56 +02:00
sebres
cf3b8f63f6
coverage fix
2017-07-11 12:16:12 +02:00
sebres
e26cc5de45
restore backwards compatibility (jail postfix-sasl); changelog update
2017-07-11 11:57:48 +02:00
sebres
aa92b68d4a
filter.d/postfix.conf: normalized several postfix-filters using parameter mode (as discussed in gh-1813);
...
introduced parameter `mode`: more (default, combines normal and rbl), auth, normal, rbl, ddos, extra or aggressive (combines all)
replacement for gh-1239, gh-1697, gh-1764; closes gh-1245, gh-1297.
2017-07-10 20:49:28 +02:00
sebres
36d42d7f0b
SampleRegexsFactory: introduce opportunity to supply multiple options combinations (check lines using filters with several options), see for example filter sshd.conf
2017-07-10 19:57:02 +02:00
sebres
d32a3913cf
postfix postscreen (resp. other RBL's compatibility fix) / gh-1764
2017-07-10 15:38:24 +02:00
Serg G. Brester
57ea38c342
Update paths-debian.conf
...
Fixed mail.log path since in the default rsyslog configuration of debians the `mail.warn` is commented now (see `/etc/rsyslog.d/50-default.conf`: `#mail.warn -/var/log/mail.warn`).
Closes gh-1687
2017-07-05 19:57:30 +02:00
sebres
546cd55342
Merge branch 'master' into 0.10
2017-07-03 13:02:25 +02:00
Serg G. Brester
d05d9f4c28
Merge pull request #1816 from sebres/fix-gh-1302
...
filter.d/asterisk.conf - fixed failregex AMI Asterisk authentification failed
2017-07-03 12:59:46 +02:00
sebres
a1d0633e69
filter.d/asterisk.conf - fixed failregex AMI Asterisk authentification failed (see gh-1302):
...
- optional space between NOTICE and pid;
- optional part "Host " before IP-address;
2017-07-03 12:57:28 +02:00
sebres
33fcf8d809
Merge branch 'master' into 0.10
2017-07-03 12:43:48 +02:00
sebres
9f55ed86df
fixed testCymruInfoNxdomain (since cymru does not provide ASN mapping info for "10.0.0.0" anymore)
2017-07-03 12:41:54 +02:00
Serg G. Brester
1307e0a5b9
Merge pull request #1760 from szepeviktor/patch-12
...
Courier may complain about the method only
2017-07-03 12:00:36 +02:00
Serg G. Brester
205edff65d
Merge pull request #1690 from chtheis/master
...
#1689 : Make lowest rule number in action.d/bsd-ipfw.conf configurable
2017-07-01 17:16:50 +02:00
Serg G. Brester
f27e053592
Update bsd-ipfw.conf
...
increased starting rule number (lowest_rule_num = 111)
2017-07-01 17:10:53 +02:00
Serg G. Brester
001c0898d6
Merge branch 'master' into master
2017-06-30 18:07:38 +02:00
Serg G. Brester
6110ba9cc3
filter.d/proftpd.conf: added option journalmatch for systemd backend (closes gh-1613)
2017-06-30 18:00:01 +02:00
sebres
5974b0fb35
amend to merge PR gh-1783: restores lost entry journalmatch for filter.d/roundcube-auth.conf
2017-06-26 11:32:34 +02:00
sebres
37ca4f17c2
filter.d/roundcube-auth.conf: added missing entry journalmatch from original gh-1783.
2017-06-26 11:24:10 +02:00
Serg G. Brester
986dd3107d
Merge branch '0.10' into patch-12
2017-06-19 18:37:28 +02:00
Serg G. Brester
f3ba66d1c6
Merge pull request #1783 from weberhofer/0.10
...
filter.d/roundcube-auth.conf: Fixed failregex when logging errors to journal instead to a local file.
Additionally fixes more complex injections on username.
2017-06-19 18:34:08 +02:00
sebres
9b0f39a17d
ChangeLog updated
2017-06-19 18:12:37 +02:00
sebres
d3ae70beb6
filter.d/roundcube-auth.conf: Use the same filter-file and jail also when logging errors to journal instead to a local file.
...
Additionally fixes more complex injections on username.
2017-06-19 18:12:13 +02:00
Johannes Weberhofer
691c080dc7
Added roundcube authentication filter, new jail and log-examples
2017-06-19 16:52:42 +02:00
Serg G. Brester
3294840c2a
Merge pull request #1801 from jeaye/postfix-updates
...
filter.d/postfix.conf: update to the latest postfix logging format
2017-06-19 16:44:37 +02:00
Serg G. Brester
efeca8fdeb
postfix.conf: removes unneeded end-anchoring like .*$, etc.
...
also removes several dynamic content at end, which are of no avail there.
Additionally normalizes optional part (mail-ID) after reason number.
2017-06-19 16:25:46 +02:00
Serg G. Brester
bb283776d7
Merge pull request #1807 from sebres/fix-gh-1806
...
bug-fix: restoring of tickets from database for jails with persistent ban
2017-06-15 18:42:39 +02:00
sebres
fd32e908e3
fixes restoring of tickets from database for jails with persistent ban (if bantime = -1)
2017-06-15 18:28:37 +02:00
sebres
dcdf677438
Merge remote-tracking branch 'master' into 0.10
2017-06-15 11:49:51 +02:00
Serg G. Brester
d54c40bba5
Merge pull request #1805 from sebres/fix-gh-1790
...
filter.d/apache-overflows.conf: rewritten without end-anchor ($)...
2017-06-15 11:48:45 +02:00
sebres
e1234a5249
ChangeLog update
2017-06-15 11:47:16 +02:00
sebres
2b358bc1a4
filter.d/apache-overflows.conf: rewritten without end-anchor ($), because apache-log could contain very long URLs (and/or referrer), the parsing of it anchored way may be very vulnerable (at least as regards the system resources, see gh-1790).
2017-06-15 11:16:19 +02:00
jeaye
6f3d425c4d
Update postfix filters and tests
2017-06-12 18:56:19 -07:00
sebres
bbea73d79d
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-06-12 13:11:45 +02:00
Serg G. Brester
1e5e0722f3
Merge pull request #1792 from gracinet/1773_logtimezone
...
New logtimezone jail option, zone abbreviations, new date-pattern tokens %Exz, %ExZ
2017-06-12 12:32:44 +02:00
Serg G. Brester
23c2d05250
Update changelog (new enhancements from gh-1792)
2017-06-09 20:51:28 +02:00
Georges Racinet
12259bb3c7
man and ChangeLog for logtimezone
2017-06-09 20:39:03 +02:00
sebres
030f89bf7a
Implemented zone abbreviations (DST, etc.) and abbr+-offset functionality (accept zones like 'CET+0100'), for the list of abbreviations see strptime.TZ_STR;
...
Tokens `%z` and `%Z` are more precise now;
Introduced new tokens `%Exz` and `%ExZ` that fully support zone abbreviations and/or offset-based zones;
# TODO: because python currently does not support mixing of case-sensitive with case-insensitive matching,
# check how TZ (in uppercase) can be combined with %a/%b etc. (that are currently case-insensitive),
# to avoid invalid date-time recognition in strings like '11-Aug-2013 03:36:11.372 error ...'
# with wrong TZ "error", which is at least not backwards compatible.
# Hence %z currently match literal Z|UTC|GMT only (and offset-based), and %Exz - all zone abbreviations.
2017-06-09 20:29:34 +02:00
sebres
39c4acf6bd
small amend white-spaces (no functional changes) + a bit optimized zone2offset
2017-06-09 15:52:14 +02:00
sebres
9f41d1e381
Normalize zone2offset (usable within reGroupDictStrptime), tests simplified and extended with more cases (covers precedence of input-zone over default, etc.)
2017-06-09 14:55:44 +02:00
sebres
8cb4ae0242
Code review and small optimizations, prepared to provide offset-based time zones for date-detectors (parsing of input-string)
2017-06-09 13:55:30 +02:00
Serg G. Brester
d56554ecf3
Merge pull request #1688 from felixonmars/arch-config
...
Add a path configuration for Arch Linux
2017-06-06 10:55:13 +02:00
Serg G. Brester
5482e0bbe7
Merge pull request #1794 from szepeviktor/patch-15
...
fixed grep pattern: escape dot-char in search-IP and more restrictive boundaries (IPv6-capability)
2017-05-31 19:05:43 +02:00
Serg G. Brester
08591a52a4
Merge pull request #1796 from peternowee/fix-dovecot-empty-user
...
dovecot: revert `<[^>]+>` back to `<[^>]*>` - allows empty user again [mistakenly changed in 5678d08 ]
2017-05-31 19:03:34 +02:00
Peter Nowee
b93e47b12f
dovecot: Match also when user field is empty
...
Commit 5678d08 of 2016-11-26 changed:
( user=<\S*>,)?
to:
( user=<[^>]+>,)?
The change from `*` (zero or more times) to `+` (one or more times) may
not have been intended. It will miss lines containing, for example:
Aborted login (tried to use disallowed plaintext auth): user=<>
This commit reverts the `+` back to `*`.
2017-05-31 15:54:30 +02:00
Serg G. Brester
5214c1c5d1
Update changelog (gh-1455)
2017-05-30 20:31:48 +02:00
Marcel Bischoff
228d25c548
Update Kerio Connect filter ( #1455 )
...
* Update Kerio Connect filter
Fixed regex for some log entries that did not get recognized and some additional error formats are added.
* Add missing colon, GitHub address
* Add filter tests
* Add missing test
2017-05-30 20:27:44 +02:00
Serg G. Brester
80cc47b75f
Update helpers-common.conf
...
fixed grep pattern: escape dot-char in search-IP and more restrictive boundaries (IPv6-capable)
2017-05-30 09:14:43 +02:00
Viktor Szépe
5bb6be0163
IPv6 address may overlap
2017-05-30 02:05:38 +02:00
Georges Racinet
e8f2173904
New logtimezone jail option
...
This new option allows to force the time zone on log lines
that don't bear a time zone indication (GitHub issue #1773 ), so it behaves
actually with respect to log line contents as a default time zone.
For the time being, only fixed offset timezones (UTC or UTC[+-]hhmm) are
supported, but the implementation is designed to later on treat the case
of logical timezones with DST, e.g., Europe/Paris etc.
In particular, the timezone name gets passed all the way to the strptime
module, and the resulting offset is computed for the given log line, even
though for now, it doesn't actually depend on it.
Also, the DateTemplate subclass gets to choose whether to use it or not.
For instance, it doesn't make sense to apply a time zone offset to
Unix timestamps.
The drawback is to introduce an API change for DateTemplate. I hope it's
internal enough for that not being a problem.
2017-05-23 17:39:37 +02:00
sebres
2b08847f3a
Reintegrate 'master' into 0.10 (merge point) + small code review
2017-05-19 16:32:13 +02:00
sebres
c7ddf1f940
[systemd-backend] implicit closing journal descriptor by stop filter.
...
Partially cherry-picked from 0.10 (d153555a07 )
2017-05-19 15:36:06 +02:00
sebres
ae0f0d2ec0
Merge branch 'fix-pyinotify-dir-rotate' into 0.10
2017-05-19 13:39:19 +02:00
sebres
96c3b06abb
amend to #1778 : repair notifier wait-cycle (too long timeout in polling, too late check for pending files, too long stop)
2017-05-19 13:26:16 +02:00
sebres
9b83a3128d
code review, try to increase coverage
2017-05-17 12:23:28 +02:00
Serg G. Brester
17b0945a70
Update ChangeLog
2017-05-16 09:43:52 +02:00
Serg G. Brester
a73b0c0064
Merge pull request #1778 from sebres/fix-pyinotify-dir-rotate
...
Fix pyinotify directory-based log-rotate
2017-05-16 09:41:09 +02:00
sebres
050076ae42
code review + coverage fixes
2017-05-15 19:05:40 +02:00
sebres
62e580b7cf
pyinotify: switch from ThreadedNotifier to Notifier:
...
- Filter instance is already a thread;
- avoid stop pyinotify processing if an interim error occurs (and breaks main-loop, e. g. during multi-threaded processing by add/remove log-files)
2017-05-15 18:47:00 +02:00
sebres
c258bb4a6a
Merge branch '0.10' into fix-pyinotify-dir-rotate
2017-05-15 16:50:17 +02:00
sebres
94c793ff89
Merge branch 'master' into 0.10
2017-05-15 16:48:11 +02:00
sebres
0a707d0302
Merge branch 'travis-fix-pypy'
2017-05-15 16:41:22 +02:00
sebres
f099558bcf
try to fix travis build for pypy3 (after switch to 'pypy3.3-5.2-alpha1' the test cases seems to never run anymore).
2017-05-15 16:32:41 +02:00
sebres
16a84ca0b5
code review
2017-05-15 15:20:43 +02:00
Filippo Tessarotto
ff1c6718da
Postfix RBL: 554 & SMTP
...
Cherry-pick of 607568f5da (see gh-1686)
2017-05-15 14:42:37 +02:00
sebres
5c1d01bf58
code review, try to make recognition of pending files fewer sporadic (error prone)
2017-05-15 14:31:50 +02:00
sebres
9841fe52c3
fixed cleanup for Gamin backend (by interim stop in the test-cases)
2017-05-15 12:52:16 +02:00
sebres
7b614a7a15
differentiate between watched directories and files (refreshing monitoring of files/dirs expected different flags for watcher)
2017-05-15 12:38:48 +02:00
sebres
e340d0d2b2
Fixed detection of directory-based log-rotation of pyinotify backend.
...
If directory moved and the target is not watched path, so the monitoring of it could not be continued.
Now fixed with pending files await a monitoring if there (resp. its directories) appears again (respawn).
Closes gh-1769
2017-05-12 16:51:08 +02:00
Yaroslav Halchenko
407b2ea936
life is going on
2017-05-11 11:17:27 -04:00
Yaroslav Halchenko
bc60d6feb6
Merge remote-tracking branch 'origin/master'
...
* origin/master:
exim test cases extended: cover short form of the logging (without session-id, gh-1771)
2017-05-11 11:13:07 -04:00
sebres
31627b796b
Merge branch 'master' into 0.10
2017-05-11 09:14:52 +02:00
sebres
a5cdb9c977
exim test cases extended: cover short form of the logging (without session-id, gh-1771)
2017-05-11 09:10:45 +02:00
Yaroslav Halchenko
35280044ff
Preparing for 0.9.7 release
2017-05-10 21:38:57 -04:00
Yaroslav Halchenko
663d526d74
Added newly added files to MANIFEST
2017-05-10 21:31:09 -04:00
Serg G. Brester
c43a3ac1cd
Merge pull request #1770 from tjikkun/double_lock
...
resolves deadlock (dual lock) by SYSLOG logging type
2017-05-08 14:56:39 +02:00
Sander Hoentjen
2a4dafce5b
don't call setLogTarget from setSyslogSocket when holding the lock
...
If we do, setLogTarget will wait for the lock, but it will never be released
2017-05-08 14:11:07 +02:00
sebres
b13d9d4e22
Merge branch 'master' into 0.10
2017-05-07 21:29:12 +02:00
sebres
bea3a62a37
update ChangeLog
2017-05-07 14:02:45 +02:00
sebres
0600d51511
filter.d/exim.conf: added new reason for "rejected RCPT" regex: Unrouteable address
2017-05-07 14:02:38 +02:00
sebres
49e237209e
Merge branch 'master' into 0.10
2017-05-07 13:32:12 +02:00
sebres
3d64d705f3
try to fix travis integration of pypy3: setuptools recently dropped support for Python 3.0 - 3.2, but old pypy3 based on Python 3.2.5
2017-05-07 13:28:35 +02:00
sebres
c546f85207
filter.d/exim.conf: cherry-picked from 0.10, match complex time like D=2m42s (closes gh-1766)
2017-05-07 13:02:32 +02:00
Serg G. Brester
b5d59e8883
small fix of changelog entry
2017-05-02 16:59:05 +02:00
Viktor Szépe
eb5c75e4b5
Add test to Courier auth
2017-04-29 17:12:15 +02:00
Viktor Szépe
1ed958521c
Courier auth changelog
2017-04-28 17:08:36 +02:00
Viktor Szépe
ac256a822b
Make courier-auth regexp a non-captured group
2017-04-28 16:58:24 +02:00
Viktor Szépe
4bb8a58dcf
Courier may complain about the method only
...
> Mar 30 22:29:18 szerver imapd-ssl: LOGIN FAILED, method=PLAIN, ip=[::ffff:1.2.3.4]
2017-04-28 15:49:59 +02:00
Seth Reeser
c3426ba5f6
Update botsearch-common.conf ( #1759 )
...
* Update botsearch-common.conf, apache-modsecurity.conf: typo and missing new-line
2017-04-26 20:14:39 +02:00
sebres
8839bcbb09
Merge remote-tracking branch master into 0.10
2017-04-25 10:07:19 +02:00
Serg G. Brester
fafe11d326
Merge pull request #1757 from sebres/0.9-fix-gh-1751
...
filter.d/exim.conf: optional part `(...)` by authenticator failed for ...
2017-04-25 10:05:27 +02:00
sebres
462442a517
Update ChangeLog #1757
2017-04-25 10:04:45 +02:00
Serg G. Brester
e7d51d1969
Merge pull request #1758 from sebres/0.10-new-hostname-tags
...
0.10 new action tags: <fq-hostname>, <sh-hostname>
2017-04-25 09:59:26 +02:00
sebres
e4ccbe7286
code review: getHostname can return ''
2017-04-24 21:32:40 +02:00
sebres
f75c3d8a02
code review and ChangeLog entry
2017-04-24 21:18:16 +02:00
sebres
db16b4c22a
testComplexMailActionMultiLog: better echo mock-up replacement for "...) | mail -s ..."
2017-04-24 21:18:14 +02:00
sebres
99344d28c8
Introduces new tags with hostname:
...
- `<fq-hostname>` - fully-qualified name of host (the same as `$(hostname -f)`)
- `<sh-hostname>` - short hostname (the same as `$(uname -n)`)
Execution of `uname -n` replaced in all mail actions with most interesting fully-qualified `<fq-hostname>`.
2017-04-24 21:17:55 +02:00
sebres
3161bcf78b
filter.d/exim.conf: optional part (...) after host-name before [IP], normalized over whole config file.
...
# Conflicts:
# config/filter.d/exim.conf
2017-04-24 19:21:26 +02:00
sebres
507034c5be
filter.d/apache-auth.conf: joined some similar expressions
2017-04-24 15:32:44 +02:00
Serg G. Brester
e35ed1cdf7
Update ChangeLog
...
Changes of #1645
2017-04-21 11:24:32 +02:00
Serg G. Brester
6dfd080e20
Update apache-auth.conf
...
remove forgotten referer, that may prevent failure recognition (belongs to gh-1645)
2017-04-21 11:17:13 +02:00
Serg G. Brester
dffda63d59
Merge pull request #1645 from benrubson/issue1644
...
Apache URIs can contain spaces
2017-04-21 10:47:12 +02:00
Serg G. Brester
311f8fea83
Merge branch '0.10' into issue1644
2017-04-21 10:32:29 +02:00
sebres
efd6fff7a0
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
...
# Conflicts:
# fail2ban/tests/utils.py
2017-04-20 21:54:56 +02:00
Serg G. Brester
17922b621c
Update ChangeLog
...
replaced german in entry ;)
2017-04-20 15:23:59 +02:00
Yaroslav Halchenko
a0cf31903d
Merge pull request #1754 from yarikoptic/bf-tzdata
...
BF: specify explicit time offset not a time zone name to avoid needing tzdata during testing
2017-04-17 10:26:37 -04:00
Paul Brook
a639f0b083
BF: specify explicit time offset not a time zone name to avoid needing tzdata during testing
2017-04-16 12:11:05 -04:00
Serg G. Brester
36814c4274
Merge pull request #1749 from petervanderdoes/bugfix/problem_with_mail_command
...
Parameter `-s` is already a part of `mailcmd` interpolation
2017-04-11 20:57:42 +02:00
Peter van der Does
bb79e7f413
Parameter not needed
...
The parameter '-s' causes an error as the <mailcmd> already has the parameter.
2017-04-11 11:13:58 -04:00
Serg G. Brester
61e73b9694
Merge pull request #1746 from gracinet/0.10-haproxy-ipv6
...
haproxy-http-auth IPv6 (Closes #1745 )
2017-04-11 10:04:16 +02:00
Serg G. Brester
4f0f22702a
Update haproxy-http-auth.conf
...
little bit more precise expression
2017-04-11 09:11:08 +02:00
Georges Racinet
07023436ac
haproxy-http-auth: added a test for IPv4-mapped-in-IPv6
...
This what one gets in logis if haproxy is binding to ::
on a dual-stack system.
2017-04-07 14:04:13 +02:00
Georges Racinet
4fc6323ff0
haproxy-http-auth: avoid port number in IPv6 addresses
...
The solution taken is to consume the port number explicitely in
the regexp.
2017-04-07 13:59:22 +02:00
Serg G. Brester
e7f1fc5cb3
Update ChangeLog
...
enhancements of #1743
2017-03-31 10:39:50 +02:00
Serg G. Brester
e63af0aa4e
Merge pull request #1743 from sebres/0.10-flush-bulk-unban
...
0.10 - flush resp. bulk unban
2017-03-31 10:36:05 +02:00
sebres
97e8b42d34
dummy action extended with more examples and test-covered now
2017-03-30 13:02:37 +02:00
sebres
042a060a54
additionally complex test-case coverage for actionflush inside server via actions-mechanism of fail2ban - reload with removing action, unban all, stopping of jails and actions, etc.
2017-03-29 23:24:13 +02:00
sebres
d03872fbbf
bulk unban: add new command actionflush default for several iptables/iptables-ipset actions (and common include):
...
iptables-common
iptables
iptables-allports
iptables-multiport-log
iptables-multiport
iptables-new
iptables-ipset-proto4
iptables-ipset-proto6
iptables-ipset-proto6-allports
executing `actionflush` command covered for this actions now
2017-03-29 23:24:11 +02:00
sebres
a1e9cc552c
bulk unban: introduced new command actionflush: executed in order to flush all bans at once (e. g. by unban all, reload with removing action, stop, shutdown the system);
...
the actions having `actionflush` do not execute `actionunban` for each single ticket
2017-03-29 23:24:09 +02:00
Serg G. Brester
44a26c6159
Update ChangeLog
...
amend to gh-1742
2017-03-29 23:14:33 +02:00
Serg G. Brester
4dcdcc3002
Merge pull request #1742 from sebres/0.10-actionstart-on-demand
...
0.10 - Execution of `actionstart` on demand (fixes gh-1741)
2017-03-29 23:07:03 +02:00
sebres
daa13eb5dd
no cover for unreachable and abstract
2017-03-29 18:33:33 +02:00
sebres
ca18270beb
fix artificial test cases ('family' becomes mandatory in the action info, but dict was supplied in the test case)
2017-03-29 18:02:21 +02:00
sebres
8bf79fa483
implemented execution of actionstart on demand, if action depends on family (closes gh-1741);
...
new action parameter "actionstart_on_demand" (bool) can be set to prevent/allow starting action on demand (default retrieved automatically, if some conditional parameter `param?family=...` presents in action properties);
2017-03-29 17:44:15 +02:00
Serg G. Brester
05f5c6efcc
Update README.md
...
added wiki-reference;
fixed mail-representation (after github swiched markdown syntax)
2017-03-29 12:32:34 +02:00
Serg G. Brester
1a59a5c5a7
Merge pull request #1740 from sebres/0.10-strptime-perf
...
strptime.py: small code review and performance optimization
2017-03-29 11:33:57 +02:00
sebres
ee3c9fcb75
"%y" - in the fail2ban parsed year without century should be always relative current century (>= 2000);
...
cover several format specifiers and different "assume" cases (without year, without date, greater as now, etc.);
2017-03-28 22:10:29 +02:00
sebres
7437fbd75b
strptime.py: small code review and performance optimization (get some properties on demand, etc.)
2017-03-28 20:21:39 +02:00
Serg G. Brester
ec19aed489
Merge pull request #1739 from gracinet/0.10-test_smtp-no-network
...
Fixes test_smtp connects to wrong inet (if listening on ::1 instead of 127.0.0.1)
2017-03-28 19:49:58 +02:00
Georges Racinet
7b93f111e1
test_smtp inconsistency for py3+IPv6
...
It appears that, under Python3, on an IPv6 enabled machine,
the testing SMTP server on 'localhost' can turn out to listen on ::1 only,
which makes those tests break if the SMTP client part uses 127.0.0.1
directly. Using 'localhost' there as well makes the tests pass.
2017-03-28 19:29:45 +02:00
sebres
873f97c6c5
Merge branch '0.9-log-level-msg' into 0.10
2017-03-27 11:36:36 +02:00
sebres
7982d1e627
Update ChangeLog
2017-03-27 11:31:41 +02:00
sebres
e8596cfce7
amend resp. restore of change from 59c35bc44a (gh-129):
...
- logging of "Log rotation detected" with new MSG level
- introduces new log-level MSG (as INFO-2, 18)
2017-03-27 11:27:41 +02:00
Serg G. Brester
d26060ead0
Update ChangeLog
...
belongs to #1733
2017-03-27 09:38:53 +02:00
Serg G. Brester
cea8ba7831
Merge pull request #1733 from sebres/0.10-repl-skiplines
...
Normalizes replacement of `<SKIPLINES>` + no multiline failregex per default
2017-03-27 09:34:08 +02:00
Seth Reeser
c82495353f
Update mysqld-auth.conf ( #1725 )
2017-03-24 19:03:20 +01:00
Serg G. Brester
52c1950371
Update mysqld-auth.conf
...
small typo, closes gh-1725 (Thx @seth-reeser)
2017-03-24 19:03:17 +01:00
sebres
6ac5c55edc
the sequence in args-dict is currently undefined (so can be 1st argument with ? instead of &)
2017-03-24 17:35:41 +01:00
sebres
990d9a66da
fail2ban-regex: fixed matched output by multi-line (buffered) parsing + and multi-line debuggex URL;
...
test coverage extended;
2017-03-24 17:07:21 +01:00
sebres
bc888e0753
Regex compiled in multi-line parsing mode only if maxlines > 1 (buffering), if however expected - prefix (?m) could be used in regex to enable it;
...
Removed warning "Mutliline regex set for jail ... but maxlines not greater than 1", because can be expected situation now:
non multi-line entry from systemd-filter containing new-lines (that should be ignored by anchors resp. entry parsed as single string);
small code review;
2017-03-24 13:20:04 +01:00
sebres
61c1bdfe79
Normalizes replacement of <SKIPLINES> (moved to _resolveHostTag, so will be replaced together with another tags);
...
Regex will be compiled as MULTILINE only if needed (buffering with `maxlines` > 1), that enables:
- improve performance by the single line parsing;
- make regex more precise (because distinguish between anchors `^`/`$` for the begin/end of string and the new-line character '\n', e. g. if coming from filters (like systemd journal) that allow the parsing of log-entries contain new-line chars (as single entry);
2017-03-24 11:25:12 +01:00
Serg G. Brester
b650503f00
Merge pull request #1732 from sebres/0.10-ignoreself
...
0.10 `ignoreself` for ignore own IP addresses
2017-03-24 10:12:23 +01:00
sebres
e7052e9625
update man/jail.conf.5 (docu for the ignoreself)
2017-03-24 09:55:20 +01:00
sebres
30352c5f03
fix sporadic coverage changes (sometimes produces "no such process" in popen.poll after terminate/kill in timeout test cases)
2017-03-23 17:48:52 +01:00
sebres
663bc9903d
increase coverage (was decreased since "ignoreip" was set to default empty)
2017-03-23 16:19:21 +01:00
sebres
6c4b1c7204
Update ChangeLog
2017-03-23 15:54:53 +01:00
sebres
5e93bf9bd3
Introduced new option "ignoreself", specifies whether the local resp. own IP addresses should be ignored (default is true).
...
Fail2ban will not ban a host which matches such addresses.
Option "ignoreip" affects additionally to "ignoreself" and don't need to include the DNS resp. IPs of the host self.
2017-03-23 15:52:31 +01:00
Serg G. Brester
1e6787877a
Merge pull request #1726 from sebres/0.10-grave-fix-escape-tags-1st
...
0.10 fix escape tags
2017-03-21 15:33:00 +01:00
sebres
6ba0546824
code review and inline docu
2017-03-21 14:53:33 +01:00
Serg G. Brester
7a03c964c2
Update ChangeLog
2017-03-21 14:04:18 +01:00
sebres
bb9541b7a9
Merge pull request #1728 from sebres/_0.10/fix-gh-1719
2017-03-21 11:05:15 +01:00
sebres
43d2cae8da
small amend that correct log trace output by forget MLFID (outputs the reason why it was forgotten - close, disconnect, etc.)
2017-03-21 10:39:55 +01:00
sebres
b6886f2e51
SampleRegexsFactory extended with optional filter constraint, if testing the same log-file with multiple filters (no possibility to match by the old sshd-filter 'zzz-sshd-obsolete-multiline')
2017-03-21 09:42:27 +01:00
sebres
1971fd4bd3
don't remove MLFID from cache (can recognize multiple attempt within the same connection)
2017-03-21 09:20:56 +01:00
sebres
f13fac5ae9
amend to 5561423be3: fixed incorrect failure counting despite the <F-NOFAIL> marked regex;
...
extra: introduced new tag `<F-MLFFORGET>` as mark to forget current multi-line MLFID (e. g. connection closed);
Closes gh-1727
2017-03-21 00:15:57 +01:00
sebres
32f3c1dbf3
test coverage
2017-03-20 13:34:42 +01:00
sebres
57e9c25449
bug fix in the config readers: mixing with the init section should affect only own init options (from init section only bypass default section);
...
the situation details:
value of "_daemon" from default section "default" (with init section) falsely overwrites it from definition section "test" -
the resulting value of "_daemon" should be "test" in all 3 resulting failregex's (as specified in test.local),
fixed and covered now;
additionally more complex cases covered also (all filter parameters in jail via "%(known/...)s", dynamical interpolation across all, etc);
2017-03-20 12:10:09 +01:00
sebres
4f1473724b
fixed grave vulnerability by wrong escape of tags by executing of shell actions
2017-03-20 12:09:42 +01:00
sebres
e5c9f9ec1c
[interim commit] try to fix possible escape vulnerability in actions
2017-03-20 12:08:14 +01:00
sebres
93ec9e01d4
fixes a small blemish by output in beautifier;
...
command "unban" returns a count of tickets that were flushed
2017-03-17 11:00:54 +01:00
Serg G. Brester
da808fe67b
Merge pull request #1720 from sebres/_0.10/fix-gh-1719
...
fix gh-1719: sshd format changed
2017-03-15 18:36:35 +01:00
sebres
5561423be3
filter.d/sshd.conf: fixed failregex format - some parts are optional, new ddos more precise rule (Connection reset by with host entry);
...
closes gh-1719
2017-03-15 18:01:20 +01:00
sebres
97d417926d
repairs testing of missing samples for all regex after filter settings (mode) changed
2017-03-15 18:01:18 +01:00
Viktor Szépe
d79267c424
Updated xarf-specification repo URL in xarf action
2017-03-14 20:47:31 +01:00
sebres
482e5265d7
output execution time of each test case if verbosity > 2
2017-03-14 13:34:54 +01:00
Serg G. Brester
77229a65b5
Merge pull request #1716 from sebres/fix-stop-replace-in-callable
...
Prohibit recursive replacement of action info (calling map)
2017-03-13 23:46:52 +01:00
sebres
ccfd1ccb2d
code review, increase coverage, etc.
2017-03-13 21:56:06 +01:00
sebres
5030e3a122
[Important] Prohibit replacement of recursive "tags" in the action info resp. calling map (very bad idea to do this):
...
- the calling map contains normally dynamic values only (no recursive tags);
- recursive replacement can be vulnerable, because can contain foreign (user) input captured from log (will be replaced in the shell arguments);
2017-03-13 20:45:35 +01:00
sebres
c1da6611ec
[BF] prevents always converting of calling map items in replaceTag (without direct access of item):
...
substituteRecursiveTags: ignore replacing callable items from calling map - should be converted on demand only (by get)
2017-03-13 18:47:26 +01:00
sebres
92d83274d9
fixes cache overload in the test cases (increase max count and max time of CACHE_ipToName - too many entries in mock-up preset, longer time testing)
2017-03-13 18:03:37 +01:00
Serg G. Brester
3fec546fc0
Merge pull request #1715 from sebres/fix-f2b-regex-debuggex-url
...
fail2ban-regex debuggex url fix
2017-03-13 16:37:57 +01:00
sebres
295f7b88c9
increase coverage
2017-03-13 16:21:03 +01:00
sebres
3cba2310ff
Fixes debuggex URL (tag replacement) and missing line stat by matched lines (without time - matched_lines_timeextracted);
...
Closes gh-1394
2017-03-13 16:14:06 +01:00
Serg G. Brester
1bcde678c6
Merge pull request #1710 from sebres/0.10-test-with-filter-options
...
0.10 filter options extension
2017-03-13 02:11:48 +01:00
sebres
30b53bb2ce
update ChangeLog and man/fail2ban-regex.1
2017-03-13 02:07:14 +01:00
sebres
eb3623e90c
configreader.py: correct reading real relative path (starting with "./");
...
fail2ban-regex: catch read exceptions by wrong config files (raise exception in verbose mode only);
2017-03-12 19:04:45 +01:00
sebres
6a26602ba8
allow to use filter options by fail2ban-regex, example:
...
fail2ban-regex text.log "sshd[mode=aggressive]"
2017-03-11 00:06:29 +01:00
sebres
8af7a73bfc
update ChangeLog
2017-03-10 22:14:39 +01:00
sebres
0c1707afda
filter.d/sshd.conf:
...
- optional parameter `mode` rewritten: normal (default), ddos, extra or aggressive (combines all), see sshd for regex details);
test cases reformatted (since "filterOptions", we don't need multiple test log-files anymore);
2017-03-10 22:09:11 +01:00
sebres
7e442c5b27
filter.d/sendmail-reject.conf:
...
- rewritten using `prefregex` and used MLFID-related multi-line parsing (by using tag `<F-MLFID>` instead of buffering with `maxlines`);
- optional parameter `mode` introduced: normal (default), extra or aggressive (see sendmail-reject for regex details);
test cases extended
2017-03-10 21:44:19 +01:00
sebres
a683e88a74
samples test case factory extended with filter options - dict in JSON to control filter options (e. g. mode, etc.):
...
# filterOptions: {"mode": "aggressive"}
2017-03-10 20:39:09 +01:00
sebres
52ed6597b2
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2017-03-09 16:27:14 +01:00
Serg G. Brester
d3b644acae
Merge pull request #1708 from sebres/fix-gh-1707
...
filter.d/cyrus-imap.conf: accept entries without login-info resp. hostname before IP address (gh-1707)
2017-03-09 16:26:06 +01:00
sebres
0f8cb1749f
Update ChangeLog
2017-03-09 16:15:45 +01:00
sebres
8768776d68
filter.d/cyrus-imap.conf: fixed failregex - accept entries without login-info resp. hostname before IP address
2017-03-09 16:13:45 +01:00
Serg G. Brester
d042981954
Merge pull request #1655 from ajcollett/0.10
...
Added config for AbuseIPDB
2017-03-09 15:15:26 +01:00
Serg G. Brester
b1f5ac9484
Update abuseipdb.conf
2017-03-09 13:33:11 +01:00
Serg G. Brester
62fa02241f
Update jail.conf
2017-03-09 13:31:40 +01:00
Serg G. Brester
e71f3d595f
Merge pull request #1705 from sebres/0.10-tag-ip-host
...
New actions tag `<ip-host>` introduced: can be used in actions to retrieve the host name (dns) from the IP address
2017-03-09 13:11:57 +01:00
sebres
6a2c95da95
action.d/sendmail-geoip-lines.conf fixed using new tag <ip-host> (dns-cache and without external command execution);
...
changelog updated;
2017-03-08 16:51:08 +01:00
sebres
59cf761129
Real action info instead of calling map in test cases, covering of the new tag '<ip-host>';
...
dns lookup: pre-caching within test cases - prevent slow dns-resolving and failures if no-network, of if some IP addresses will be changed later
2017-03-08 16:51:06 +01:00
sebres
a0bb51ef92
New tag '<ip-host>' introduced: can be used in actions to retrieve the host name (dns) from the IP address
2017-03-08 16:51:05 +01:00
sebres
b832b77e3c
small amendment for test-coverage;
...
dynamical monitor failures test classes get proper names running in python3.x (wrong __qualname__)
2017-03-01 14:52:51 +01:00
Serg G. Brester
32ac383d06
Update ChangeLog
2017-02-27 15:51:33 +01:00
Serg G. Brester
81129f0e5c
Merge pull request #1698 from sebres/0.10-filter-captures-to-actions
...
0.10 filter captures to actions
2017-02-27 15:29:57 +01:00
sebres
e4a265c75f
test coverage
2017-02-24 13:22:15 +01:00
sebres
d2a3d093c6
rewritten CallingMap: performance optimized, immutable, self-referencing, template possibility (used in new ActionInfo objects);
...
new ActionInfo handling: saves content between actions, without interim copying (save original on demand, recoverable via reset);
test cases extended
2017-02-24 11:54:24 +01:00
sebres
4efcc29384
coverage of new multi-line handling within fail2ban-regex
2017-02-22 22:20:19 +01:00
sebres
35efca5941
Better multi-line handling introduced: single-line parsing with caching of needed failure information to process in further lines.
...
Many times faster and fewer CPU-hungry because of parsing with `maxlines=1`, so without line buffering (scrolling of the buffer-window).
Combination of tags `<F-MLFID>` and `<F-NOFAIL>` can be used now to process multi-line logs using single-line expressions:
- tag `<F-MLFID>`: used to identify resp. store failure info for groups of log-lines with the same identifier (e. g. combined failure-info for the same conn-id by `<F-MLFID>(?:conn-id)</F-MLFID>`, see sshd.conf for example)
- tag `<F-NOFAIL>`: used as mark for no-failure (helper to accumulate common failure-info);
filter.d/sshd.conf: [sshd], [sshd-ddos], [sshd-aggressive] optimized with pre-filtering using new option `prefregex` and new multi-line handling.
2017-02-22 22:19:43 +01:00
sebres
8bcaeb9022
amend to 4ff8d051f4: fixed fail2ban-regex with journalmatch using systemd-journal
2017-02-21 17:07:37 +01:00
sebres
22afdbd536
Several filters optimized with pre-filtering using new option prefregex
2017-02-21 15:54:59 +01:00
sebres
2fad50b6e8
Precedence of prefregex higher as failregex should be in head of the convert-stream;
...
Allow using failure-id (`<HOST>`) within `prefregex` (by common prefix for all expressions specified with `failregex`)
2017-02-21 15:54:25 +01:00
sebres
4ff8d051f4
Introduced new filter option prefregex for pre-filtering using single regular expression;
...
Some filters extended with user name;
[filter.d/pam-generic.conf]: grave fix injection on user name to host fixed;
test-cases in testSampleRegexsFactory can now check the captured groups (using additionally fields in failJSON structure)
2017-02-20 16:54:17 +01:00
sebres
9d15a792a5
amend to fe06ffca71: small optimization using already known IP family
2017-02-20 16:46:45 +01:00
sebres
fe06ffca71
Fix retrieving of IPv6 address with dnsToIp on some systems (default returns AF_INET family only), fix network test-cases.
2017-02-20 12:17:28 +01:00
sebres
61c8cd11b8
Exposes filter group captures in actions (non-recursive interpolation of tags <F-...>);
...
Closes gh-1110
2017-02-20 11:36:08 +01:00
sebres
6d878f3a43
try to provide filter captures (already in ticket data) to the actions as interpolation options (closes gh-1110)
2017-02-17 23:47:41 +01:00
Serg G. Brester
2fa18a74c4
Merge branch 'master' into master
2017-02-17 09:06:09 +01:00
sebres
a8c0cec4ac
small amend with several fixes and test coverage
2017-02-16 22:13:56 +01:00
sebres
9ebf70cd6a
Safer, more stable and faster replaceTag interpolation (switched from cycle over all tags to re.sub with callable)
2017-02-16 18:28:59 +01:00
sebres
a6318b159b
substituteRecursiveTags optimization + moved in helpers facilities (because currently used commonly in server and in client)
2017-02-16 16:01:10 +01:00
sebres
3fae8a7e43
amend to fc315be4ea: parse and interpolate all options in section "Definition" (section "Init" no more needed),
...
because of better performance with this solution;
2017-02-16 14:53:57 +01:00
sebres
4bf09bf297
provides new tag <ip-rev> for PTR reversed representation of IP address;
...
[action.d/complain.conf] fixed using this new tag;
2017-02-16 13:38:20 +01:00
sebres
fc315be4ea
try to parse and interpolate all options in section "Definition" (section "Init" no more needed)
2017-02-16 13:32:56 +01:00
Serg G. Brester
7f63809afb
Merge branch '0.10' into patch-1
2017-02-15 20:33:36 +01:00
Serg G. Brester
2d12349eac
Update servertestcase.py
...
Make the test-case gh-1685 compliant
2017-02-15 20:30:48 +01:00
sebres
abd80696ab
Merge branch 'py-3.6-compat' into 0.10
2017-02-15 19:09:20 +01:00
sebres
cf53a834f7
python-3.6 compatibility:
...
- dynamical string replacement within call of regexp.sub fixed with lambda-replacement (otherwise "sre_constants.error: bad escape \s at position");
- optional arguments (3.6 has more agrs by calling of SMTPServer.process_message);
- implicit convert byte to string, because python3.6 fails on binary data (test_smtp).
2017-02-15 19:05:45 +01:00
sebres
01db0b5028
small performance fix after merge with 0.10
...
(cherry picked from commit 8e2711681c )
2017-02-15 19:04:24 +01:00
sebres
63f7916886
fix test cases by testing with multi-threaded execution (wait for threaded execution done)
...
(cherry picked from commit 1ec6782f32 )
# Conflicts:
# fail2ban/tests/observertestcase.py (not yet available in 0.10)
2017-02-15 18:58:40 +01:00
sebres
f35aa6d258
coverage: added python3.6
2017-02-15 08:46:27 +01:00
sebres
40837754c9
python3.6 compatibility fix
2017-02-15 08:45:15 +01:00
Christoph Theis
861ce4177c
#1689 : Make lowest rule number in action.d/bsd-ipfw.conf configurable
2017-02-14 18:31:42 +01:00
Felix Yan
68d829c1dd
Add a path configuration for Arch Linux
2017-02-14 18:43:01 +08:00
Jan Grewe
58c68b75f0
Remove double-quotes from email addresses
2017-02-08 14:16:13 +01:00
Jan Grewe
1bcf0de7c1
Update complain.conf
2017-02-07 21:39:46 +01:00
Serg G. Brester
ac7be38dbe
Merge pull request #1686 from Slamdunk/postfix-rbl-554-SMTP
...
Postfix RBL: 554 & SMTP
2017-02-07 15:37:18 +01:00
Filippo Tessarotto
607568f5da
Postfix RBL: 554 & SMTP
2017-02-07 15:26:06 +01:00
Jan Grewe
901eeff53d
Make Abusix lookup compatible with Dash
2017-02-06 22:04:36 +01:00
sebres
96d404f0fb
Merge branch 'master' into 0.10
2017-01-23 09:27:40 +01:00
sebres
c4dc698d98
evil symlink removed: does not supported by some file systems (e. g. development over net share)
2017-01-23 09:26:05 +01:00
sebres
1823571e0f
Merge branch 'ssh-filter-new-regexp' into 0.10
2017-01-23 08:58:43 +01:00
sebres
c4d56ea84a
Merge branch 'ssh-filter-new-regexp'
2017-01-23 08:58:03 +01:00
sebres
9d06f0ee40
sshd-amend: optional space after port part
2017-01-23 08:56:47 +01:00
sebres
e8a1556562
Merge remote-tracking branch 'master' into 0.10
...
# Conflicts:
# fail2ban/tests/samplestestcase.py
2017-01-21 16:59:41 +01:00
Serg G. Brester
3ccb026840
Merge pull request #1209 from sebres/ssh-filter-new-regexp
...
sshd-aggressive (new ssh rules added (gh-864) and code review...)
2017-01-21 16:29:42 +01:00
sebres
54a8c681ce
suhosin.conf: removed greedy match
2017-01-21 16:26:07 +01:00
sebres
8aa9516d50
sshd.conf: fixed expression "received disconnect ... auth fail" - optional space after port part (gh-1652)
2017-01-21 16:18:03 +01:00
sebres
c8f473110c
change log update after rebase
2017-01-21 15:59:27 +01:00
sebres
3276bd6d54
sshd: additionally aggressive filter rules - no matching cipher resp. no matching key exchange method (gh-1545, gh-1117)
2017-01-21 15:57:05 +01:00
sebres
628789f9a9
sshd: conditional parameter "mode" for sshd jail (normal, ddos, aggressive)
...
filter sshd-ddos and new filter sshd-aggressive are both derivation of sshd-filter
2017-01-21 15:54:49 +01:00
sebres
dd373dba9f
test all config-regexp, that contains greedy catch-all before <HOST>, that is hard-anchored at end or precise sub expression after <HOST>;
...
new ssh rule(s) added:
- Connection reset by peer (multi-line rule during authorization process);
- No supported authentication methods available;
Single line and multi-line expression optimized, added optional prefixes and suffix (logged from several ssh versions);
closes gh-864
2017-01-21 15:53:48 +01:00
Serg G. Brester
5e08298b6b
Update ChangeLog
2017-01-20 08:47:30 +01:00
Christian Brandlehner
a4d8426401
Support for IBM Domino SMTP task ( #1603 )
...
filter.d/domino-smtp.conf
2017-01-20 08:44:20 +01:00
Serg G. Brester
40f294e6bf
Merge pull request #1663 from jjeziorny/netscaler-action
...
Introduced citrix netscaler action
2017-01-19 16:25:23 +01:00
Serg G. Brester
75b252e47f
Update ChangeLog
2017-01-19 15:00:08 +01:00
Juliano Jeziorny
1fe554dd25
Introduced Citrix Netscaler action
2017-01-19 14:30:25 +01:00
Serg G. Brester
063a11564b
Merge pull request #1673 from chtheis/master
...
Wrong paths for apache and nginx under FreeBSD
2017-01-18 17:12:20 +01:00
Christoph Theis
fe76cd9b7d
#1667 : changelog entry
2017-01-17 14:05:20 +01:00
Christoph Theis
6187431629
#1667 : Wrong paths for apache and nginx under FreeBSD
2017-01-17 11:48:25 +01:00
Serg G. Brester
5bfdd521f0
Merge pull request #1669 from sebres/0.10-recognize-restored-tickets
...
Recognize state of restored tickets
2017-01-17 09:39:56 +01:00
sebres
f35da076df
ChangeLog entry
2017-01-16 09:55:01 +01:00
sebres
74a6afadd5
Mail-actions switched to use new option "norestored" instead of checking of variable restored during shell execution (prevents executing of such actions at all).
2017-01-16 09:40:48 +01:00
sebres
8b82c6669e
provide name of action to fail-message (e. g. if interpolation fails)
2017-01-16 09:34:10 +01:00
sebres
0aa241d303
Another way to recognize restored tickets - new option norestored of action introduced;
...
Complete prevents executing of ban/unban operations for actions where norestored = true.
2017-01-16 09:05:45 +01:00
sebres
2ed2e7810d
normalization of DefinitionInitConfigReader (action / filter): client-side interpolation, etc.
2017-01-16 09:03:06 +01:00
sebres
de49f0c27f
ChangeLog entry
2017-01-13 19:45:10 +01:00
sebres
ee3c787cc6
Recognize restored (from database) tickets after restart (tell action restored state of the ticket);
...
Prevent executing of several actions (e.g. mail, send-mail etc) on restart (bans were already notified).
Test cases extended (smtp and by restart in ServerReloadTest).
Closes gh-1141
Closes gh-921
2017-01-13 19:06:17 +01:00
oliverdorn
4a65e069e1
Solution for issue #1665
...
Solves the issue of authentic GoogleBots being banned by apache-fakegooglebots.
2017-01-13 08:59:45 +01:00
Serg G. Brester
6f190b6e61
readme.md: added IPv6 launch logo for 0.10th branch
...
Closes gh-1647
2017-01-12 12:41:08 +01:00
sebres
bf872213bd
amend for 7019640eb3 (fix-gh-1658): sshd test-cases extended with IPv6 to cover this fix
2017-01-10 13:48:17 +01:00
sebres
7019640eb3
Merge branch 'fix-gh-1658' into 0.10
2017-01-10 12:59:51 +01:00
sebres
a9523aefbb
sshd.conf: fixed non-anchored part of regex (misleading match of colon inside IPv6 address instead of : in the reason-part by missing space).
2017-01-10 12:58:44 +01:00
sebres
c9f32f75e6
Merge branch '0.9-fix-regex-using-journal' into 0.10-fix-regex-using-journal (merge point against 0.9 after back-porting gh-1660 from 0.10)
2017-01-10 11:25:41 +01:00
sebres
f8d35a7c9c
changelog entry
2017-01-10 11:16:17 +01:00
sebres
2009f1c434
fail2ban-regex: fix for systemd-journal (see gh-1657)
2017-01-10 11:13:18 +01:00
sebres
fb27d9ce83
fail2ban-regex: fix for systemd-journal (see gh-1657)
2017-01-10 10:59:53 +01:00
Andrew James Collett
18d09b6d8e
Updated changelog.
2017-01-08 09:50:58 +02:00
Andrew James Collett
3991f51f30
Update jail.conf
...
Sigh, added a space back that I somehow missed in Vim, despite it being a rebase...
2017-01-08 09:45:35 +02:00
Andrew James Collett
10d61e0779
Fixed the spaces again
2017-01-08 09:42:15 +02:00
Andrew James Collett
b35391e768
Update jail.conf
...
Fixing spacing
2017-01-08 09:30:00 +02:00
Andrew James Collett
1c41390f7c
Restructured the way the catagories work.
...
Jail.conf is cleaner and abuseipdb.conf is more flexible.
2017-01-08 09:26:11 +02:00
Andrew James Collett
55e107310f
Added config for AbuseIPDB, ony tested on Ubuntu 16.04
2017-01-07 14:24:54 +02:00
Viktor Szépe
81c1810f10
Introduce Cloudflare API v4
...
In the cloudflare action everyone is suggested to use API v4.
And I don't dare to contribute any actual change.
2016-12-31 21:30:57 +01:00
Hank Leininger
9fbf713d7d
Wait up to 30 seconds on "stop" to avoid errors.
...
The fail2ban server can take several seconds to shut down. This can
make Gentoo's start-stop-service time out and decide that stopping has
failed, even if it actually succeeds a few seconds later.
The default timeout for start-stop-service if --retry is not specified
appears to be 5 seconds. Increase that to 30 seconds to be sure that if
fail2ban-server is going to be able to stop, it has time to do so.
2016-12-28 11:14:32 -05:00
benrubson
cc311b56f3
Apache URIs can contain spaces
2016-12-23 22:57:24 +01:00
roedie
3adc16d266
Shorewall IPv6 suggested changes.
...
Change files as suggested by sebres.
2016-12-12 20:53:58 +01:00
Yaroslav Halchenko
31a1560eaa
minor typos (thanks Vincent Lefevre, Debian #847785 )
2016-12-11 15:13:11 -05:00
roedie
6e18508a07
Add shorewall IPv6 support
...
Small patch which allow fail2ban to use shorewall for IPv6 bans.
2016-12-11 20:44:54 +01:00
Yaroslav Halchenko
4a1fd888f0
Carry on development
2016-12-11 00:49:09 -05:00
Yaroslav Halchenko
3605155978
updated man pages
2016-12-09 09:36:08 -05:00
Yaroslav Halchenko
482252dbd4
ENH: prep for 0.9.6 release (as of tomorrow)
2016-12-09 09:35:03 -05:00
Yaroslav Halchenko
e550850b9c
BF: added missing entires into MANIFEST
2016-12-09 09:34:44 -05:00
Serg G. Brester
556a9373ce
Update ChangeLog
2016-11-28 23:40:33 +01:00
Serg G. Brester
feae7370ce
Update THANKS
2016-11-28 23:19:24 +01:00
sebres
45f1d811c9
Merge branch 'alex1702-1586'
2016-11-28 18:54:02 +01:00
sebres
67c14afd8e
ChangeLog entry added + jail.conf review
2016-11-28 18:51:23 +01:00
sebres
425170cef3
code review, makes the test cases workable, added dev-notes
2016-11-28 18:39:07 +01:00
Serg G. Brester
8d9fe5d3da
Merge pull request #1583 from sebres/_0.10/fix-datedetector-grave-fix-v2
...
0.10/datedetector grave fix
2016-11-28 17:37:36 +01:00
sebres
8018796b45
wrong indentation (important code-piece in if log-level only)
2016-11-28 17:17:48 +01:00
sebres
39c343bd06
better reorder templates handling, code coverage increase (a small part of _reorderTemplate was not covered at all)
2016-11-28 15:18:31 +01:00
sebres
5d5ab27435
small amend: removed unreachable code + coverage increase
2016-11-28 13:17:36 +01:00
Serg G. Brester
f827675822
Merge pull request #1627 from sebres/fix-gh-1626
...
Fix gh-1626: one space after ModSecurity
2016-11-28 12:00:53 +01:00
sebres
b8c41dcb49
ChangeLog update
2016-11-28 11:31:51 +01:00
sebres
931eab84b5
filter.d/apache-modsecurity.conf
...
- fixed for newer version (one space, closes gh-1626)
reviewed and optimized:
- non-greedy catch-all replaced for safer match
- unneeded catch-all anchoring removed
- non-capturing groups
2016-11-28 11:28:27 +01:00
sebres
c06084d7d9
_start_params - fix: symlinks should be absolute paths
2016-11-28 11:04:37 +01:00
sebres
40cbe96352
Merge remote-tracking branch 0.10 into _0.10/fix-datedetector-grave-fix-v2
2016-11-28 11:03:11 +01:00
Serg G. Brester
389ad10344
Merge pull request #1622 from sebres/_0.10/configreader-and-more
...
0.10/configreader and more: substitution `%(param)s` from init block
2016-11-28 10:08:30 +01:00
Serg G. Brester
b8b5907706
Merge pull request #1624 from sebres/fix-gh-1623
...
filter.d/dovecot.conf update: ignore additionally irrelevant info in anchored regex before "auth failed"
2016-11-26 17:07:39 +01:00
sebres
5678d08a79
filter.d/dovecot.conf update:
...
- fixes failregex, that ignores failures through some irrelevant info (closes #1623 );
- ignores whole additionally irrelevant info in anchored regex before fixed failure data `\((?:auth failed, \d+ attempts( in \d+ secs)?|tried to use (disabled|disallowed) \S+ auth)\)`
- review, IPv6 compatibility fix, non-capturing groups
2016-11-26 16:50:37 +01:00
sebres
ce540554c5
Merge configreader-py3-compat branch into _0.10/configreader-and-more
2016-11-25 20:14:45 +01:00
sebres
ec7bb0d6c9
python 3x compatibility fix (positional arguments vs named arguments)
2016-11-25 20:12:49 +01:00
Serg G. Brester
ac1729e473
Merge pull request #1620 from fail2ban/close-gh-1120
...
jail.conf: added `knocking_url` filter-parameter of `pass2allow-ftp`...
2016-11-25 19:29:10 +01:00
sebres
a2af19c9f0
fixed several actions, that could not work with jails using multiple logpath; additionally repaired execution in default shell (bad substitution by ${x//...} executing in /bin/sh);
...
added helper "action.d/helpers-common.conf", and `_grep_logs` part-command for actions needed grep logs from multiple log-files
test cases: executing of some complex actions covered
2016-11-25 19:27:26 +01:00
sebres
65abc639cc
allow newline in extra init-parameters of action/filter (or interpolation of it), e. g. action[..., logpath="%(logpath)s"]
2016-11-25 16:56:46 +01:00
sebres
097970781c
filter/action (and its includes): substitution %(param)s may be used now (instead of <param>) for init-values specified in jail-configs via action[param1="...", param2=...];
...
substitution `<param>` should be used for dynamic interpolation only (todo: review configurations to replace it);
2016-11-25 16:53:46 +01:00
sebres
b856e1dadc
Merge pull request #1618 from sebres/_0.10/systemd-service
2016-11-24 20:45:17 +01:00
sebres
308bba448c
ChangeLog update
2016-11-24 20:43:55 +01:00
sebres
95dd76b7dd
Merge pull request #1619 from sebres/_0.10/skip-wrong-jails
2016-11-24 20:27:40 +01:00
sebres
d908688b56
ChangeLog update
2016-11-24 20:25:08 +01:00
Serg G. Brester
4f5389fee5
Update jail.conf
2016-11-24 19:30:10 +01:00
sebres
45174c5eaf
if fail2ban running as systemd-service, for logging to the systemd-journal, the logtarget could be set to STDOUT
...
small fixes by logging in stdout (+ system targets also allowed in lowercase now)
2016-11-24 12:13:47 +01:00
sebres
1cd67ecaa2
automatically creates /var/run/fail2ban before start fail2ban (systems which /var/run/ is virtual resp. memory mount device)
2016-11-24 11:37:18 +01:00
sebres
7256a5cb8e
code review: back to previous code - no skipping in testReadTestJailConf
2016-11-22 17:55:27 +01:00
sebres
8ed5b44bfd
no cover for sporadic executed (time-related) code pieces (just to prevent randomly increasing/decreasing of coverage)
2016-11-22 17:38:32 +01:00
sebres
fdac44ca58
introduced new option -t or --test to test configuration resp. start server only if configuration is clean (not skip wrong configured jails if option -t specified);
2016-11-22 17:08:44 +01:00
sebres
3e9852d4d2
code review, increase coverage
2016-11-22 14:56:54 +01:00
sebres
4882093a41
test cases extended: cover skipping invalid jail
2016-11-22 14:09:44 +01:00
sebres
e52b47d8f5
normalized log output (all jail parameters in filter are indented with 2 spaces)
2016-11-22 13:57:20 +01:00
sebres
c6e8c700f7
test cases fixed
2016-11-22 13:57:06 +01:00
sebres
77dc5a334c
really skips invalid jails (because of theirs wrong configuration) - server starts nevertheless, as long as one jail was successful configured;
...
message about wrong jail configuration logged in client log (stdout, systemd journal etc.) and in server log as error
2016-11-22 13:23:30 +01:00
sebres
528a7a5abb
systemd service update:
...
- starting service in normal mode (without forking)
- does not restart if service exited normally (exit-code 0, e.g. stopped via fail2ban-client)
- does not restart if service can not start (exit-code 255, e.g. wrong configuration, etc.)
- service can be additionally started/stopped with commands (fail2ban-client, fail2ban-server)
2016-11-22 11:14:27 +01:00
Johannes Weberhofer
f46ada023e
Use Fedora's backend-settings for openSUSE
...
Those settings are ok for newer openSUSE versions
2016-11-22 09:03:54 +01:00
sebres
261f875748
Fixed sporadic tab-replacement (\n\t instead of \n by word wrapping) in mime content of smtp-message in test cases, see
...
https://github.com/fail2ban/fail2ban/pull/1410#issuecomment-262000804
2016-11-21 19:06:17 +01:00
Serg G. Brester
44fddc102d
Merge pull request #1616 from sebres/fix-1194
...
[fix-gh-1194] Fixed misleading errors logged from ignorecommand in success case on retcode 1
2016-11-21 17:15:16 +01:00
sebres
701abfd250
ChangeLog entry added
...
+ indentation fix (space-tab replacement)
2016-11-21 17:13:43 +01:00
sebres
c442569b63
executeCmd: added possibility to select success return codes
...
ignorecommand: both return codes (0, 1) are success codes now, so no errors will be logged + test cases extended to check this (and error case)
2016-11-21 16:35:33 +01:00
sebres
189e70d99c
processLine etc. rewritten:
...
- normalize calling parameters (persistent parameters moved from function arguments to filter member variables)
- save last line as lambda instead of return it as string (lazy convert of process line tuple to string on demand, needed in fail2ban-regex only)
2016-11-18 17:02:00 +01:00
sebres
a2cf34a64e
code review: added endpos to found tuple, just to be safe by unpack
2016-11-17 21:12:23 +01:00
sebres
b5433f48b7
amend after code review of merge gh-1581
2016-11-11 11:09:46 +01:00
sebres
bee6e7376b
Merge branch 'aclindsa:master'
2016-11-11 10:58:40 +01:00
sebres
ea4c1f6356
Merge branch 'master' into 0.10
2016-11-11 10:29:45 +01:00
sebres
dab5f56609
Merge branch 'fix-gh-1477'
2016-11-11 10:17:07 +01:00
Alex
8ac28e5dcb
Make changes and add test file
2016-11-10 13:09:32 +01:00
Alex
8c40766511
Add Mongodb-auth filter and jail
2016-11-10 12:48:24 +01:00
Serg G. Brester
4e252be76f
Update FILTERS
...
closes #1591
2016-10-25 11:01:32 +02:00
sebres
58717c1854
fail2ban-testcases: persistently set (python) time zone to CET during test cases process (used in zone-related test-cases)
2016-10-17 13:26:24 +02:00
sebres
c8b036456d
changelog entries
2016-10-17 12:47:42 +02:00
sebres
ffa9705412
fixed UTC/GMT named time zone using %Z and %z patterns (special case with 0 zone offset);
...
Currently still ignores another named zones, because fail2ban assumes that the given date is in the current default zone.
Closes gh-1575
2016-10-17 12:09:53 +02:00
sebres
faee5f1fdc
better caching (thereby better performance), better recognition of similar regex
2016-10-17 11:20:30 +02:00
sebres
ae7297e16b
more precise date template handling (WARNING: this commit creates possible incompatibilities):
...
- datedetector rewritten more strict as earlier;
- default templates can be specified exacter using prefix/suffix syntax (via `datepattern`);
- more as one date pattern can be specified using option `datepattern` now (new-line separated);
- some default options like `datepattern` can be specified directly in section `[Definition]`, that avoids contrary usage of unnecessarily `[Init]` section, because of performance (each extra section costs time);
- option `datepattern` can be specified in jail also (jails without filters);
- if first group specified, only this will be cut out from search log-line (e. g.: `^date:[({DATE})]` will cut out only datetime match pattern, and leaves `date:[] failure ip...` for searching in filter);
- faster match and fewer searching of appropriate templates (DateDetector.matchTime calls rarer DateTemplate.matchDate now);
- standard filters extended with exact prefixed or anchored date templates;
template cache introduced (in opposition to default template cache, holds custom templates cached by pattern for possible common usage of same template/regex);
2016-10-17 11:20:27 +02:00
sebres
bd1eb70c52
speedup template first time selection through pre-sorted template list by template hits
2016-10-17 11:18:35 +02:00
sebres
0bed91b3c2
speedup SeekToTime test cases using exact date pattern...
2016-10-17 11:18:33 +02:00
sebres
e735f8f568
default non-unicode and case-sensitive matching (by pattern templates automatically add (?iu) for "ignore case" and "unicode" if expected)
2016-10-17 11:18:32 +02:00
sebres
ab0ac2111c
added possibility to specify more precise default date pattern:
...
- `datepattern = {^LN-BEG}` - only line-begin anchored default patterns
(matches date only at begin of line, or with max distance up to 2 non-alphanumeric characters from line-begin);
- `datepattern = {*WD-BEG}` - only word-begin anchored default patterns;
- `datepattern = ^prefix{DATE}suffix` - exact specified default patterns (using prefix and suffix);
common filter configs gets a more precise, line-begin anchored (datepattern = {^LN-BEG}) resp. custom anchoring default date-patterns;
2016-10-17 11:18:30 +02:00
sebres
f56ff5f48b
optimized to better usage of the last time template (parse part of line at the same place as last time, if enclosed in the same boundaries)
...
thereby follow rule "shortest distance to datetime should win", so possible collision causes search though all templates;
speedup it a little bit (not possible collision if distance <= 1 or if line-begin anchoring, so break search if such template found)
2016-10-17 11:18:27 +02:00
sebres
b9033d004e
amend distance collision check - always find template with shortest distance, also first time (test-case extended);
...
datedetector property template without lock, initially placed start-anchored templates at begin of template list, small optimization of strptime
2016-10-17 11:18:26 +02:00
sebres
75a5440acf
extends date detector template with distance (position of match in log-line), to prevent grave collision using (re)ordered template list (e.g. find-spot of wrong date-match inside foreign input, misleading date patterns by ambiguous formats, etc.);
...
By change of the distance (e.g. another format found), the pattern with smallest distance will be always preferred now.
To speedup (template lookup) resp. minimize of list reorder counts, the distance will be used as divider factor of the template weight by the templates comparison.
2016-10-17 11:18:24 +02:00
sebres
84fe55b99b
[temp commit] 2nd try to optimize datedetector/datetemplate functionality (almost ready, needs fine tuning)
2016-10-17 11:18:19 +02:00
sebres
a7d9de8c52
[temp commit] 1st try to optimize datedetector/datetemplate functionality (fix ambiguous resp. misleading date detection if several formats used in log resp. by format switch after restart of some services):
...
* Misleading date patterns defined more precisely (using extended syntax %E[mdHMS]
for exact two-digit match)
* `filter.d/freeswitch.conf`
- Optional prefixes (server, daemon, dual time) if systemd daemon logs used (gh-1548)
- User part rewritten to accept IPv6 resp. domain after "@" (gh-1548)
2016-10-17 11:16:20 +02:00
Aaron Lindsay
7805f9972d
filter.d/sshd.conf: Match 'Invalid user' with 'port \d*'
2016-10-15 15:52:19 -04:00
Yaroslav Halchenko
5502e47486
Merge pull request #1579 from sebres/fix-gh-1578
...
filter.d/sendmail-reject.conf: double space (should be by missing dns-host only)
2016-10-15 13:18:52 -04:00
sebres
10bdadaef2
fixed sporadically (multi-threading) errors by reload/stop/start of polling filter inside getModified (so prevents to stop running main cycle)
2016-10-15 19:12:11 +02:00
sebres
519e355bf2
ChangeLog entry added
2016-10-15 14:59:36 +02:00
sebres
84c3eb3e0e
filter.d/sendmail-reject.conf: double space (should be by missing dns-host only)
...
Closes #1578
2016-10-15 14:53:45 +02:00
Serg G. Brester
c1174d7935
Merge pull request #1577 from sebres/_0.10/code-review-fix-log-fmt-auto-verbosity
...
0.10/code review + fix log format by auto verbosity
2016-10-15 13:01:19 +02:00
sebres
7f8c48d59e
code review (e. g. remove code duplication) and coverage
2016-10-15 00:39:25 +02:00
sebres
5b40309052
code coverage of server module: switch backend
2016-10-14 23:57:52 +02:00
sebres
57a7795282
code coverage of server module: multiple ignoreregex
2016-10-14 23:57:35 +02:00
sebres
1ef367e77a
fixes log format by starting server with --loglevel=debug without specifying of verbosity level
2016-10-14 23:30:12 +02:00
sebres
98f87a1a52
better server-ready event: notify waiting thread if server really ready (communication ready) or failed to start
2016-10-14 22:50:30 +02:00
sebres
c809c3e61e
Merge branch 'master' into 0.10
2016-10-13 19:01:13 +02:00
sebres
15dc2db8bb
Merge pull request #1498 from ahpnils:npf to master:
...
This new action files adds support for the NPF packet filter, available on NetBSD since version 6.0.
Closes #1498
2016-10-13 19:00:54 +02:00
Nils
f7df6026a3
Update Changelog to reflect the new np.conf action
2016-10-13 18:53:16 +02:00
Nils
d08db22b92
Create npf.conf for the NPF packet filter
...
This file adds support for the NPF packet filter, available on NetBSD since version 6.0
2016-10-13 18:50:54 +02:00
Serg G. Brester
77f2dcfdb6
Merge pull request #1576 from sebres/_0.10/fail2ban-regex-coverage
...
tests of fail2ban-regex extended to cover exec_command_line also
2016-10-13 18:42:07 +02:00
sebres
44f93bfbff
increase coverage, better test and output of errors
2016-10-13 18:27:59 +02:00
sebres
7e8575cc56
tests of fail2ban-regex extended to cover exec_command_line also;
...
Closes #1573
2016-10-13 17:32:38 +02:00
Serg G. Brester
733d0ef596
Merge pull request #1569 from sebres/_0.10/fix-fakegooglebot
...
fixes deprecated DNSUtils.IsValidIP in fakegooglebot ignore command
2016-10-06 12:15:49 +02:00
sebres
2d2d4cf185
amend to c2d2e79b0d: fixed sporadically bug in getBanListExtendedCymruInfo:
...
except dns.resolver.NXDOMAIN:
UnboundLocalError: local variable 'dns' referenced before assignment
2016-10-05 15:43:39 +02:00
sebres
0ae932ba5e
setup fix for python3, bypass directories (__pycache__) created after ignore command was tested
2016-10-05 15:29:56 +02:00
sebres
fa8184d4cc
fixes deprecated DNSUtils.IsValidIP in fakegooglebot ignore command + test covered now;
...
Closes #1559
2016-10-05 15:01:33 +02:00
sebres
973ac9a45c
amend to c2d2e79b0d: missing error variable in import block;
...
additionally fixes forgotten skip for cymru server case, if --no-network specified);
Closes #1568
2016-10-05 12:18:55 +02:00
sebres
c2d2e79b0d
ExtendedCymruInfo: better availability check (code review and timeout's);
...
max sleep time check of too long sleep increased to 1 second (typo fix)
2016-09-30 17:01:06 +02:00
sebres
ee1727ecca
Merge pull request #1563 from niklasf/fix-lazy-ipv6-regex (and sebres/fix-lazy-ipv6-regex) into 0.10
2016-09-30 13:34:54 +02:00
sebres
276759b6c2
ExtendedCymruInfo code review and availability check in test cases;
...
max sleep time check of too long sleep increased to 1 second
2016-09-30 13:19:00 +02:00
sebres
9bf8985e2a
nginx-limit-req.conf: more precise failregex (word-boundary if <HOST> should be non-greedy for some reasons)
2016-09-30 12:33:43 +02:00
sebres
06674bb989
use common regex for IP addresses (removed code duplication)
2016-09-30 12:33:41 +02:00
Serg G. Brester
ba9a88977f
Merge pull request #1562 from sebres/_0.10/fix-stability-and-speed
...
0.10/fix stability and speed optimization
2016-09-30 12:14:51 +02:00
sebres
8b0f6c5413
badips test cases check availability of badips service (and skip this tests if it not available)
2016-09-30 12:03:27 +02:00
sebres
9a7c753372
fixes method-related filter for tests of suite loaded with loadTestsFromName (they may be a suite self)
2016-09-30 11:26:49 +02:00
Niklas Fiekas
057f2f3c56
make the ipv6 host regex greedy
...
Previously the regex was lazily matching ``2606:2800:220:1:248:1893:25c8:1946``
as ``2606:2800:220:1:248:1893:25c8:1``.
2016-09-30 11:08:07 +02:00
sebres
77ec9df678
standardize and normalize verbosity parameters for fail2ban-regex / fail2ban-testcases (-v ... -vvvv, or --verbosity=0..4)
2016-09-30 10:01:21 +02:00
sebres
2cfaf845ca
standardize and normalize logging and verbosity formats, logging level etc between command lines (server, client, test-cases);
...
test cases could pass (so increase) verbosity to the client (and furthermore client to the server also), usable for debug purposes resp. simplifying read of the log-file;
custom and precise numeric log-levels can be given in test cases now;
2016-09-29 21:23:37 +02:00
sebres
62b8664175
speedup server start/stop (waiting for communicate, etc);
...
extend server socket with timeouts, extend ping with timeout parameter;
2016-09-29 21:11:54 +02:00
sebres
542419acab
filtertestcase: use shorter sleep (almost just for the context switch here)
2016-09-29 21:08:27 +02:00
sebres
b615ba49ff
disengage testExecuteTimeout test-case from -fast option, just make it faster (timeout shorter) in this case
2016-09-29 21:08:25 +02:00
sebres
b011cf17b2
increase performance of executeCmd (actions), thereby introduced new shorter interval for fast operations (leaves unchanged default wait operation intervals (sleep time, threshold interval) - for the same inertance, to save same system (load by many jails resp. log files);
...
extends wait_for with callable timeout (test case fixed);
2016-09-29 21:07:46 +02:00
sebres
310d4e224d
Merge branch master (0.9) into 0.10
2016-09-29 19:46:11 +02:00
Serg G. Brester
8e3e333d54
Update ChangeLog
2016-09-27 14:17:45 +02:00
Serg G. Brester
d9e1a4f547
Merge pull request #1556 from szepeviktor/master
...
Monit config: scripting is not supported in path
2016-09-27 14:16:52 +02:00
Serg G. Brester
a0d8581a2c
Merge pull request #1557 from sebres/_0.10/fix-reload-bug
...
0.10/reload-and-more: reload without restart, stability and performance fixes
2016-09-26 15:25:36 +02:00
sebres
5151c4fa6d
ChangeLog entries added
2016-09-26 15:12:50 +02:00
sebres
5e4fdb60c8
extended test-cases (coverage)
2016-09-26 10:50:02 +02:00
sebres
449c46aec4
extended test-cases (coverage)
2016-09-23 15:21:23 +02:00
sebres
004879b5b1
code review: switch MAX_TIME to 0X7FFFFFFFFFFF (is enough, because 4461763-th year, but better performance)
2016-09-23 09:32:10 +02:00
sebres
e00be5f308
Fixed sporadically error in testCymruInfoNxdomain, because of unsorted values:
...
```
AssertionError: Dictionaries differ:
{'country': ['unknown', 'nxdomain'], 'asn': ['4565', 'nxdomain'], 'rir': ['other', 'nxdomain']} !=
{'country': ['nxdomain', 'unknown'], 'asn': ['nxdomain', '4565'], 'rir': ['nxdomain', 'other']}
```
Added assertDictEqual for compatibility to early python versions (< 2.7);
2016-09-22 22:45:54 +02:00
sebres
e7fa74b989
smaller inertance inside test-cases (amend to d153555a07 with decreasing default wait operation that litle bit speedup test-cases)
2016-09-22 22:45:52 +02:00
sebres
ab0c28260b
switch down log level for some annoying messages to tracedebug or heavydebug (to 7 or even 5);
...
added verification of specified log-level before transmitting to the server;
numeric log-level allowed now in server (resp. fail2ban.conf);
2016-09-22 22:44:46 +02:00
Viktor Szépe
a406c6eb3a
By the author:
...
> Yes, scripting is not supported in path.
https://bitbucket.org/tildeslash/monit/issues/372/webadmin-shows-only-the-first-part-of#comment-27946048
2016-09-22 20:29:26 +00:00
sebres
48ebe3e735
FilterPyinotify: high cpu load fix - timeout for pyinotify must be set in milliseconds (our time values are floats contain seconds);
2016-09-22 20:15:12 +02:00
sebres
c0373a7158
repair typo bug in reloading for systemd-filter;
...
JailThread get method `join` for safe usage of it, also for not started threads (test-cases or in case of error), that will be used for cleanup resp. wait purposes also (see join of pyinotify-filter);
2016-09-22 19:00:54 +02:00
sebres
d153555a07
increase default wait operation (sleep time, threshold interval) - avowedly greater inertance, but fewer system load by many jails resp. log files;
...
waiting with `wait_for` extended with verifying of active flag;
implemented better error handling in some multi-threaded routines;
shutdown of jails rewritten (faster and safer, does not breaks shutdown process if some error occurred);
2016-09-22 18:10:42 +02:00
sebres
35ce1166b6
allows to update some configuration options (read with config-readers) with command line option, e. g.:
...
```bash
## start server with DEBUG log-level (ignore level read from fail2ban.conf):
fail2ban-client --loglevel DEBUG start
## or
fail2ban-server -c /cfg/path --loglevel DEBUG start
## keep server log-level by reload (without restart it)
fail2ban-client --loglevel DEBUG reload
## switch log-level back to INFO:
fail2ban-client set loglevel INFO
```
2016-09-22 14:21:31 +02:00
Serg G. Brester
28e286cd2d
Merge pull request #1551 from fail2ban/sebres-patch-fips-gh-1540
...
filter.py: FIPS compliant fix (use sha1 instead of md5 if not allowed)
2016-09-21 09:35:25 +02:00
sebres
0f1d1a0d4d
ChangeLog: FIPS compliant
2016-09-21 09:22:18 +02:00
Serg G. Brester
1071db2256
filter.py: easy-fix to use sha1 instead of md5 if its usage prohibited by some systems following strict standards (like FIPS)
...
closes gh-1540
2016-09-20 00:00:26 +02:00
Serg G. Brester
fad953ade6
Merge pull request #1544 from sebres/fix/vsftpd-gh-1543
...
filter.d/vsftpd.conf: optional reason part in message after FAIL LOGIN
2016-09-09 20:39:51 +02:00
sebres
20b92f3ead
fail2ban-regex: build replacement of <HOST> substitution corresponding parameter usedns - now also in fail2ban-regex (amend)
2016-09-09 20:31:52 +02:00
sebres
ebd864660a
normalize usage of preferred encoding (and decode any to string);
...
python 3.x compatibility (used uni_decode for string representation of stdout/stderr, unified test cases)
amend for #1542
2016-09-09 20:29:55 +02:00
sebres
e0347bb3a0
assertLogged extended with parameter wait (to wait up to specified timeout, before we throw assert exception) + test cases rewritten using that
2016-09-09 17:50:25 +02:00
sebres
a20f325f80
database: stability fix - repack cursor iterator as long as locked
2016-09-09 17:36:01 +02:00
sebres
f6197200a9
introduced new flag "banned" as property, used to recognize the ticket was really banned;
...
get/set restored flag functions rewritten to property "restored" similar to "banned";
several code optimizations and tests extensions;
2016-09-09 16:12:48 +02:00
sebres
2108216d33
file filter-backends: stability fix for sporadically errors - always close file handle, otherwise may be locked (prevent log-rotate, etc.)
2016-09-09 16:08:28 +02:00
sebres
4404642fa3
pyinotify-backend: stability fix for sporadically errors in multi-threaded environment (without lock)
2016-09-09 10:56:35 +02:00
sebres
8c4eebc3e3
reload actions amend, code review and test cases extended for update/start/stop of actions by reloading
2016-09-09 10:45:09 +02:00
sebres
9fb167b5e1
filter.d/vsftpd.conf: optional reason message after FAIL LOGIN, closes #1543
2016-09-09 09:20:15 +02:00
sebres
4fb511294e
temp commit: reload now supported actions and action reloading (parameters, unban obsolete removed actions, etc.)
2016-09-08 23:56:32 +02:00
sebres
d1ef33cc45
New command action parameter actionrepair - command executed in order to restore sane environment in error case of actioncheck.
...
# [WARNING] TODO: be sure all banactions get a repair command, because otherwise stop/start will theoretically remove all the bans, but the tickets are still in BanManager, so in case of new failures it will not be banned, because "already banned" will happen.
2016-09-08 20:06:22 +02:00
sebres
8cba537f6c
code review and use new logger-signals for waiting; + regenerated man-files
2016-09-08 18:38:33 +02:00
sebres
27f6fc083a
optimized BanManager: increase performance, fewer system load, try to prevent memory leakage:
...
- better ban/unban handling within actions (e.g. used dict instead of list)
- don't copy bans resp. its list on some operations;
- added new unbantime handling to relieve unBanList (prevent permanent searching for tickets to unban)
- prefer failure-ID as identifier of the ticket to its IP (most of the time the same, but it can be something else e.g. user name in some complex jails, as introduced in 0.10)
2016-09-08 18:27:55 +02:00
sebres
d2ddc59c40
build replacement of <HOST> substitution corresponding parameter usedns - dns-part will be added only if usedns is not no;
...
new replacement for `<ADDR>` in opposition to `<HOST>`, for separate usage of 2 address groups only (regardless of `usedns`), `ip4` and `ip6` together, without host (dns)
2016-09-08 15:38:36 +02:00
sebres
8c26cada27
temp commit: partially cherry picked from ban-time-incr branch
2016-09-08 11:43:27 +02:00
sebres
b12a3acb06
temp commit: reload not ready...
2016-09-07 21:07:50 +02:00
sebres
f512628af2
make with_foreground_server_thread decorator to test several client/server commands
2016-09-06 20:15:45 +02:00
sebres
0a7374dec6
Merge branch '_0.9/fix-systemd-convert-gh-1341' into _0.10/fix-systemd-convert-gh-1341
2016-09-06 16:53:01 +02:00
sebres
7ac9890bf6
forgotten obsolete code removed
2016-09-06 16:51:06 +02:00
sebres
ad61f0f381
Merge branch '_0.9/fix-systemd-convert-gh-1341' into _0.10/fix-systemd-convert-gh-1341
2016-09-06 16:37:45 +02:00
sebres
51fd9a1027
amend to activate performance-fix (respect findtime before search of match) + code coverage
2016-09-06 16:33:16 +02:00
sebres
e3a75b4f1e
optimize test cases after merge (using 0.10-features)
2016-09-06 15:30:35 +02:00
sebres
ae38b626d1
Merge branch '_0.9/fix-systemd-convert-gh-1341' into 0.10
2016-09-06 15:30:08 +02:00
sebres
57458a462e
allow to set default or preferred encoding for other filters (e.g. to decode bytes from journal)
...
# Conflicts:
# fail2ban/server/filter.py
2016-09-06 15:26:10 +02:00
sebres
3119f81705
fixed journal systemd ascii/utf-8 default converting (see gh-1341, gh-1344)
2016-09-06 15:25:59 +02:00
Yaroslav Halchenko
aff680eb43
Merge branch 'master' into 0.10 (strategy ours)
...
* master:
RF: Replace old fashioned "except E , e" with "except E as e" (Closes #1537 )
2016-09-06 08:19:10 -04:00
Yaroslav Halchenko
87acd7a0fc
RF: Replace old fashioned "except E , e" with "except E as e" ( Closes #1537 )
...
0.10 specific
supplement to b875e51cd7 in master AKA 0.9
2016-09-06 08:18:34 -04:00
Yaroslav Halchenko
f6258c7b69
Merge branch 'rf-exc'
...
* rf-exc:
RF: Replace old fashioned "except E , e" with "except E as e" (Closes #1537 )
2016-09-06 08:16:40 -04:00
Yaroslav Halchenko
adeb6e94a5
Merge remote-tracking branch 'origin/master' into 0.10
...
* origin/master:
2016-09-06 08:14:23 -04:00
sebres
00c08f0cfa
Merge pull request #1523 from sebres/_0.10/systemd-journal-path-gh-1408 with 0.10
2016-09-06 10:07:29 +02:00
Serg G. Brester
0f942aba17
Merge pull request #1539 from sebres/_0.10/fix-gh-1529
...
0.10/fix-gh-1529
2016-09-06 09:08:18 +02:00
sebres
1d6b546658
sleep a little bit in error case (to get around time-related errors, e.g. something like log-rotate, etc.)
2016-09-05 16:37:32 +02:00
sebres
6454d0cd75
prevents to stop processing after first unhandled exception inside processLineAndAdd (filter going idle after 100th error);
2016-09-05 16:17:14 +02:00
sebres
90f9009959
fixes wrong date (invalid format or value) recognition if template available (+ test cases extended)
2016-09-05 16:11:45 +02:00
sebres
d974ebd581
rewritten idle handling for all filters, test cases extended to work in idle mode also (should not find/process failures)
2016-09-05 14:12:12 +02:00
Yaroslav Halchenko
b875e51cd7
RF: Replace old fashioned "except E , e" with "except E as e" ( Closes #1537 )
2016-09-04 23:25:09 -04:00
sebres
23c14acec0
update _0.10/systemd-journal-path-gh-1408 (after merge _0.9/systemd-journal-path-gh-1408 to 0.10)
2016-09-01 16:28:58 +02:00
sebres
387aa6ba47
Merge master branch '_0.9/systemd-journal-path-gh-1408' into 0.10
...
# Conflicts:
# fail2ban/tests/filtertestcase.py
# fail2ban/tests/utils.py
2016-09-01 16:26:21 +02:00
sebres
c0e0cfb39d
Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10
2016-09-01 16:23:13 +02:00
sebres
564b696530
Merge branch '_0.9/systemd-journal-path-gh-1408'
2016-09-01 16:18:53 +02:00
sebres
5f35b52b9a
test cases extended
...
several test-case functionality cherry picked from 0.10 (SkipTest, with_tmpdir)
2016-09-01 16:17:06 +02:00
sebres
35b5fea038
backend "systemd" can be used as prefix now - backend = systemd[...]
2016-09-01 16:17:04 +02:00
sebres
7ed6cab120
jail configuration extended with new syntax to pass options to the backend (see gh-1408),
...
examples:
- `backend = systemd[journalpath=/run/log/journal/machine-1]`
- `backend = systemd[journalfiles="/run/log/journal/machine-1/system.journal, /run/log/journal/machine-1/user.journal"]`
- `backend = systemd[journalflags=2]`
2016-09-01 16:17:02 +02:00
sebres
1c4733ef89
[systemd] added new constructor parameters like journalpath, journalfiles and journalflags for systemd backup
...
optimized FilterSystemd method `run`: better wait in idle (no busy-loop), better poll handling, the ban will executed anywhere (at least at 100th log-entry), also if we have never ending logging in this jail (e.g. extremely logging or too many failures)
systemd test cases extended
2016-08-24 20:55:06 +02:00
Serg G. Brester
0ab042fcce
Merge pull request #1522 from sebres/fix-asterisk-log-prefix
...
filter.d/asterisk.conf: another part ` chan_sip.c:28468 handle_request_register:` (without `in`) in log prefix
2016-08-23 11:18:59 +02:00
sebres
4a1d720344
filter.d/asterisk.conf: another part chan_sip.c:28468 handle_request_register: in log prefix
2016-08-22 14:10:50 +02:00
sebres
2c54f90469
sshd-filter: better universal regexp, that matches more complex different injects, using conditional expressions (on username and auth-info section), see new test cases also.
2016-08-19 10:19:12 +02:00
sebres
a544c5abac
sshd-filter: recognized "Failed publickey for" now (gh-1477) + improved regexp (not anchored now to recognize all "Failed anything for ... from <HOST>"
...
ChangeLog entry added
2016-08-18 21:38:55 +02:00
Yaroslav Halchenko
6c737454dd
RF+ENH: 0.10/let know version when running tests and move arg parsing code into the module ( #1516 )
2016-08-18 10:14:03 -04:00
sebres
af126eb308
simplify fail2ban-testcases: move some code pieces inclusive option parser from fail2ban-testcases to tests/utils.py (+ coverage)
2016-08-18 15:05:03 +02:00
sebres
f7f618b15d
Let know the version (and python), also in travis (no output if verbosity is 0)
2016-08-18 14:22:38 +02:00
Serg G. Brester
13a70e3bdb
Merge pull request #1515 from sebres/_0.10/fix
...
0.10 fix sporadically test case assertion error in MonitorJournalFailures
2016-08-17 18:06:26 +02:00
sebres
9aca34d3b1
normalize name of the test cases: method and class name fixed for MonitorJournalFailures
2016-08-17 17:48:57 +02:00
sebres
4bb5f3492e
Merge branch '_0.10/tests-verbosity' into _0.10/fix
2016-08-17 16:45:04 +02:00
sebres
cd6b528542
new test-cases option "--verbosity" to set numeric level of verbosity during test cases;
...
travis uses same verbosity (2) running in python3 as from setup (python2)
2016-08-17 16:41:33 +02:00
sebres
f91ec84bfb
prevent theoretical time-related assertion errors for other filters, replace isFilled with waitFailTotal (known expected failure count)
2016-08-17 15:50:08 +02:00
sebres
67e4ac5c66
common monitor test case class, that unite some duplicate code
2016-08-17 13:45:50 +02:00
sebres
7b7d60c486
fixed sporadically test cases assertion error "AssertionError: 3 != 4" - because multi-threaded, occurred if getFailTicket() called after 3th failure (before 4th failure was monitored), so we will wait in new method waitFailTotal (instead of isFilled) for expected failure count...
2016-08-17 13:44:10 +02:00
Serg G. Brester
e3f4ea7284
Update README.md
...
fixed coveralls url to the default branch
2016-08-16 10:43:01 +02:00
Serg G. Brester
9a30cfa77d
Merge pull request #1510 from sebres/_0.10/optimize-setup-test-case
...
0.10/optimize setup test case
2016-08-16 10:16:42 +02:00
sebres
2b5c5103f4
safer multi-threaded execution inside (logging with lock inside LogCaptureTestCase logging handler);
...
additionally developer option `--log-direct` for fail2ban-testcases: disable lazy logging inside LogCaptureTestCase (default log-lazy is on)
2016-08-15 21:54:33 +02:00
sebres
5509ba37a2
Merge pull request #1512 from 'remotes/gh-upstream/0.9' into 0.10
2016-08-15 20:08:42 +02:00
Serg G. Brester
f61aa3225c
Merge pull request #1512 from sebres/_fix/datepattern-right-word-boundary
...
Fix ambiguous wrong recognized date pattern resp. its optional parts
2016-08-15 20:04:33 +02:00
sebres
9935cf19c1
description provided, ChangeLog entries added
2016-08-15 19:54:11 +02:00
sebres
0bdee2556f
testAmbiguousDatePattern rewritten with DateDetector/DatePatternRegex directly (moved to misctestcase.py)
2016-08-15 19:35:11 +02:00
sebres
8e09be5fc8
test cases for boundaries for date-pattern extended (negative/positive, left/right)
2016-08-15 18:53:35 +02:00
sebres
7f55be3fad
amend to b6bb2f88c1: datepattern right word boundary - prevents confusions if end of date-pattern (e.g. optional year part) misleadingly match not date values (see gh-1507)
...
test cases extended to check ambiguous "unbound" patterns in log lines (match/miss resp. positive/negative cases)
2016-08-15 16:51:55 +02:00
sebres
861fb8d463
Merge remote-tracking branch 'remotes/gh-upstream/0.10' into _0.10/optimize-setup-test-case
2016-08-15 13:53:44 +02:00
Serg G. Brester
d75af2f900
travis: coverage python 3.5 ( #1511 )
2016-08-15 13:52:32 +02:00
sebres
6fcf8192f3
code review
2016-08-15 13:51:50 +02:00
sebres
c3d1d51daf
Merge remote-tracking branch 'remotes/gh-upstream/0.9' into 0.10
2016-08-15 13:00:20 +02:00
sebres
c49fe12f70
fix fail2banregextestcase using setUpMyTime/tearDownMyTime: always use correct static time as base-time (using mock up MyTime), correct datetimes inside test
2016-08-15 12:57:39 +02:00
sebres
83029b89b9
amend to 2e530fcf72: setuptools compatibility fix - just to be sure if install_scripts will be incompatible tomorrow
2016-08-12 21:48:40 +02:00
sebres
eb72660eee
easy-fix: reset fail2ban link to python, if it targeted unavailable file
2016-08-12 21:32:18 +02:00
sebres
2e530fcf72
setuptools compatibility fix
2016-08-12 21:26:57 +02:00
sebres
fcae05190f
move common initializing functionality from fail2ban-testcases to tests/utils.py, to afford setting of default options by test execution from setup process.
2016-08-12 21:26:55 +02:00
sebres
b2ee3b120e
optimized logging using LogCaptureTestCase (new faster handler _MemHandler);
...
backwards compatibility for python 2.6 (SkipTest implemented), so options --fast and --no-network may be used now within python2.6 also;
2016-08-12 21:26:53 +02:00
sebres
461e9bab56
better handling of setup in test-cases (prevent execution of 2to3 twice, full logging in heavydebug, etc.)
2016-08-12 21:26:51 +02:00
sebres
d71a525a85
Merge branch 'master' into 0.10 (resolve conflicts and cleaning tree points after back-porting gh-1508 0.10 -> 0.9)
2016-08-12 18:51:56 +02:00
sebres
42b5a10f5d
Back-port pull request #1508 from sebres/_fix/python-executable-gh-1506 to master (0.10 -> 0.9)
2016-08-12 18:42:54 +02:00
sebres
cb340db220
ChangeLog entry for gh-1508
2016-08-12 18:37:46 +02:00
sebres
db30b7ce06
BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.)
2016-08-12 17:59:27 +02:00
sebres
6cdc1ce685
compatibility fix (virtualenv, running test cases in py3)
...
# Conflicts:
# MANIFEST
2016-08-12 17:59:24 +02:00
sebres
38d53a72fd
introduces new command "fail2ban-python", as automatically created symlink to python executable, where fail2ban currently installed (resp. its modules are located);
...
fixed pythonic filters and test scripts (running via "fail2ban-python" now);
fixed test case "testSetupInstallRoot" not for default python (also using direct call, out of virtualenv);
# Conflicts:
# config/filter.d/ignorecommands/apache-fakegooglebot
# fail2ban/tests/files/config/apache-auth/digest.py
# fail2ban/tests/files/ignorecommand.py
# fail2ban/tests/misctestcase.py
2016-08-12 17:58:37 +02:00
sebres
a4cef8a893
Merge branch '_fix/python-executable-gh-1506' into 0.10
2016-08-12 17:50:54 +02:00
Serg G. Brester
db24edba81
Update README.md
...
show status of builds (travis and coverage) from default branch (0.10)
2016-08-12 17:29:42 +02:00
sebres
c8e7c1f7f4
BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.)
2016-08-12 16:48:11 +02:00
sebres
f390a82b59
python 2.6 compatibility minor fix - no skip + BaseException.message seems to be deprecated
2016-08-11 21:37:16 +02:00
sebres
08af8de981
compatibility fix (virtualenv, running test cases in py3)
2016-08-11 21:35:13 +02:00
sebres
77f451c4a3
introduces new command "fail2ban-python", as automatically created symlink to python executable, where fail2ban currently installed (resp. its modules are located);
...
fixed pythonic filters and test scripts (running via "fail2ban-python" now);
fixed test case "testSetupInstallRoot" not for default python (also using direct call, out of virtualenv);
2016-08-11 18:34:18 +02:00
sebres
ad19c8401b
minor fix: modules are not intended to be executed directly (amend to #1426 )
2016-08-10 15:00:54 +02:00
Yaroslav Halchenko
9d70c49ea8
BF: install doc files only under Linuxes and other GNU systems ( Closes #1233 ) ( #1503 )
2016-08-09 12:49:40 +02:00
Yaroslav Halchenko
123f4ceaee
Changelog for postfix-sasl fix
2016-08-08 17:11:07 -04:00
maksyms
9ddbd642f7
Accept no space after "failed:" ( #1501 )
...
yoh: Squashed to ease cherry-picking into 0.9
* accept no space after "failed:"
fix issue #1497
* accept no space after "failed:"
* Update postfix-sasl
* Update postfix-sasl
* Update postfix-sasl
2016-08-08 17:09:47 -04:00
maksyms
04427adb95
Accept no space after "failed:" ( #1501 )
...
yoh: Squashed to ease cherry-picking into 0.9
* accept no space after "failed:"
fix issue #1497
* accept no space after "failed:"
* Update postfix-sasl
* Update postfix-sasl
* Update postfix-sasl
2016-08-08 17:07:55 -04:00
sebres
c52aaa8b78
ASSP failregex minor fixes
2016-08-08 19:06:28 +02:00
sebres
70658d7a19
Merge pull request #1494 from rhardy613/master (branch 'sebres:pr-1494')
2016-08-08 18:49:32 +02:00
rhardy613
89f8999fe5
Add changelog entry for ASSP filter changes
...
Add changelog entry for ASSP filter changes
2016-08-06 01:07:04 -04:00
rhardy613
8265e3f0f9
Fix comments
...
For some reasons the comment changes weren't pickup in the last commit.
This fixes it.
2016-08-05 23:25:15 -04:00
rhardy613
66fe5a77ce
Fix ASSP filter to work with both ASSP V1 and V2
...
ASSP V1 development stopped at the end of 2014 and it is now deprecated.
All users were urged to upgrade to ASSP V2 which is still actively
developed.
fail2ban 0.9.5 (and trunk) still have code which only understands ASSP
V1 logs.
This means the filter ignores brute force attacks against ASSP. This fix
adds V2 support.
2016-08-05 23:18:51 -04:00
rhardy613
890a3dcbb9
Fix ASSP filter to work with current release of ASSP
...
ASSP V1 development stopped at the end of 2014 and it is now deprecated.
All users were urged to upgrade to ASSP V2 which is still actively
developed. For some reason fail2ban 0.9.5 (and trunk) still have code
which only understands ASSP V1 logs. This means the filter ignores brute
force attacks against ASSP.
Now updated with anchored patterns tested against 6 months of log data.
2016-08-05 17:26:47 -04:00
Yaroslav Halchenko
c0994b0c6c
DOC: minor typo (thanks John Bernard) Closes #1496
2016-08-04 10:23:05 -04:00
sebres
eb6e3c52ae
ChangeLog entries for the last fix (cherry pick from 0.10)
2016-08-01 18:04:00 +02:00
sebres
f5b7ffeb4b
DOC: Reformatted ChangeLog into legit Markdown (after merge of master to 0.10)
2016-08-01 15:18:59 +02:00
sebres
0eea362aa0
Merge branch 'master' into 0.10
2016-08-01 15:10:52 +02:00
sebres
0083036b5f
Merge branch '0.9/gh-1492'
2016-08-01 14:45:05 +02:00
sebres
8b1225f177
several amend fixes after cherry pick from 10th branch
2016-08-01 14:07:37 +02:00
sebres
3e330604c7
several test cases rewritten using new assertIn, assertNotIn (better as own from unittest, because support generators beautifying, etc.)
...
+ new forward compatibility method assertRaisesRegexp;
+ methods assertIn, assertNotIn, assertRaisesRegexp are test covered now;
+ easy-fix for distributions compatible test cases (e.g. fedora default backend is 'systemd'), (closes gh-1353, closes gh-1490)
cherry picked from 9d56079756 (0.10 branch)
2016-08-01 13:52:05 +02:00
rhardy613
f73746d846
Fix ASSP filter to work with current release of ASSP
...
ASSP V1 development stopped at the end of 2014 and it is now deprecated.
All users were urged to upgrade to ASSP V2 which is still actively
developed. For some reason fail2ban 0.9.5 (and trunk) still have code
which only understands ASSP V1 logs. This means the filter ignores brute
force attacks against ASSP.
2016-07-31 13:50:52 -04:00
Yaroslav Halchenko
1fbb2c4c97
Merge pull request #1484 from yarikoptic/enh-pr-doc
...
DOC: added a note about choose correct branch for PR
2016-07-28 23:01:31 -04:00
Yaroslav Halchenko
1abb939233
Merge pull request #1492 from sebres/0.10-new-assert-meth
...
several test cases rewritten using new assertIn, assertNotIn
2016-07-28 23:01:02 -04:00
sebres
9d56079756
several test cases rewritten using new assertIn, assertNotIn (better as own from unittest, because support generators beautifying, etc.)
...
+ new forward compatibility method assertRaisesRegexp;
+ methods assertIn, assertNotIn, assertRaisesRegexp are test covered now;
+ easy-fix for distributions compatible test cases (e.g. fedora default backend is 'systemd'), (closes gh-1353, closes gh-1490)
cherry pick into 0.9 branch
2016-07-28 10:15:06 +02:00
Yaroslav Halchenko
d9f039df03
Merge branch 'master' of git://github.com/fail2ban/fail2ban
...
* 'master' of git://github.com/fail2ban/fail2ban:
BF: do not rely on long relative path to upstairs config - symlink dereferenced copied during install (#1485 )
2016-07-15 09:02:42 -04:00
Yaroslav Halchenko
cee09e29ec
BF: do not rely on long relative path to upstairs config - symlink dereferenced copied during install ( #1485 )
...
* BF: do not rely on long relative path to upstairs config - symlink common.conf
* Added missing files to MANIFEST
2016-07-15 09:19:45 +02:00
Yaroslav Halchenko
dca5ff44c2
Merge branch 'bf-common-zzz'
...
* bf-common-zzz:
BF: do not rely on long relative path to upstairs config - symlink common.conf
2016-07-14 22:25:07 -04:00
Yaroslav Halchenko
79616b76bf
Added missing files to MANIFEST
2016-07-14 22:19:10 -04:00
Yaroslav Halchenko
687ea8d333
BF: do not rely on long relative path to upstairs config - symlink common.conf
2016-07-14 22:15:22 -04:00
Yaroslav Halchenko
5714ac201b
DOC: preparations for 0.9.5 release
2016-07-14 21:35:49 -04:00
Yaroslav Halchenko
0f88e8a658
Added missing files to MANIFEST
2016-07-14 21:31:18 -04:00
Yaroslav Halchenko
72c4743666
Merge pull request #1481 from yarikoptic/doc-changelog
...
Doc changelog - reformatted for markdown and a bit less indentation
2016-07-14 21:23:09 -04:00
Yaroslav Halchenko
21056c995d
Merge remote-tracking branch 'origin/master' into doc-changelog
...
* origin/master:
another variant of regex
add trailing anchor to failregex
add PR id to ChangeLog
improved failregex according to @sebres recomendations
* add `__prefix_line` to regex * fix time in log file
add info to log file
added sample log lines for slapd
adding openldap slapd filter
2016-07-14 21:21:35 -04:00
Yaroslav Halchenko
c15e968c1f
DOC: added a note about choose correct branch for PR
2016-07-14 21:17:18 -04:00
Yaroslav Halchenko
5797ea0ae2
Let's work toward a2 release
2016-07-14 09:37:39 -04:00
Yaroslav Halchenko
28a0605f69
Merge pull request #1478 from gips0n/master
...
adding openldap slapd filter
2016-07-14 08:30:42 -04:00
sebres
9b03a6d42e
0.10 pre-release: MANIFEST RELEASE and man pages updates
2016-07-14 12:19:46 +02:00
sebres
41e3f2e5ed
explicit flush stdout/stderr before exit, because of possible buffered output in python (echo or grep fail2ban-client --version can sometimes returns nothing)
2016-07-14 11:35:32 +02:00
Andrii Melnyk
7433b353ee
another variant of regex
2016-07-14 10:19:21 +03:00
Andrii Melnyk
7c5828dd2a
add trailing anchor to failregex
2016-07-13 21:09:42 +03:00
sebres
683f8fc56c
Merge branch 'master' into 0.10
2016-07-13 19:41:46 +02:00
Yaroslav Halchenko
bf3188c290
Merge pull request #1413 from sebres/f2b-perfom-prepare-716-cs-0.10
...
0.10-cs: client-server rewritten as modules / start in foreground / test coverage for cs
2016-07-13 12:01:16 -04:00
sebres
f0b2cd2e39
remove no more necessary PRODUCTION from fail2banclient.py
2016-07-13 09:54:54 +02:00
sebres
53da35ea49
resolves Christmas-tree in logging (replaced with duplex space indentation)
2016-07-13 09:44:32 +02:00
sebres
ad393fcfbb
outsource assert..isStarted from setup into separate test case
2016-07-13 09:36:11 +02:00
Yaroslav Halchenko
dfcf6f1963
BF+TST: isStarted was not checking __asyncServer for exist before checking it
2016-07-12 22:53:37 -04:00
Yaroslav Halchenko
52cd8a9a96
RF: _rebindSignal helper to centralize assignment of new signal handlers + minor PEP8ing
2016-07-12 22:24:56 -04:00
sebres
0dc3db1f43
test of _kill_srv added, don't kill server if foreground;
...
pid_exists already available in Utils;
small bug and stability fixing;
2016-07-12 12:06:48 +02:00
sebres
7242c9cbde
code review after enhancements of Yaroslav
2016-07-12 12:02:05 +02:00
Yaroslav Halchenko
3c42b4f56e
minor residual cleanups
2016-07-12 00:06:41 -04:00
Yaroslav Halchenko
fcda7c9ac7
RF: revertably mock out exit call while testing new client/servers
2016-07-11 23:54:52 -04:00
Yaroslav Halchenko
1417cc99ef
RF: group common tests in base class, specialize assesment of good/bad runs per client/server
2016-07-11 23:26:30 -04:00
Yaroslav Halchenko
4df06f5352
ENH: testcases - verbosity > 2 now also includes logger name (to replace need for custom --s)
2016-07-11 22:44:47 -04:00
Yaroslav Halchenko
94cada0c6b
RF(PEP8 etc): Make new fail2banclienttestcase a bit more readable and PEP8 friendly
2016-07-11 22:42:48 -04:00
sebres
6a2b70f11d
os.path.join instead of "/" - concatenation
2016-07-11 13:26:10 +02:00
sebres
4180cc362e
code review
2016-07-11 13:22:58 +02:00
sebres
4c1bcac0c7
Merge branch '0.10' into f2b-perfom-prepare-716-cs-0.10
2016-07-11 11:28:34 +02:00
Yaroslav Halchenko
33ed71b3de
DOC: Reformatted ChangeLog into legit Markdown ( Closes #962 )
2016-07-10 19:53:54 -04:00
Yaroslav Halchenko
ec9c4a27f3
DOC: tuned up ChangeLog entries for 0.9.5
...
unified capitalized beginning of each entry
no trailing spaces or dots etc
2016-07-10 18:40:20 -04:00
Andrii Melnyk
2c5a489bc7
add PR id to ChangeLog
2016-07-08 13:55:58 +03:00
Andrii Melnyk
48c094f612
improved failregex according to @sebres recomendations
2016-07-08 13:45:10 +03:00
sebres
de5d911fd5
Merge branch 'asterisk_pjsip_2'
2016-07-08 11:47:29 +02:00
sebres
f5f204ca7c
Improved changes of gh-1458:
...
`[^']*` after callid was wrong, changed to `[^\)]*`;
regexp anchored at the end;
almost the same regex grouped to one;
Closes #1458
2016-07-08 11:45:25 +02:00
nturcksin
72a157b8f2
Improve PJSIP log support for asterisk 13+ with different callID (Squash gh-1458)
...
Change the asterisk pjsip filter to don't take the callId part
Add optional part between "Request" and "from"
Listed all log message from asterisk
2016-07-08 11:45:22 +02:00
Andrii Melnyk
dcb69b0242
* add __prefix_line to regex
...
* fix time in log file
2016-07-08 05:29:51 +03:00
Andrii Melnyk
c335663395
add info to log file
2016-07-08 05:12:25 +03:00
Andrii Melnyk
c9ab669851
added sample log lines for slapd
2016-07-08 04:56:29 +03:00
Andrii Melnyk
b2e3affaa0
adding openldap slapd filter
2016-07-08 04:50:57 +03:00
Yaroslav Halchenko
7582f13003
Merge pull request #1461 from yarikoptic/0.10
...
0.10: Freshly merged master
2016-06-20 09:44:31 -04:00
Yaroslav Halchenko
593b1210c0
Merge master (commit '0.9.4-79-gaf8b650') into 0.10
...
* commit '0.9.4-79-gaf8b650':
badip timeout option introduced, set to 30 seconds in our test cases (#1463 )
DOC: changelog for recent exim filters tune up
Asterisk pjsip (#1456 )
BF: finalize that sample log line for exim4
RF: for consistency use (?:XXX)? instead of (?:|XXX)
ENH: use non-capturing regex groups in exim-common and exim filters
ENH: exim filters -- make more use of %(host_info)s which in turn made more flexible
BF: make :port and I=[ip]:port optional for a "AUTH command used when not advertised"
2016-06-19 20:06:16 -04:00
Serg G. Brester
af8b650a37
badip timeout option introduced, set to 30 seconds in our test cases ( #1463 )
...
cherry-picked from 0.10 (little bit modified in test_badips.py, because no --fast option in test cases)
2016-06-13 12:56:53 +02:00
sebres
fd0c661a44
Merge pull request #1459 from sebres/0.10-fid-host-ip-tags
2016-06-12 15:10:24 +02:00
sebres
2efcf3c17b
increase of test coverage (+ test_IPAddr moved to one place), small bugs fixed
2016-06-10 13:17:18 +02:00
sebres
e39126f630
badip timeout option introduced, set to 30 seconds in our test cases
2016-06-10 13:15:46 +02:00
sebres
8893473d82
pypy fix: KeyError instead of IndexError by missing group
2016-06-10 11:47:24 +02:00
sebres
e40a8c8ae8
small code review
2016-06-10 11:22:14 +02:00
Yaroslav Halchenko
11f7cf5ad8
DOC: changelog for recent exim filters tune up
2016-06-07 21:38:39 -04:00
Yaroslav Halchenko
636a93f58b
Merge pull request #1438 from yarikoptic/bf-exim
...
exim filters -- make wider use of host_info helper str susbstitution + fix for #1430
2016-06-07 21:35:52 -04:00
Ludovic Gasc
f85fb45b29
Asterisk pjsip ( #1456 )
...
* Improve PJSIP log support for Asterisk 13+
* Update changelog: filter.d/asterisk.conf - fix security log support for PJSIP and Asterisk 13+
* Change pjsip regexp with sebres observation, thanks to @nturcksin
2016-06-07 11:40:35 +02:00
Yaroslav Halchenko
ced6c8307b
BF: finalize that sample log line for exim4
...
was intended in 743a531eb5 to be an entry without a port
after the [host]
2016-06-02 20:57:27 -04:00
sebres
d344274271
separated host match group and tags for ip4, ip6, dns, fid (failure-id):
...
- better recognition for usage of textToIp, expected or raw value should be used;
- separated failure id vs. host (if found use `fid` instead of `host` resp. `ip`);
- additional optional groups may be used in tags replacement by executing actions;
2016-05-31 21:55:26 +02:00
sebres
39366e703a
Merge branch 'master' into 0.10
...
# Conflicts:
# fail2ban/server/filter.py
2016-05-31 18:06:18 +02:00
sebres
b85347477f
Amend merge for pull request #1454
2016-05-31 17:47:12 +02:00
sebres
b3bb8b20bf
amend for new option of usedns=raw - forgotten validation fix inside setUseDns
2016-05-31 17:45:44 +02:00
Serg G. Brester
f23ccbda35
Merge pull request #1454 from sebres/gh-67-ban-wo-host
...
[gh-67] no-host ban
2016-05-31 16:07:06 +02:00
Yaroslav Halchenko
6434661480
RF: for consistency use (?:XXX)? instead of (?:|XXX)
2016-05-30 12:12:53 -04:00
Yaroslav Halchenko
48a8324662
ENH: use non-capturing regex groups in exim-common and exim filters
2016-05-30 11:02:12 -04:00
sebres
8ec4e1189e
use raw host (don't use textToIp) if usedns exactly raw, because usedns = no should ignore no ip failures
2016-05-30 15:34:21 +02:00
sebres
c33e25bab6
fail2ban-regex: extended with option '--raw' (switch to raw host, prevent resolving of ip)
2016-05-30 14:08:37 +02:00
sebres
b7787f4af4
use raw host (don't use textToIp) if usedns not yes or warn
2016-05-30 14:08:33 +02:00
Yaroslav Halchenko
e01cd8ab03
Merge pull request #1444 from yarikoptic/enh-courier-username
...
ENH: courier-smtp -- allow for trailing username (no spaces) in the logline
2016-05-26 19:26:35 -04:00
sebres
16d646bbb6
Merge branch 'master' into 0.10
...
empty merge, resolving conflicts after amend with cyclic recursions
2016-05-26 11:23:53 +02:00
sebres
93f776d2ee
amend for gh-1419: tags substitution bug - wrong recognition of cyclic recursion, new test cases covered this
2016-05-26 11:18:35 +02:00
sebres
858c5c0d00
Merge branch 'gh-1417'
2016-05-26 11:14:09 +02:00
sebres
a80043ce80
amend for gh-1419: tags substitution bug - wrong recognition of cyclic recursion, new test cases covered this
2016-05-26 11:13:33 +02:00
sebres
4dcf68ca1f
Merge branch 'master' into 0.10
...
# Conflicts:
# fail2ban/client/jailreader.py
# fail2ban/helpers.py
2016-05-23 15:48:46 +02:00
sebres
9df7973e95
Merge pull request #1439 from yarikoptic/enh-ignoreipsplit:
...
ENH: splitcommaspace -> splitwords allow to split ignoreip entries with new lines
2016-05-23 15:35:41 +02:00
sebres
156065e70d
splitwords: prevent to split to empty values by multiple separator characters together
2016-05-23 15:33:45 +02:00
Serg G. Brester
b6700f3e52
Merge pull request #1433 from yarikoptic/bf-0.10-pf-prevbeh
...
BF: maintain previous default beh for pf -- default ban type is multiport
2016-05-23 15:20:57 +02:00
Serg G. Brester
dcab8ab309
Merge pull request #1445 from koeppea/0.10-redunant-IPAddr-import
...
remove redundant IPAddr import
2016-05-23 14:36:19 +02:00
Alexander Koeppe
9681cd3be8
remove redundant IPAddr import
2016-05-22 10:27:36 +02:00
Yaroslav Halchenko
9bb869b8d4
ENH: courier-smtp -- allow for trailing username (no spaces) in the logline
...
Closes #1440
2016-05-21 22:17:09 -04:00
Yaroslav Halchenko
2bb2183800
Merge pull request #1443 from koeppea/correct-MANIFEST
...
correct MANIFEST file
2016-05-21 22:10:06 -04:00
Alexander Koeppe
ec7eabbd3b
correct MANIFEST file
2016-05-22 00:18:14 +02:00
Yaroslav Halchenko
01d0506ea0
ENH: splitcommaspace -> splitwords allow to split ignoreip entries with new lines
...
Closes #1432
2016-05-21 10:55:27 -04:00
Yaroslav Halchenko
8b8cf2a660
ENH: exim filters -- make more use of %(host_info)s which in turn made more flexible
2016-05-21 10:29:09 -04:00
Yaroslav Halchenko
743a531eb5
BF: make :port and I=[ip]:port optional for a "AUTH command used when not advertised"
...
Closes #1430
2016-05-21 10:29:01 -04:00
sebres
f62266659f
Merge branch 'master' into '0.10'
2016-05-21 13:48:00 +02:00
Serg G. Brester
b56f4c533e
Merge pull request #1436 from sebres/speedup-db
...
extremely speedup of all database operations
2016-05-21 13:39:48 +02:00
sebres
3d99833570
forgotten convert for bantime (str2seconds) in action, as long as it should be supplied as parameter of action executable;
...
covered via test cases now
2016-05-21 13:33:22 +02:00
sebres
1718c8dbe9
pypy: switch journal mode after upgrade (save it during the upgrade), to prevent errors like "database table is locked"
2016-05-20 15:12:32 +02:00
sebres
baafac36a4
ChangeLog entry
2016-05-20 14:51:13 +02:00
sebres
db9e724038
extremely speedup of all database operations:
...
- (synchronous = OFF) write data through OS without syncing
- (journal_mode = MEMORY) use memory for the transaction logging
2016-05-20 12:06:04 +02:00
sebres
34ae0b916e
Merge pull request #1421 from sebres/fix-1405
...
filter.d/common.conf: fixes unexpected extra regex-space in generic `__prefix_line` (gh-1405)
2016-05-20 11:20:34 +02:00
sebres
caecb2080b
Merge pull request #1435 from sebres/fix-1434
...
fixed --pidfile bug, introduced in gh-1322
2016-05-20 11:02:42 +02:00
sebres
932708de9e
fixed --pidfile bug, introduced in gh-1322:
...
gentoo-initd fixed --pidfile bug: `--pidfile` is option of start-stop-daemon, not argument of fail2ban (see gh-1434)
closes gh-1434
2016-05-20 11:01:00 +02:00
sebres
52377984cd
back to mandatory space, ungrouping of sub parameters in __prefix_line + small code review;
2016-05-19 17:57:48 +02:00
sebres
0fdc56546f
Fixed misunderstanding of port in (ban)action: port will be always specified in jail config ([DEFAULT] or jail)
2016-05-19 17:45:41 +02:00
Yaroslav Halchenko
1ebc3facb1
BF: maintain previous default beh for pf -- ban a port (ssh) only
2016-05-19 17:14:33 +02:00
sebres
4cdca8c258
amend-merge for pull request #1429 from sebres/0.10-freebsd-fix-pf
...
actiontype for PF action (all- and multi port)
2016-05-19 14:52:10 +02:00
sebres
4d51c591c1
pf.conf: warranted consistently echoing for the pf actiontype if actiontype or multiport tags will be customized;
2016-05-19 14:50:41 +02:00
Serg G. Brester
01d9a41ba1
Merge pull request #1429 from koeppea/0.10-freebsd-fix-pf
...
actiontype for PF action (all- and multi port)
2016-05-18 11:12:31 +02:00
Alexander Koeppe
b5e031f3c3
some documentation for multiport use in pf.conf
2016-05-17 21:32:21 +02:00
Serg G. Brester
482e1abe9c
Merge pull request #1431 from sebres/0.10-muti-option-groups
...
jailreader: support multiple option groups (brackets)
2016-05-17 21:17:12 +02:00
sebres
1e7fd26f5f
rename actionoptions to actiontype in pf-action (multiport) + fixed test cases
2016-05-17 20:51:12 +02:00
sebres
25af11215b
test case for generic common moved to ./fail2ban/tests/config/filter.d/zzz-generic-example.conf to prevent shipping it with fail2ban installations
2016-05-17 20:08:46 +02:00
Yaroslav Halchenko
af1cc41053
Merge pull request #1426 from koeppea/0.10-freebsd-fix-shebang
...
no hardcoded python interpreter path
2016-05-17 13:50:26 -04:00
Alexander Koeppe
e74047ae49
revert to common config for PF covering multi and allports
2016-05-17 18:19:40 +02:00
Alexander Koeppe
3e1328c83b
split PF config files between all- and multi port
2016-05-17 18:19:27 +02:00
sebres
c6f63c7263
jailreader: support multiple option groups, syntax action = act[p1=...][p2=...] + test case for it
...
(see gh-1425, gh-1429)
2016-05-17 18:06:46 +02:00
Alexander Koeppe
5e06e8be62
removed shebang and changed mode for fail2banregex.py
2016-05-17 16:42:23 +02:00
sebres
06dcad7650
fixed mixed indentation (spaces through tabs), duplicate code removed
2016-05-17 12:27:01 +02:00
Yaroslav Halchenko
d7ff7d18cd
RF+ENH: @with_kill_srv fixture to kill_srv in the tests
2016-05-17 12:26:58 +02:00
Yaroslav Halchenko
e57321ab1e
BF+ENH: import signal used in the code, withtmpdir -> with_tmpdir (more readable)
...
case shows how evil except Exception can be ;)
2016-05-17 12:26:56 +02:00
sebres
6353de8b0f
possibility to increase verbosity up to heavy debug (command line parameter -vvv)
2016-05-17 12:26:54 +02:00
sebres
cb4f9be8b2
the date brackets removed from filters using __prefix_line, because __prefix_line already contains the date ambit;
2016-05-17 11:55:02 +02:00
sebres
de813acf51
extends generic __prefix_line with optional brackets for the date ambit (gh-1421), added new parameter __date_ambit + test case added;
2016-05-17 11:54:43 +02:00
Alexander Koeppe
975608dfb6
no hardcoded python interpreter path
2016-05-15 21:08:32 +02:00
sebres
be3e95b76d
Merge branch '0.10-fwcmd-fix-test' into 0.10
2016-05-14 15:05:21 +02:00
sebres
0c44ecfc77
action.d/firewallcmd-ipset.conf: different name of the match set's for IPv4/IPv6, using conditional <ipmset>, analog to the iptables-ipset;
...
test cases for 3 firewallcmd extended;
2016-05-14 15:01:35 +02:00
Serg G. Brester
0d0e1853c4
Merge pull request #1424 from TorontoMedia/firewallcmd
...
ENH: Branch 0.10 - updated firewallcmd actions
2016-05-14 13:34:23 +02:00
Serg G. Brester
e0da359a5a
Merge pull request #1423 from yarikoptic/0.10
...
ENH: version Fail2Ban in this branch as 0.10.0 alpha 1
2016-05-14 13:26:23 +02:00
Serg G. Brester
d742bc2834
Merge pull request #1422 from sebres/0.10-fix-multi-set
...
0.10 fix multi-set and database binding parameters
2016-05-14 13:25:14 +02:00
TorontoMedia
ffebde68e0
Update firewallcmd-multiport.conf
2016-05-13 22:38:36 -04:00
TorontoMedia
07de83e04a
Update firewallcmd-common.conf
2016-05-13 22:38:10 -04:00
TorontoMedia
810d5996b5
Update firewallcmd-rich-logging.conf
2016-05-13 22:10:25 -04:00
TorontoMedia
7e54cee8d6
updated firewallcmd actions
2016-05-13 21:36:27 -04:00
Yaroslav Halchenko
2b6f8737a7
ENH: version Fail2Ban in this branch as 0.10.0 alpha 1
2016-05-13 17:17:46 -04:00
sebres
d420148055
database: always explicit convert ip to str, because may be an IPAddr, that will be unsupported type by bind parameter (as long as we've found any default wrapper handler for sqlite3)
2016-05-13 22:53:57 +02:00
sebres
cb280b817f
csocket multi-set fix: prevent to convert list, dict, set during transfer (send), this offers a sending of 'multi-set' arrays
...
(missed by cherry-picking from multi-set branch)
2016-05-13 22:43:02 +02:00
sebres
e0924e0d1b
test case fix (always sort result of DNSUtils.textToIp, because order of result from socket.getaddrinfo is undefined (system depended)
2016-05-13 21:44:07 +02:00
sebres
3e49522b7a
fixes unexpected extra regex-space in generic __prefix_line (gh-1405, misleadingly committed in d2a9537568);
...
all optional spaces normalized in generic include `common.conf` + test cases are extended (using new example pseudo-filter and test log `zzz-generic-example`);
2016-05-13 20:26:37 +02:00
Yaroslav Halchenko
d6eae28eb5
Merge pull request #1419 from sebres/gh-1417
...
fixes gh-1417 Grave tags substitution bug. [part. cherry-picked from 0.10]
2016-05-13 10:28:29 -04:00
sebres
cce63926ce
ChangeLog entry added
2016-05-13 16:11:38 +02:00
sebres
a4b8f6e49e
[part. cherry-picked from 0.10] invalid recursion check in substituteRecursiveTags: for example action bsd-ipfw produced ValueError('properties contain self referencing definitions and cannot be resolved...')
...
test cases extended for exactly this case;
closes gh-1417
2016-05-13 14:12:17 +02:00
sebres
3d3735706b
invalid recursion check in substituteRecursiveTags: for example action bsd-ipfw produced ValueError('properties contain self referencing definitions and cannot be resolved...')
...
test cases extended for exactly this case and for all stock actions;
closes gh-1417
2016-05-13 13:53:29 +02:00
Serg G. Brester
1791fd59f2
Merge pull request #1418 from yarikoptic/pr-1415
...
DOC: minor PEP8ing and comments enhancements
2016-05-13 12:49:35 +02:00
Yaroslav Halchenko
a9c563fed2
Merge pull request #1415 from sebres/0.10-fixes
...
0.10 fixes
2016-05-12 18:54:33 -04:00
Yaroslav Halchenko
14c31d8c58
DOC: minor PEP8ing and comments enhancements
2016-05-12 18:52:20 -04:00
sebres
ec6032d934
prevent to fail stock configs test case, if any jail custom config does not have own test log-file (perhaps not clean copy)
2016-05-12 18:15:22 +02:00
sebres
4b5b16cd9f
allow using of IPv6 address style mask (analog to the IPv4), for example: 2606:28ff::/ffff:ff80:: -> 2606:2880::/25
...
fast calculating of maskplen using map table MAP_ADDR2MASKPLEN, with pre-calculated addr->maskplen values;
test cases extended;
2016-05-12 18:15:05 +02:00
sebres
0c2eeee8c7
BF: fail2ban-client can't unserialize IPAddr objects - added IPAddr pickle-handler, that simple wrap IPAddr to the str
2016-05-12 12:54:25 +02:00
sebres
53956501da
increase readability and details level by increased verbosity
2016-05-12 11:53:12 +02:00
sebres
060ea085f4
reader bug fix: prevent to silent "load" of not existing jail;
...
coverage of test cases increased;
2016-05-12 11:52:08 +02:00
sebres
22576d7150
code review, timeout fix, better tracing (and test coverage) by start of server/client (with or without fork)
2016-05-12 11:52:05 +02:00
sebres
0b4143730d
some compatibility fixes (prevent forking of testcase-process, code review), wait 4 server ready, test cases fixed (py2/py3)
2016-05-12 11:52:02 +02:00
sebres
2fcb6358ff
several bug fixed: fork in client-server test cases prohibited, all worker threads daemonized (to prevent hanging on exit).
2016-05-12 11:51:59 +02:00
sebres
afa1cdc3ae
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-05-12 11:51:56 +02:00
sebres
5a053f4b74
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-05-12 11:51:53 +02:00
sebres
556ddaabd7
temporary commit (move client/server from bin)
2016-05-12 11:51:50 +02:00
sebres
4ce240ed40
try to start server in foreground
...
# Conflicts:
# fail2ban/server/server.py
2016-05-12 11:51:47 +02:00
sebres
bdc2d07946
fix suhosin_log in common paths - log files should be separated using "\n":
...
prevents to throw an error "File option must be 'head' or 'tail'", if jail suhosin will be enabled.
2016-05-11 18:49:04 +02:00
sebres
9b72522a01
todo fix: not necessary in 0.10 branch
2016-05-11 18:47:55 +02:00
sebres
3df97beaa6
changelog entries from sebres:f2b-perfom-prepare-716 (gh-1346)
2016-05-11 18:03:22 +02:00
sebres
c22ba5413d
changes from ipv6-support-0.10 after merge
2016-05-11 16:58:13 +02:00
sebres
f9ea845595
Merge branch 'ipv6-support-0.10' into 0.10
2016-05-11 16:57:16 +02:00
sebres
23ad50dbaa
correct <HOST> expression in failregex (now IPv6 will be really found from filter);
...
respect standard spelling of IPv6 (with port) enclosed in brackets ([ipv6]:port), to prevent the necessarily changing of many filter definitions, comparison:
#IPv4:
127.0.0.1:55555
#IPv6:
[a:b:c:d::1]:55555
some small fixes (in test cases also) and code review and few optimizations;
2016-05-11 16:55:29 +02:00
sebres
f47fdf8918
code coverage: extend conditional test with direct replacement inside replaceTag (besides recursive sub tags)
2016-05-11 16:55:26 +02:00
sebres
e8203dabba
python 2.6 compatible test cases
2016-05-11 16:55:24 +02:00
sebres
9da7bb1068
meantime commit: code review, simplification, pythonization, etc. (test cases passed)
2016-05-11 16:55:21 +02:00
Alexander Koeppe
50e5a7e538
More beautifier tests
2016-05-11 16:55:17 +02:00
sebres
d65e37e93d
CIDR splitting functionality moved from filter to IPAddr;
...
meantime commit: code review, simplification, pythonization, etc. + test cases extended
2016-05-11 16:54:36 +02:00
Alexander Koeppe
1b21f21c22
CIDR represenation if IPAddr object is a network prefix
2016-05-11 16:54:33 +02:00
sebres
941a2b6c82
clean up unnecessarily resp. directly unused action properties, because they are ambiguous now;
...
implemented caching functionality for same substitutions inside replaceTag: very actual and extreme performance growth (up to 1000 times) for ban/unban because too slow substituteRecursiveTags by several tags and many includes, but totally unnecessary as long as parameters are not changing;
2016-05-11 16:54:31 +02:00
sebres
504e5ba6f2
actions support IPv6 now:
...
- introduced "conditional" sections, see for example `[Init?family=inet6]`;
- iptables-common and other iptables config(s) made IPv6 capable;
- several small code optimizations;
* all test cases passed (py3.x compatible);
2016-05-11 16:54:28 +02:00
sebres
75028585c0
test cases extended for verifying ipv4/ipv6, normalized pf-action with test case
2016-05-11 16:54:25 +02:00
Alexander Koeppe
ed2f3ef77d
improve PF action and make IPv6 aware
2016-05-11 16:54:22 +02:00
sebres
1a6450643d
partially cherry pick from branch 'multi-set', prepare for conditional config parameters logic:
...
- new readers logic (group some by multiple parameters 'set' -> 'multi-set';
- prevent to add 'known/' parameters twice (by merge section etc);
- test cases fixed;
# Conflicts:
# fail2ban/client/actionreader.py
2016-05-11 16:54:20 +02:00
sebres
43c0f3cdc4
test cases extended
2016-05-11 16:54:17 +02:00
sebres
2497b05abc
test cases preliminary extended;
2016-05-11 16:54:14 +02:00
sebres
25d6cf8dd2
fix suhosin_log in common paths - log files should be separated using "\n":
...
prevents to throw an error "File option must be 'head' or 'tail'", if jail suhosin will be enabled.
2016-05-11 16:54:11 +02:00
sebres
9b06c325e1
2nd wave: code review, simplification, pythonization, etc. (test cases passed)
2016-05-11 16:53:26 +02:00
Yaroslav Halchenko
c1a54974e9
RF/ENH: 1st wave of IPAddr pythonization - properties, logical statements, etc
...
# Conflicts:
# fail2ban/server/ipdns.py
2016-05-11 16:48:42 +02:00
Yaroslav Halchenko
5040c95bdb
DOC: stub for 0.10.0 release changelog
2016-05-10 21:17:09 -04:00
Alexander Koeppe
dbd7e347b1
new testcase to test beautifier code
2016-05-09 17:08:35 +02:00
Alexander Koeppe
4274ae89c6
Quite little adjustments on tests and return value
...
# Conflicts:
# fail2ban/server/ipdns.py
2016-05-09 17:07:53 +02:00
sebres
8cb4a3f59e
move DNTUtils, IPAddr related code to dedicated source file ipdns.py (also resolves some cyclic import references)
2016-05-09 17:06:25 +02:00
sebres
6985531e91
meantime commit: code review, simplification, pythonization, etc. (test cases passed)
2016-05-09 16:35:48 +02:00
Alexander Koeppe
9ede535a61
remove obsolete IP related code from DNSUtils class
...
# Conflicts:
# fail2ban/server/filter.py
2016-05-09 15:36:15 +02:00
Alexander Koeppe
ce196744d1
Update ChangeLog / THANKS entries
2016-05-09 15:34:15 +02:00
Alexander Koeppe
db9f3f738f
add ip6-loopback to default ignoreip statement
2016-05-09 15:32:42 +02:00
Alexander Koeppe
d125f882d4
explicitely treat join arguments as string in beautifier
2016-05-09 15:29:05 +02:00
sebres
afe1f73af2
meantime commit: code review, simplification, pythonization, etc. (test cases passed)
...
unnecessarily code aggravation with explicit converting reverted - implicit converting inside internal functions if not IPAddr object;
2016-05-09 15:28:21 +02:00
Alexander Koeppe
85b895178b
change IP address string to object handling part 1
...
# Conflicts:
# fail2ban/server/filter.py
2016-05-04 14:07:12 +02:00
sebres
07c9f38e45
meantime commit: code review, simplification, pythonization, etc. (test cases passed)
2016-05-04 14:02:03 +02:00
Alexander Koeppe
a757037671
Make DNS resolution IP address family idependent
2016-05-04 13:51:15 +02:00
sebres
3893a6b780
meantime commit: code review, simplification, pythonization, etc.
2016-05-04 13:50:37 +02:00
Alexander Koeppe
a093828602
Make ignoreip checking address family idependent
2016-05-04 12:53:56 +02:00
sebres
1308744348
meantime commit: code review, simplification, pythonization, etc.
2016-05-04 12:53:34 +02:00
Alexander Koeppe
01e1383c9b
New class IPAddr for handling IPv4 and IPv6 addresses
2016-05-04 12:21:48 +02:00
sebres
05f38285f1
Merge remote-tracking branch 'remotes/gh-upstream/master' into f2b-perfom-prepare-716
2016-05-02 15:40:05 +02:00
Alexey Korepanov
5773eb71b8
ensure /var/run/fail2ban is created in systemd service file
2016-04-12 21:20:19 +01:00
sebres
74b88e1706
fix sporadic bugs by starting of fast actions (execute fast sub processes), cherry picked from "f2b-perfom-prepare-716-cs":
...
- missing `popen` variable if not started;
- better readability for stdout and stderr in log (+ check log level before do logging);
2016-03-10 15:10:26 +01:00
sebres
01b379ab2e
fix sporadic bugs within asyncserver, cherry picked from "f2b-perfom-prepare-716-cs":
...
- differentiate between in loop and active (reset active only after really leaves a loop);
- differentiate between foreign and self loop-thread by stop/close connection;
- stops logging connection errors if too many errors;
- safe remove socket (no sporadic errors if too fast start/stop occurred);
2016-03-10 15:09:54 +01:00
Yaroslav Halchenko
deca0b80ab
ENH: removed double tab indentation, pass use_poll into loop, reorderd log msg to come after action to be factually correct
2016-03-09 22:22:29 -05:00
Yaroslav Halchenko
c84b6370c5
ENH: remove some code duplication, enhance docstrings, uniformize naming
2016-03-09 22:22:29 -05:00
Yaroslav Halchenko
7eafb0c206
ENH: avoid subclassing dict (in favor of delegating) if not entire interface is used/adjusted
...
since otherwise use of dict"s __getitem__ could lead to undesired effects etc
2016-03-09 22:22:29 -05:00
sebres
d7e7b52013
Merge remote-tracking branch 'remotes/gh-upstream/master' into f2b-perfom-prepare-716
2016-03-07 19:11:36 +01:00
sebres
dca3db941e
merge getTime2 functionality to getTime
2016-03-07 17:28:37 +01:00
sebres
134c33cc6d
fail2ban-testcases: added option "--ignore": negate [regexps] filter, to ignore tests matched specified regexps
2015-12-29 19:00:51 +01:00
sebres
8eca2ecd84
optimized version of "str2seconds" with pre-compiled regexp;
2015-12-29 19:00:49 +01:00
sebres
da51fbf9c6
code review and performance optimization:
...
- default date templates cache + regexp compiling on the fly (if required);
- better usage of shared config over all test cases;
- obsolete test cases removed (simple test of memleak/gc);
- skip some slow test cases in fast mode (setup test, etc.);
2015-12-29 12:49:53 +01:00
sebres
3f2b58e973
datedetector: matchTime, template list etc. rewritten because of performance degradation (without sorting templates now) - in-place reordering using hits and last used time;
...
todo: rewrite "reGroupDictStrptime" because may be too slow;
2015-12-29 12:49:51 +01:00
sebres
e065941ac5
use "maxEntries" (currently 50 as default) as range for max number of the last matches/failures, fail2ban will hold per IP in the list of failures in failmanager resp. in the database;
...
prevents out of memory situation if many IP's makes extremely many failures (or very large files since last fail2ban run);
closes gh-1277
todo: parameter `maxentries` should be configurable (jail.conf resp. fail2ban.conf);
todo: adjust ban-time-incr branch by merge (table "bips").
2015-12-29 12:49:48 +01:00
sebres
935d79eaae
1) prevents a bug by logging stdout/stderr if retcode still None:
...
```
in executeCmd
if retcode < 0:
TypeError: unorderable types: NoneType() < int()
```
2) prevents a rarely test case bug of testExecuteTimeoutWithNastyChildren, because no stdout (Resource temporarily unavailable), possible no flush by IO of the killing process;
2015-12-29 12:49:46 +01:00
sebres
6406f6f560
background servicing (temporally executed from failmanager): prevents memory leak on some platforms/python versions, using forced GC in periodic intervals (latency and threshold);
...
Side effect: GC is disabled now inside fail2ban-server (to avoid multiple garbage collect)
2015-12-29 12:49:44 +01:00
sebres
a10eb39bbe
test cases extended with memory leakage check
2015-12-29 12:49:41 +01:00
sebres
f7cc55103c
optimized FailManager: increase performance, try to prevent memory leakage (don't copy failures resp. it list on some operations)
2015-12-29 12:49:39 +01:00
sebres
f143ae479c
code and config review after rebase to current master
2015-12-29 12:49:37 +01:00
sebres
72f29e9061
asyncserver (asyncore) code fixed and test cases repaired (always delete temp files, wait for end of thread/server, etc)
...
definitely closes gh-161, also other usage of asyncore event loop (in test_smtp.py)
repair cache in ipToName (can returns None), precaching of invalid IPs (according to RFC 5737) to stop endless wait for resolving it in test cases.
2015-12-29 12:49:34 +01:00
sebres
770c219ab6
SetupTest should run at version of python currently installed (resp. active one), skip if started with another version.
2015-12-29 12:49:32 +01:00
sebres
cf3cf27fa3
- filtering of test cases extended for method additionally to class (matches method only not whole class for regexp matched method name);
...
- new options for "fail2ban-testcases" introduced: "-g" or "--no-gamin" and "-m" or "--memory-db", both are true also if "-f" or "--fast" specified,
for example: `fail2ban-testcases -ngm` will runs faster (because no network, no gamin, memory database)
but will use the same default sleep intervals as in production (in comparison to -nf);
- seekToTime rewritten, accuracy increased by seekToTime, extended for all FileFilter (PyInotify, Gamin also), test cases extended etc.
- common performance optimized and code reviewed;
2015-12-29 12:49:30 +01:00
sebres
6faffe3201
test cases extended, code review (+ python 3.x compatibility);
...
database test cases extended - enable deleted (disabled) jail in addJail;
2015-12-29 12:49:27 +01:00
Yaroslav Halchenko
0e61b7586a
RF: use descriptive loop variable (oldticket) and matching associated variable suffixes (old)
2015-12-29 12:49:26 +01:00
Yaroslav Halchenko
e2a68bb02d
RF: make Jail new style class, avoiding multiple inheritance with object
2015-12-29 12:49:24 +01:00
Yaroslav Halchenko
78eb4d95eb
RF: is_alive -> isAlive to stay consistent in camelCasing
2015-12-29 12:49:21 +01:00
sebres
59bf5013c0
- performance of fail2ban optimized
...
-- cache dnsToIp, ipToName to prevent long wait during retrieving of ip/name for wrong dns or lazy dns-system;
-- instead of simple "sleep" used conditional wait "wait_for", that internal increases sleep interval up to sleeptime;
-- ticket / banmanager / failmanager modules are performance optimized;
-- api of filter (log files), jail, etc. rewritten and extended for performance purposes;
- performance of test cases optimized:
-- added option "--fast" to decrease wait intervals, avoid passive waiting, and skip few very slow test cases;
- code review after partially cherry pick of branch 'ban-time-incr' (see gh-716)
-- ticket module prepared to easy merge with newest version of 'ban-time-incr', now additionally holds banTime, banCount and json-data;
-- executeCmd partially moved from action to new module utils, etc.
-- python 2.6 compatibility;
- testExecuteTimeoutWithNastyChildren: test case repaired - wait for pid file inside bash, kill tree in any case (gh-1155);
- testSocket: test case repaired - wait for server thread starts a socket (listener)
2015-12-29 12:49:19 +01:00
sebres
3540619a73
code review, test case extended;
2015-12-29 12:49:17 +01:00
sebres
d23d103f96
code review and few new test cases
2015-12-29 12:49:15 +01:00
sebres
db5ee0842a
increase code coverage
2015-12-29 12:49:13 +01:00
sebres
d22b2498d4
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;
2015-12-29 12:49:10 +01:00
sebres
dad4234beb
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.
2015-12-29 12:49:08 +01:00
sebres
410f9d7c10
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;
2015-12-29 12:49:06 +01:00
sebres
42199957d0
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 ):
...
now polling backend only (currently not implemented for gamin and pyinotify backends);
python3/pypy compatibility fix + removing obsolete code
2015-12-29 12:48:15 +01:00
sebres
3cfdc5ecb3
test cases extended;
...
code review
2015-12-29 12:48:14 +01:00
sebres
a3e0cc9830
introduced string to seconds (str2seconds) for configuration entries with time;
...
todo: expands it for all time config entries;
2015-12-29 12:48:11 +01:00