Compare commits

...
3219 Commits
Author SHA1 Message Date
sebres 07adcc1cc9 merge-point for 0.11.1 2020-11-20 17:23:15 +01:00
sebres b37cbf9c29 don't error on clean-up of missing files 2020-11-20 16:58:20 +01:00
sebres 5f2464a9d1 debian\rules: better clean-up of non-debian paths includes 2020-11-20 15:25:42 +01:00
Ondřej Nový acb11a6da9 d/watch: Use https protocol 2020-09-24 08:42:58 +02:00
Ondřej Nový f91ee67e7a d/control: Update Vcs-* fields with new Debian Python Team Salsa layout 2020-09-24 08:42:58 +02:00
Ondřej Nový 12e055b19f d/control: Update Maintainer field with new Debian Python Team contact address 2020-09-24 08:42:58 +02:00
Ondřej Nový cab66065dd Use debhelper-compat instead of debian/compat 2020-09-24 08:42:58 +02:00
Sylvestre Ledru 0fe7250f6f remove deprecated package dh-systemd from the build deps (Closes: #958625) 2020-04-23 23:07:02 +02:00
Sylvestre Ledru 2d1b4a1e23 prepare upload 2020-04-16 10:08:05 +02:00
Sylvestre Ledru d2efa29f6e add the roundcube modif 2020-04-16 10:01:37 +02:00
Sylvestre Ledru a98e6cdd4d Add Environment="PYTHONNOUSERSITE=yes" to the service file to avoid fail2ban to read /root/.local/. Thanks to Russell Coker for the investigation (Closes: #956177) 2020-04-16 09:23:28 +02:00
Sylvestre Ledru d68fb00628 Do not rotate log if empty. Thanks to Ron Varburg for the patch (Closes: #956681) 2020-04-14 11:44:33 +02:00
Ron Varburg 1e1f10e293 Do not run logrotate if the log is empty 2020-04-14 11:43:45 +02:00
Sylvestre Ledru a5ffa9a2b1 has been uploaded 2020-04-09 10:52:16 +02:00
Jelmer Vernooij eebb39d0c5 Merge branch 'patch-1' into 'master'
Don't ban roundcube users when an external mail server is down.

See merge request python-team/applications/fail2ban!2
2020-04-08 18:52:06 +00:00
Jesse Norell 5d0d5a68c5 Don't ban roundcube users when an external mail server is down. 2020-04-06 21:57:27 +00:00
Jelmer Vernooij 4e7a7cef32 Merge branch 'lintian-fixes' into 'master'
Fix day-of-week for changelog entry 0

See merge request python-team/applications/fail2ban!1
2020-04-01 21:20:00 +00:00
Debian Janitor 6075e9546a Fix day-of-week for changelog entry 0.5.4-2.
Fixes: lintian: debian-changelog-has-wrong-day-of-week
See-also: https://lintian.debian.org/tags/debian-changelog-has-wrong-day-of-week.html
2020-03-29 17:33:07 +00:00
Sylvestre Ledru 4477393c41 Fix package-installs-into-obsolete-dir Install bash_completion script in usr/share/bash-completion/completions 2020-02-17 11:53:12 +01:00
Sylvestre Ledru c2961f750b add the bug 2020-02-17 11:43:52 +01:00
Sylvestre Ledru 966c39af4c prepare upload 2020-02-17 11:42:04 +01:00
Sylvestre Ledru b523bdc081 prepare upload 2020-01-23 10:42:26 +01:00
Sylvestre Ledru 243a5e18bc Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, Repository-Browse.
Fixes: lintian: upstream-metadata-file-is-missing
See-also: https://lintian.debian.org/tags/upstream-metadata-file-is-missing.html
2020-01-23 10:40:45 +01:00
Sylvestre Ledru abc55dfb84 Remove patches neurodebian-backport.series, neurodebian_use_python2, saucy-dsc-patch, trusty-dsc-patch, utopic-dsc-patch, wheezy-dsc-patch that are missing from debian/patches/series.
Fixes: lintian: patch-file-present-but-not-mentioned-in-series
See-also: https://lintian.debian.org/tags/patch-file-present-but-not-mentioned-in-series.html
2020-01-23 10:40:40 +01:00
Sylvestre Ledru 55eecea185 Trim trailing whitespace.
Fixes: lintian: file-contains-trailing-whitespace
See-also: https://lintian.debian.org/tags/file-contains-trailing-whitespace.html
2020-01-23 10:40:37 +01:00
Sylvestre Ledru 73a62c69ef nftables is now more important than iptables. Update of the priority and doc 2020-01-23 10:40:05 +01:00
Sylvestre Ledru d7e3fc079f remove qmail from the desc 2020-01-23 10:38:30 +01:00
Sylvestre Ledru 1e9295776f Add myself to the uploaders 2020-01-23 10:38:10 +01:00
Sylvestre Ledru 757e2afee6 Run the testsuite for real 2020-01-13 11:09:28 +01:00
Sylvestre Ledru 60e7fb8a14 experimental version 2020-01-13 00:09:50 +01:00
Sylvestre Ledru 63e92bf1dd upload to exp 2020-01-13 00:08:53 +01:00
Sylvestre Ledru e9a4ddc4e3 Update to SV: 4.4.1 2020-01-12 23:55:20 +01:00
Sylvestre Ledru 4ec15b0572 Remove old patches 2020-01-12 23:54:37 +01:00
Sylvestre Ledru 1e472b23bc Run ./fail2ban-2to3 as part of the build to be Python 3 ready 2020-01-12 23:53:14 +01:00
Sylvestre Ledru ac93287f9d fix the exec of the testsuite 2020-01-12 23:40:37 +01:00
Sylvestre Ledru 1ab9964213 Remove the old dep to Python (Cloes: #945670) 2020-01-12 23:33:37 +01:00
Sylvestre Ledru 592e59ad97 rebase of the patches with the new upstream release 2020-01-12 23:31:42 +01:00
Sylvestre Ledru 5cbc262406 * New upstream release (Closes: #922539)
* Use secure URI in Vcs control header.
2020-01-12 23:24:10 +01:00
Sylvestre Ledru ad3e0d97c4 New upstream version 0.11.1 2020-01-12 23:22:54 +01:00
Sylvestre Ledru dcb9340599 fix some typos 2020-01-12 23:16:15 +01:00
Sylvestre Ledru 1f48e55959 Import fail2ban in the Debian Python Umbrella (Closes: #947926) 2020-01-12 23:15:11 +01:00
Sylvestre Ledru 93d4c018f4 Merge remote-tracking branch 'origin/debian' 2020-01-12 23:12:02 +01:00
sebres d004a2c79b release 0.11.1 -- This is the Way 2020-01-11 11:01:00 +01:00
sebres 27fb4790fb Merge branch '0.10' into 0.11 2020-01-10 15:17:54 +01:00
sebres b25d8565fc release 0.10.5 -- Deserve more respect a jedi's weapon must. Hrrrm, Yes 2020-01-10 13:34:46 +01:00
sebres 4e4bd43e5e small amend for d1b7e2b5fb: double usage string removed, spacing fixed
generate-man: small fixing (avoid ../bin in usage, version fix
2020-01-10 13:28:20 +01:00
sebres 4860d69909 Merge branch '0.10' into 0.11 2020-01-09 20:55:00 +01:00
sebres f77398c49d filter.d/sshd.conf: captures Disconnected from ... [preauth], preauth phase only, different handling by extra (with supplied user only) and ddos/aggressive mode (normal mode is not affected, used there just as a helper with <F-NOFAIL> to capture IP for multiline failures without IP);
closes gh-2115, gh-2362.
2020-01-09 20:53:53 +01:00
sebres d1b7e2b5fb fail2ban-regex - several enhancements and fixes:
- improved usage output (don't put a long help if an error occurs);
- new option `--no-check-all` to avoid check of all regex's (first matched only);
- new option `-o`, `--out` to set token provided in output (disables check-all and outputs only expected data);
- test cases optimized and extended
2020-01-09 16:59:13 +01:00
sebres dbc6590589 usage of failure-ID tag <F-ID>...</F-ID> causes raw handling automatically (avoid DNS-resolve for found ID) 2020-01-08 22:07:33 +01:00
sebres ac41b8f3be some logging level got changed between 0.10/0.11 (9 is lowest log level to capture messages in LogCaptureTestCase now) 2020-01-08 21:43:27 +01:00
sebres 587e4ff573 Merge branch '0.10' into 0.11
(conflicts resolved)
2020-01-08 21:27:23 +01:00
Sergey G. Brester a15832e773 Merge pull request #2588 from sebres/0.10-invariant-improve
0.10 auto-reban, improved invariant check and conditional operations
2020-01-08 21:04:42 +01:00
sebres f30b7ae244 update ChangeLog + spelling 2020-01-08 21:03:00 +01:00
sebres 17a34b1528 amend with missing parameter of actionreban in actionreader and coverage 2020-01-07 22:01:11 +01:00
sebres f001f8de2a automatic reban (repeat banning action) after repair/restore sane environment, if already logged ticket causes new failures (part of #980, closes #1680);
introduces banning epoch for actions and tickets (to distinguish or recognize removed set of tickets)
2020-01-07 21:28:32 +01:00
sebres 1a9bc1905d auto-detection of IPv6 subsystem availability (important for not on-demand actions or jails, like pass2allow) 2020-01-07 17:01:47 +01:00
sebres 125da61bda more cases covered, start in repair distinguish operations, on demand flag etc 2020-01-07 15:50:54 +01:00
sebres b7fe33483a coverage 2020-01-07 11:54:21 +01:00
sebres a527fbcae5 small amend: if not on-demand, the families should be specified (or default), also avoids error "dictionary changed size during iteration" 2020-01-06 21:44:19 +01:00
sebres 67fd75c88e pass2allow-ftp: inverted handling - action should prohibit access per default for any IP, so reset start on demand parameter for this action (will be started immediately). 2020-01-06 21:13:40 +01:00
sebres 165b7d6643 tests fixed, prepared for other conditional operations (for subnet usage), operations like repair/flush/stop considering started families (executed for started only) 2020-01-06 21:02:57 +01:00
sebres 3c42c7b9ef **not ready** testActionsConsistencyCheck fixed, but several **broken** tests (todo: fix public interface like action.start()/stop()). 2020-01-06 21:02:56 +01:00
sebres 31b8d91ba2 **not ready** amend with more tests (some issue on stop?) 2019-12-27 21:58:06 +01:00
sebres 8f6ba15325 avoid unhandled exception during flush, better invariant check (and repair), avoid repair by unban/stop etc... 2019-12-27 21:30:41 +01:00
Sergey G. Brester 690a0050f0 Merge pull request #2567 from Mart124/bitwarden
New jail, Bitwarden
2019-12-13 18:31:21 +01:00
sebres 5dd85bf4f8 Merge branch '0.10' into 0.11 2019-12-12 21:45:50 +01:00
sebres 7e98073014 amend to f3dbc9dda1: don't need truncate (if the name with \0 exceeds 16 bytes, the string is silently truncated by prctl). 2019-12-12 21:45:09 +01:00
sebres b2e8d610a0 small amend: adjust name of observer thread (more similar to other threads) 2019-12-12 21:31:26 +01:00
sebres 1bcb39c699 Merge branch '0.10' into 0.11 2019-12-12 21:29:13 +01:00
sebres f3dbc9dda1 set real thread names (used for identification and diagnostic purposes, e. g. top -H, ps -e -T, pstree, etc) 2019-12-12 21:28:16 +01:00
Mart124 e763c657c4 Let's get back to WRN 2019-11-27 00:32:10 +01:00
Mart124 566cbcdde0 Update bitwarden 2019-11-27 00:14:18 +01:00
Mart124 d7b707b09d Update bitwarden.conf 2019-11-27 00:09:22 +01:00
Mart124 869327e9b1 Update bitwarden.conf 2019-11-25 22:17:58 +01:00
Mart124 79caeaa520 Create bitwarden.conf 2019-11-25 22:05:29 +01:00
Mart124 30e742a849 Update jail.conf 2019-11-25 21:57:41 +01:00
Mart124 ef394b3cf0 Update jail.conf 2019-11-25 21:55:45 +01:00
Mart124 a3df1ab3f0 Create bitwarden 2019-11-25 21:50:16 +01:00
sebres 24d1ea9aa2 Merge branch '0.10' into 0.11 2019-11-25 01:58:55 +01:00
sebres d5144e380e filter: testing proper handling after time-drift or time-jump (DST-hole, NTP time correction backwards, etc), gh-2566 2019-11-25 01:46:07 +01:00
Sergey G. Brester e4c2f303bd Merge pull request #2550 from CPbN/centreonjail
Add Centreon jail
2019-11-15 01:53:20 +01:00
Sergey G. Brester 596c5cee7e Merge pull request #2560 from sebres/gh-927-subnet
subnet implementation (filter, parsing tags)
2019-11-15 01:48:30 +01:00
Sergey G. Brester e86e9b2ee9 Merge branch '0.10' into gh-927-subnet 2019-11-15 01:47:50 +01:00
Sergey G. Brester 9d263edfbb Merge pull request #2563 from hvanmegen/patch-1
Updated sendmail-auth.conf for longer mail IDs
2019-11-15 01:41:13 +01:00
sebres 27e6b0021c ChangeLog update gh-2563 2019-11-08 13:18:57 +01:00
sebres 0e8a8edb5e filter.d/sendmail-*.conf: both filters have same __prefix_line now (and same RE for ID, 14-20 chars long, optional) + adjusted test cases (gh-2563) 2019-11-08 13:15:40 +01:00
Henry van Megen a9200c5456 Added logline that fails at IDs with 15 chars (see gh-2563) 2019-11-08 12:43:02 +01:00
Henry van Megen 548e2e0054 sendmail-auth.conf: filter updated for longer mail IDs (up to 20, see gh-2562) 2019-11-08 12:42:09 +01:00
sebres 5cf064a112 monit: accepting both logpath's: monit and monit.log, closes gh-2495 2019-11-04 12:18:12 +01:00
sebres e5d02bc2e9 grouped tags (<ADDR>, <HOST>, <SUBNET>) recognize IP addresses enclosed in square brackets, closes gh-2494 2019-11-04 12:11:00 +01:00
sebres d44607a161 part of #927 - filter enhancement to parse IP sub-nets (IP/CIDR with correct recognition of IP-family),
provides new replacement tags for failregex to match subnets in form of IP-addresses with CIDR mask (gh-2559):
  - `<CIDR>` - helper regex to match CIDR (simple integer form of net-mask);
  - `<SUBNET>` - regex to match sub-net adresses (in form of IP/CIDR, also single IP is matched, so part /CIDR is optional);
2019-11-01 16:29:17 +01:00
CPbN 9e699646f8 Add Centreon jail 2019-10-24 14:37:18 +02:00
CPbN 18ba714f97 Add Centreon jail 2019-10-23 09:14:26 +02:00
sebres 3515d06979 Merge branch '0.10' into 0.11 2019-10-18 19:19:21 +02:00
sebres 5e3fef1631 Merge branch 'amend-gh-2254' into 0.10 2019-10-18 19:06:42 +02:00
sebres 85ec605358 nftables: amend to gh-2254 - implemented shutdown of action (proper clean-up) - at stop it checks now the last set was deleted and removes table completely (if table does not contain any set);
this is avoided if some sets were added manually or can be avoided via overwriting of parameter `_nft_shutdown_table`, for example:
banaction = nftables[_nft_shutdown_table=''][...]
2019-10-18 19:01:16 +02:00
sebres 51af193402 nftables: add options allowing to specify own table (default f2b-table) and chain (default f2b-chain) 2019-10-18 18:54:02 +02:00
sebres 955d690e56 regrouping expressions with curly braces, added more escapes (better handling in posix shell) 2019-10-18 18:34:48 +02:00
sebres 0824ad0d73 Merge branch '0.10' into 0.11 2019-10-18 12:04:38 +02:00
Sergey G. Brester 8b850864cf amend to #2254: update changelog 2019-10-18 12:00:17 +02:00
Sergey G. Brester 54298fe761 Merge pull request #2254
Nftables: isolate fail2ban rules into a dedicated table and chain
2019-10-18 11:43:38 +02:00
sebres d1a73d3004 filter.d/apache-auth.conf:
- ignore errors from mod_evasive in `normal` mode (mode-controlled now) (gh-2548);
  - extended with option `mode` - `normal` (default) and `aggressive`
close gh-2548
2019-10-18 11:26:19 +02:00
sebres 8c6a547215 Merge branch '0.10' into 0.11 2019-10-11 03:01:46 +02:00
sebres 50595b70fd filter.d/mysqld-auth.conf: ISO timestamp format (dual time) within log message
(https://serverfault.com/questions/982126/fail2ban-fails-to-recognize-ip)
2019-10-11 01:31:07 +02:00
sebres 9e28b6c65f filter.d/asterisk.conf: relaxing protocol RE-part before IP in RemoteAddress (gh-2531) 2019-09-26 21:46:26 +02:00
sebres 8ea00c1d5d fixed mistake in config (semicolon after space as comment in configs?) and coverage, suppress errors by unsupported flush, better space handling in helper _nft_get_handle_id, etc 2019-09-25 13:47:29 +02:00
sebres 492205d30e action.d/nftables.conf: implemented actionflush (allows flushing nftables sets resp. fast unban of all jail tickets at all) 2019-09-24 20:00:29 +02:00
sebres abc4d9fe37 allow to use multiple protocols in multiport (single set with multiple rules in chain):
`banaction = nftables[type=multiport]` with `protocol="tcp,udp,sctp"` in jail replace 3 separate actions.
more robust if deleting multiple references to set (rules in chain)
2019-09-24 19:44:59 +02:00
sebres c753ffb11d combine nftables actions to single action:
- nftables-common is removed
- nftables-allports  is obsolete, replaced by nftables[type=allports]
- nftables-multiport is obsolete, replaced by nftables[type=multiport]
2019-09-24 18:53:38 +02:00
sebres c59d49da22 nftables-allports: support multiple protocols in single rule;
tests/servertestcase.py: added coverage for nftables actions
2019-09-24 18:46:41 +02:00
Ririsoft dde51b4682 fix actionban/unban ip definition syntax 2019-09-24 13:01:14 +02:00
Monson Shao 1cda50ce05 Rewrite nftables variables based on nftables' logic.
Add an example for redirecting.
2019-09-24 13:01:13 +02:00
sebres f51712d275 Merge branch '0.10' into 0.11 2019-09-11 19:41:30 +02:00
sebres 82ddaa5771 fix order of jail options in stream:
* be sure usedns is before all regex(s) in stream (this option is also allowed in the config of filter now)
  * logpath after all log-related data (backend, date-pattern, etc)
2019-09-11 19:38:42 +02:00
sebres 990c410877 Merge branch '0.10' into 0.11
# Conflicts (resolved):
#	fail2ban/client/jailreader.py
2019-09-11 16:18:09 +02:00
sebres 7b3ee3dadc allow to set all standard options of filter (like prefregex, journalmatch, etc) directly in jail (without filter or supplying parameters to filter);
normalize stream generation of filter-related parameters across FilterReader and JailReader (uses stream generator of filter now);
test cases extended (testOverrideFilterOptInJail) to cover this possibility.
2019-09-11 16:14:46 +02:00
sebres a36b70c7b5 filter.d/znc-adminlog.conf: support logging format of systemd-journal, bypass port after address (optional, removed end-anchor, see gh-2520) 2019-09-10 21:02:26 +02:00
sebres fbd4bfc595 extend murmur test cases to cover systemd journal log-format (gh-2520, note we don't use any time-stamp as systemd-backend does not expect it) 2019-09-10 19:46:44 +02:00
sebres 822f8adb6a Merge branch '0.10' into 0.11 2019-08-22 21:33:58 +02:00
sebres e547927075 tests: extend server test cases for some stock jails (e. g. check issue with sendmail filters gh-2493 + covering maxmatches / dbmaxmatches in server tests) 2019-08-22 21:29:46 +02:00
sebres 65da15327e curtail some bothering continuously repeatable debug messages of filters (backend-related) to level 4 (below extra heavy-debug, so simplifying debugging and testing with level 5) 2019-08-22 21:17:45 +02:00
sebres 16b3993be6 actions: improve conditional execution of some operations, also allow to start action on demand (by first ban if actionstart_on_demand enabled) for non-conditional actions (backwards compatible, so actionstart_on_demand is on per default only for the actions having family-conditional sections);
small bug fixing (stop/flush/restore env etc) and code simplification.
2019-08-22 21:05:38 +02:00
sebres 6b7825b8c8 closes gh-2506: don't increase attempt count if bantime.increment is not enabled for the jail 2019-08-22 14:11:08 +02:00
sebres 15734a923b Merge branch '0.10' into 0.11 2019-07-29 14:25:19 +02:00
sebres 39d9133baa amend to 7520d250b0 (#2444): don't use default flags (SYSTEM) if journalfiles are specified (similar journalflags set to 0);
fix failure of testJournalFilesArg and cover both cases now.
2019-07-29 14:23:53 +02:00
sebres 1cdd618232 Merge branch '0.10' into 0.11 2019-07-29 13:26:37 +02:00
sebres 5d5253dd70 Merge branch '0.10' into 0.11 2019-07-29 13:25:49 +02:00
sebres 19052d9789 * Merge pull request #2406 from JoeHorn/0.11
support bind-9.11.0 log format
2019-07-29 13:23:25 +02:00
sebres 91923b5c07 don't need to match identifier exactly (@ is precise enough as prefix), not capturing group;
`prefregex` extended, more selective now (denied/NOTAUTH suffix moved from `failregex`, so no catch-all there anymore);
update ChangeLog
2019-07-29 13:21:00 +02:00
Sergey G. Brester 5a3859c163 Update named-refused 2019-07-29 13:06:51 +02:00
Joe Horn 4395469226 Update named-refused.conf
Log format changed since ver. 9.11.0
Ref. ftp://ftp.isc.org/isc/bind9/9.11.0/RELEASE-NOTES-bind-9.11.0.html
"The logging format used for querylog has been altered. It now includes an additional field indicating the address in memory of the client object processing the query."
2019-07-29 13:06:49 +02:00
Sergey G. Brester a395361de8 Merge pull request #2467 from sebres/logtype-option-rfc5424
New option `logtype` value - `rfc5424`
2019-07-24 00:02:04 +02:00
Sergey G. Brester 70280bfa12 Update ChangeLog 2019-07-24 00:00:24 +02:00
sebres 581f13c2db Merge branch '0.10' into 0.11 2019-07-22 19:07:15 +02:00
Sergey G. Brester d3b5befe44 update changelog (#2404) 2019-07-22 12:50:48 +02:00
Sergey G. Brester 0dfd4f1f41 Merge pull request #2404 from benrubson/badprotocol
filter.d/sshd.conf: matches "Bad protocol version identification" in ddos and aggressive modes.
2019-07-22 12:47:39 +02:00
Sergey G. Brester eb308d0fc8 add test for injection on version identification 2019-07-22 11:50:01 +02:00
Sergey G. Brester 119401fced Merge pull request #2452 from benrubson/badips
Badips key is only used to retrieve list
2019-07-20 12:08:22 +02:00
Ben RUBSON a98315386d Update zzz-sshd-obsolete-multiline.conf 2019-07-19 17:59:16 +02:00
Sergey G. Brester d5a5efcd5a amend to #2174 for fail2ban.service, fix legacy path, closes gh-2474 2019-07-17 13:38:42 +02:00
sebres 0a209f01c2 Merge branch '0.10' into 0.11 2019-07-11 13:28:47 +02:00
Sergey G. Brester 7520d250b0 Merge pull request #2444 from sebres/gh-2392
systemd-backend: switched default flags to SYSTEM_ONLY(4)
2019-07-11 13:25:58 +02:00
sebres af611db859 Merge branch '0.10' into 0.11 2019-07-10 12:47:03 +02:00
sebres 5e980afbb8 filter.d/apache-noscript.conf: closes #2466 - matches "Primary script unknown" without "\n" (optional now) 2019-07-10 12:45:53 +02:00
sebres 62b1712d22 amend to #2387:
- common.conf: rewritten using section-based handling round about option logtype;
- option `logtype` extended with `rfc5424` to cover RFC 5424 log-format (see #2309);
2019-07-09 21:48:43 +02:00
sebres 439f97fc52 Merge branch '0.10' into 0.11 2019-07-09 20:07:59 +02:00
sebres 595054639b tests/samplestestcase.py: fixes retrieving of microseconds by epoch (and comparison within tests factory) 2019-07-09 20:07:14 +02:00
Sergey G. Brester 5bc8d73220 test_badips.py: parameter key is removed in #2452 2019-06-26 20:52:37 +02:00
benrubson 8b171f7d25 Badips key is only used to retrieve list 2019-06-26 18:34:20 +02:00
sebres 80f97eaf02 Merge branch '0.10' into 0.11 2019-06-26 17:29:08 +02:00
sebres 4a2f4226b8 testIpToName: fixed for reverse IP of google dns (resolving another name now), more dynamic now 2019-06-26 17:28:09 +02:00
Sergey G. Brester 8a386103c1 Update ChangeLog 2019-06-25 15:49:07 +02:00
Sergey G. Brester 978c2fa8dd Merge pull request #2448 from sebres/norm-mail-actions
Normalization of mailing actions
2019-06-25 15:39:12 +02:00
sebres e751be2c13 normalize, simplify and fix several mail actions (mail and sendmail actions are more similar now, sendmail is configurable via parameter mailcmd, etc);
added test covering sendmail-whois-lines
2019-06-15 23:14:41 +02:00
sebres 3d04a99d25 fail2ban-regex: (verbose only) avoid errors by dump of real options (if filter doesn't have some optional parameter, like datepattern) 2019-06-15 22:08:31 +02:00
sebres 5045c4bb00 Merge branch '0.10' into 0.11 2019-06-12 16:28:57 +02:00
sebres 809e7c4e82 Merge pull request #2264 from girst/0.11 (rebased to 0.10) 2019-06-12 16:28:32 +02:00
girst a7dc3614c4 znc-adminlog: use <ADDR> instead of <HOST> 2019-06-12 16:26:34 +02:00
girst b288ccd6b6 new filter: znc-adminlog 2019-06-12 16:25:50 +02:00
sebres 2e7a600851 Merge branch '0.10' into 0.11 2019-06-12 11:44:05 +02:00
sebres 326f5d4e3f Merge fix of gh-2390 2019-06-12 11:43:07 +02:00
sebres 4c81338944 update ChangeLog (gh-2390) 2019-06-12 11:28:19 +02:00
sebres 22b9304562 action.d/badips.py: fix start of banaction on demand (which may be IP-family related), supplied action info with ticket instead of simulating it with dict;
(closes gh-2390)
2019-06-12 11:23:52 +02:00
sebres 9e44c30659 systemd-backend: switched default flags to SYSTEM_ONLY(4), that avoid to open the user session files, so can prevent "Too many open files" errors (like gh-2208) on a lot of user sessions;
(following Orion's proposal in gh-2392)
2019-06-12 00:42:01 +02:00
sebres 686a8bdc54 Merge branch '0.10' into 0.11 2019-06-12 00:13:39 +02:00
sebres 2725acb64b amend to 809acb69e5: extended to avoid the vice versa race (too many outdated tickets to unban) - max count of outdated tickets is restricted also. 2019-06-12 00:11:26 +02:00
sebres 03b2b79c41 Merge branch '0.10' into 0.11 2019-06-11 15:51:10 +02:00
sebres 3326ec95ce small amend (preparing to merge in 0.11): more precise test and avoid "expired bantime" (in 0.11) 2019-06-11 15:50:29 +02:00
sebres 93727abeb8 cherry-pick with_alt_time helper decorator from 0.11 2019-06-11 15:50:27 +02:00
sebres 809acb69e5 stability: avoid race condition - no unban if the bans occur continuously (e. g. banning action too slow, so new bans found each time during the default sleeptime);
now unban will happen not later than 10 tickets get banned regardless there are still active bans available (precedence of ban is 10 now);
closes gh-2410
2019-06-11 14:37:10 +02:00
sebres 0ed3a63151 Merge branch '0.10' into 0.11 2019-06-07 16:29:38 +02:00
sebres e5ae113215 filter.d/postfix.conf: extended with new postfix filter mode errors to match "too many errors" (gh-2439),
also included within modes `normal`, `more` (`extra` and `aggressive`), since postfix
  parameter `smtpd_hard_error_limit` is default 20 (additionally consider `maxretry`)
2019-06-07 16:14:02 +02:00
sebres 3b2f75414c filter.d/postfix.conf: extended regexp's to accept variable suffix code in status of postfix for precise messages (gh-2442) 2019-06-07 15:40:55 +02:00
sebres 3d4044084a Merge branch '0.10' into 0.11 2019-06-07 14:48:10 +02:00
sebres 8da9bfb83a Update ChangeLog (gh-2302, rebased to 0.10) 2019-06-07 14:47:43 +02:00
Sergey G. Brester 7dbd3a07eb cut comment to limit documented on abuseipdb, additionally use curl in quiet mode 2019-06-07 14:39:55 +02:00
Carlos Ferreira 7b73cb7639 Switch to AbuseIPDB API v2 2019-06-07 14:39:52 +02:00
sebres 759f7274f8 Merge branch '0.10' into 0.11 2019-06-05 12:28:44 +02:00
sebres 2e51897d7a small amend to feba50e3c2 (typo fixed) 2019-06-04 20:40:48 +02:00
sebres feba50e3c2 fixed resolve of FQDN: resolve of an external IPs and name will be preferred before the local domain (or a loopback), see gh-2438 2019-06-04 19:46:42 +02:00
sebres ca49f2c71c actions: provide <bantime> as integer value (for actions expecting timeout parameters) 2019-05-28 10:12:24 +02:00
sebres c024c93ec6 fix sporadic test error (avoid purge timer-event execution in the middle of test) 2019-05-28 09:54:54 +02:00
sebres 7c7dfab8db fixed missing return value (attempts) in addFailure in case of observed/banned tickets (could cause error '>=' not supported between instances of 'NoneType' and 'int' with python 3.x, gh-2432) 2019-05-28 09:21:55 +02:00
sebres f48677db7d Merge branch '0.10' into 0.11 2019-05-24 16:18:32 +02:00
sebres 3b51c005f8 update ChangeLog (multi-line parsing fix, gh-2431) 2019-05-24 16:17:06 +02:00
sebres ffd366e17b Merge branch '0.9' into 0.10 2019-05-24 16:01:27 +02:00
sebres 83f626c4aa (grave) closes gh-2431: replace newlines in message from systemd journal (otherwise multi-line parsing is broken, because removal of matched string from multi-line buffer window is confused by extra new-lines, so they are retained and got matched on every followed message). 2019-05-24 15:53:16 +02:00
sebres 5137cd2ec8 Merge branch '0.10' into 0.11 2019-05-14 21:40:50 +02:00
sebres 49bf6132cc amend for 3036ed1889: eliminate "invalid sequence" warnings 2019-05-14 21:40:33 +02:00
sebres 939f0d43e0 amend for 3036ed1889: resolve deprecated syntax (eliminate "invalid sequence" warnings) 2019-05-14 20:42:05 +02:00
sebres f69a8693fc Merge branch '0.10' into 0.11 2019-05-14 20:19:29 +02:00
sebres 607e965e7b Merge branch 'sebres/0.10-travis-xenial' into 0.10:
- multi-distribution (trusty & xenial);
- python 3.8 (and new python/pypy minor versions on xenial);
2019-05-14 20:16:59 +02:00
sebres 08d2615020 small amend: review, simplification, etc 2019-05-14 20:04:44 +02:00
sebres 1cca374d04 .travis.yml: several distributions in matrix (trusty & xenial together) 2019-05-14 19:55:01 +02:00
sebres d310c4992f .travis.yml: coverage for python 3.8 (test with newest python/pypy versions) 2019-05-14 18:24:45 +02:00
sebres 3036ed1889 resolve deprecated syntax (eliminate "invalid sequence" warnings) 2019-05-14 18:22:55 +02:00
sebres 0426a24719 filter.d/postfix.conf: (closes gh-2426) filter extended to catch "5.1.1" (Recipient address rejected: User unknown in local recipient table) with RCPT (and some session-id instead of "NOQUEUE") 2019-05-14 15:27:20 +02:00
sebres ca85ddc866 Merge branch '0.10' into 0.11 2019-05-10 16:23:50 +02:00
sebres 2b8e2707bb Merge pull request #2298 from chtheis/0.11 (rebased to 0.10) 2019-05-10 16:22:58 +02:00
sebres 4d08bc4ad5 update ChangeLog 2019-05-10 16:22:25 +02:00
sebres d8d71c5a22 action.d/helpers-common.conf: grep arguments are rewritten - using options -wF to match only whole words and fixed string (not as pattern) 2019-05-10 16:17:13 +02:00
chtheis fa727586ff Fix grep pattern to deal with Apache's error log
Apache's error log appends the port to the IP address, other logs don't.
2019-05-10 16:04:27 +02:00
sebres 74eac6c94f Merge branch '0.10' into 0.11 2019-05-02 15:28:44 +02:00
sebres 23d2281e57 action.d/nginx-block-map.conf: small fix with better RE-rule for removal of ID (token/session) via sed (anchored now) 2019-05-02 15:22:45 +02:00
benrubson 5b2b680bfe SSHd add Bad protocol version message 2019-05-02 11:42:45 +02:00
Sergey G. Brester b318eb7e33 closes gh-2408: prevent execution of action abuseipdb for restored tickets 2019-04-29 10:45:37 +02:00
sebres 633b179b19 Merge branch '0.10' into 0.11 2019-04-26 13:35:43 +02:00
sebres 3d80e881c5 increase coverage (if python-systemd not available, so some tests may be skipped) 2019-04-26 13:29:19 +02:00
sebres cd32f4a132 amend to ec681a3363 (PR gh-2387):
- specify default options (`logtype`) in default sections of filter-config (this allows to overwrite such options in Definition/Init sections within filter.local or includes also without setting that in the jail);
- fail2ban-regex: output real filter-options (after combine/interpolate) if verbose (`-vv`) or debug (`-l debug`).
2019-04-26 12:49:03 +02:00
sebres c47bb523b7 Merge branch '0.10' into 0.11 2019-04-24 21:58:27 +02:00
Sergey G. Brester 7c9c751eb6 Merge pull request #2247 from Holston5/Holston5/mysqld-auth.conf
Update mysql logging command and fix mod_security filter
2019-04-24 21:57:19 +02:00
Sergey G. Brester a7c48e7fe7 test case to cover two client entries message 2019-04-24 21:35:21 +02:00
Holston 422a2de7fe updated 2019-04-24 21:35:19 +02:00
Holston a581bf3f08 Fixed filter for Apache mod_security 2019-04-24 21:35:17 +02:00
Holston 5d6a84ba78 Updated to correct logging option 2019-04-24 21:35:15 +02:00
sebres f0c5bd56f4 Merge branch '0.10' into 0.11 (conflicts resolved) 2019-04-19 13:20:38 +02:00
Sergey G. Brester d67e42efa2 Merge pull request #2402 from sebres/maxentries-mem-saving
maxmatches: memory saving options
2019-04-19 12:51:04 +02:00
Sergey G. Brester 7d6db7391e Update ChangeLog 2019-04-19 12:50:35 +02:00
sebres 3e5b8fdc6a fixes coverage of dbmaxmatches = 0 2019-04-18 22:44:14 +02:00
sebres 46fc4c4615 protocol and documentation 2019-04-18 22:14:34 +02:00
sebres 4629e4320f coverage and code review 2019-04-18 21:48:58 +02:00
sebres 852cb0362c fix restoring of tickets from database if maxmatches of jail smaller as dbmaxmatches (so read fewer matches in memory): 2019-04-18 21:17:38 +02:00
sebres 25f1aa334e fail2ban.conf: move default settings into DEFAULT section (to be more similar to jail.conf, Definition section overwrites the options, so it is backwards compatible) 2019-04-18 20:53:11 +02:00
sebres 0386df0042 introduced new options: dbmaxmatches (fail2ban.conf) and maxmatches (jail.conf);
setting `maxmatches` and `dbmaxmatches` to 0 saves memory usage and database size (closes gh-2118).
2019-04-18 20:31:39 +02:00
sebres 1083788e70 small amend (rename maxEntries -> maxMatches for consistency reasons) 2019-04-18 19:50:48 +02:00
sebres 5df78ad11f fix corner cases by maxEntries = 0 (no matches should be saved), test cases extended to cover it + code review 2019-04-18 19:37:42 +02:00
sebres 5ebac4fe61 Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10 2019-04-18 15:38:06 +02:00
sebres 337be4b36c Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.11 2019-04-18 13:47:44 +02:00
Sergey G. Brester 28c1da33dc Merge pull request #2387 from sebres/logtype-option-journal
New backend-related option `logtype` (`journal` or `file`)
2019-04-18 13:27:42 +02:00
Sergey G. Brester d920dd4014 Update ChangeLog 2019-04-18 13:19:21 +02:00
Sergey G. Brester 4a2c564945 Merge pull request #2388 from cepheid666/0.10
Update sendmail-reject with TLSMTA & MSA port IDs
2019-04-04 02:55:59 +02:00
Sergey G. Brester ec9f698f5b removed new-line 2019-04-04 02:55:09 +02:00
Sergey G. Brester c09ac8ebed small amend (typo) 2019-04-04 02:53:18 +02:00
Sergey G. Brester 6c7093c66d minor amend, refolding branches (SP|SA -> S[PA]) 2019-04-04 02:28:50 +02:00
Sergey G. Brester 7a463eb3f7 closes gh-2395: safe conversion of SYSLOG_PID or _PID (if journal entry contains a string instead of numeric) 2019-04-03 23:58:23 +02:00
Amir Caspi 76816285e8 Update sendmail-reject
Fixing timestamps to 2005 (oops)
2019-03-29 18:21:47 -06:00
Amir Caspi 7ac2f167f9 Update ChangeLog
Fixing typo I introduced in commit https://github.com/fail2ban/fail2ban/commit/eed1de0ceb992315c6824ca79e512df861bab39b
2019-03-29 17:49:22 -06:00
Amir Caspi eed1de0ceb Update ChangeLog
Updated to reflect sendmail-reject changes https://github.com/fail2ban/fail2ban/commit/9e1fa4ff73a1566ae0c381930b6eaae9880b0f29 and https://github.com/fail2ban/fail2ban/commit/ffd5d0db78af01afcdf7a2c615dc26b8558ad8f1
2019-03-29 17:47:52 -06:00
Amir Caspi ffd5d0db78 Update sendmail-reject.conf
On some distros (e.g., CentOS 7), sendmail default config labels port 465 as TLSMTA and port 587 as MSA. Update failregex to reflect. Relevant loglines included in https://github.com/fail2ban/fail2ban/commit/9e1fa4ff73a1566ae0c381930b6eaae9880b0f29
2019-03-29 17:39:27 -06:00
Amir Caspi 9e1fa4ff73 Update sendmail-reject
Added loglines to show TLSMTA and MSA port IDs (RHEL/CentOS sendmail default for ports 465 and 587, respectively)
2019-03-29 17:38:30 -06:00
sebres ced9828d04 filter.d/sendmail-reject.conf: fixed gh-2385 for some systems (e. g. CentOS): if only identifier set to sm-mta (no unit sendmail) for some messages. 2019-03-29 14:24:06 +01:00
sebres 1045003f49 fail2ban-regex: extended with same logic as fail2ban-server (sets logtype to journal if systemd backend is used (systemd-journal specified), to apply short prefix-line in filter) 2019-03-29 14:24:04 +01:00
sebres ec681a3363 backend systemd sets logtype to journal automatically;
sshd-journal: new test covering sshd journal logging format (matches short prefix-line simulating output of formatJournalEntry);
samplestestcase-factory extended with new option `fileOptions` to set common filter/test options for whole test-file
2019-03-29 14:24:00 +01:00
sebres e268bf97d4 introduces new configuration parameter "logtype" (default "file" for file-backends, and "journal" for journal-backends);
common.conf: differentiate "__prefix_line" for file/journal logtype's (speedup and fix parsing of systemd-journal);
samplestestcase.py: extends testSampleRegexsFactory to allow coverage of journal logtype;
closes gh-2383: asterisk can log timestamp if logs into systemd-journal (regex extended with optional part matching this)
2019-03-29 14:23:57 +01:00
sebres eddd0d2f25 fail2ban-regex: fixed usage of foreign filter path with relative filename (outside of config-base directory): avoid join filter filename with 'filter.d' 2019-03-27 15:12:27 +01:00
Sergey G. Brester 0e5ce68d4c Merge pull request #2348 from szepeviktor/deb-initd-retry
Safer, nicer, uniform Debian initd script - into 0.10
2019-03-27 14:00:40 +01:00
sebres 1e59d53bbe fixed typo 2019-03-27 13:48:53 +01:00
sebres 17a4f81e23 Merge branch '0.10' into 0.11 2019-03-27 13:46:56 +01:00
sebres 320e55b8d5 Merge branch 'master' into 0.10 (merge point only, no functional changes as dovecot_log already owns it from common in 0.10) 2019-03-26 13:40:40 +01:00
sebres 6fe6ebe039 Merge branch 'fix-xarf-abuse-action' into 0.10 (closes gh-2372) 2019-03-18 10:06:55 +01:00
sebres a7ccbd46dc test cases extended to cover xarf-login-attack action 2019-03-16 00:13:22 +01:00
sebres e8401a7e65 action.d/xarf-login-attack.conf: fixes gh-2372, correction for split of addresses, interpolation is shell-independent now, etc;
extended with option `boundary`, additionally dynamic boundary part is used (is not so predictable as it was previously);
2019-03-16 00:05:06 +01:00
sebres ec2b5dc483 fixed log-level in error case (logging error instead of Level 39) 2019-03-15 22:28:08 +01:00
Sergey G. Brester 7a7a905ab2 0.9 - Merge pull request #2339 from cFire/master
Add override for dovecot failed logins on debian
2019-03-14 11:45:46 +01:00
sebres 7f0bba94ba Merge pull request #2174 from eli-schwartz/0.11 (rebased) 2019-03-13 13:35:48 +01:00
Eli Schwartz ebf2f28294 tmpfiles.d: don't use legacy directory path
systemd 239 (released June 22) introduces a new warning for tmpfiles.d
snippets touching paths in /var/run instead of the canonical /run

See https://github.com/systemd/systemd/commit/a2d1fb882c4308bc10362d971f333c5031d60069

Update to use the preferred path.
2019-03-13 13:34:16 +01:00
sebres 4e2c7b9fdd Merge branch '0.10' into 0.11 2019-03-12 17:01:03 +01:00
sebres 741cf8fb0e Merge branch 'master-0.9' into 0.10 2019-03-12 16:58:08 +01:00
sebres f3cea45d2a Merge pull request #2290 from james-choncholas/0.11 (rebased) 2019-03-12 16:56:09 +01:00
sebres 1a9527e6a4 fixed catch-all on user (and simplifying) 2019-03-12 16:53:36 +01:00
jim a7f3ba87f6 filter.d/sogo-auth.conf: fixes gh-2289 - matching auth-failures when behind a proxy;
(broken by commit 72b06479a5), replacement for gh-2290.
2019-03-12 16:50:04 +01:00
sebres 324f0ed7cc Merge branch '0.10' into 0.11 2019-03-01 12:36:07 +01:00
Sergey G. Brester 415818d803 Merge pull request #2356 from sebres/0.10-th-stack-size
default thread stack size
2019-03-01 12:33:03 +01:00
Sergey G. Brester 6c14f1987f Update ChangeLog 2019-03-01 12:31:17 +01:00
sebres 32ba74463f coverage - move to another tests (directly covering server) 2019-02-24 18:43:23 +01:00
sebres f6468e753b resolves py3.x compat issues in tests 2019-02-24 17:14:53 +01:00
sebres fffeb7785c code review 2019-02-24 16:56:13 +01:00
sebres 3c70fe298a closes gh-969: introduces new section [Thread] and option stacksize to configure default stack-size of the threads running in fail2ban. Example:
```ini
[Thread]
stacksize = 32
```
2019-02-24 16:45:14 +01:00
Sergey G. Brester af18993ba2 Merge pull request #2245 from benrubson/loglevel
badips.py: extended option `loglevel` to supply different log-level to the summary
2019-02-22 14:25:03 +01:00
Sergey G. Brester 410a9804b1 Update ChangeLog 2019-02-22 14:23:05 +01:00
sebres 3fcb0a868d test-cases: availability of badips-service - avoid sporadic errors (like "The handshake operation timed out") during setup of tests 2019-02-22 14:07:11 +01:00
sebres 5126068099 loglevel and shortloglevel combined to single parameter loglevel, below an example logging summary with NOTICE and rest with DEBUG log-levels:
action = badips.py[... , loglevel="debug, notice"]
2019-02-22 14:05:19 +01:00
Ben RUBSON 34edec297b Add changelog entry 2019-02-22 13:33:08 +01:00
benrubson 689938ee99 Add a shortloglevel badips.py option 2019-02-22 13:32:46 +01:00
sebres a3b7a0525a Merge branch '0.10' into 0.11 2019-02-22 13:22:52 +01:00
sebres 140243328f coverage: try to avoid sporadic "coverage decreased" in CI 2019-02-22 13:20:40 +01:00
Sergey G. Brester 7e46ceed7e Merge pull request #2353 from Yannik/patch-3
Add asterisk ipv6 test cases with and without port (related to #2317)
2019-02-22 13:09:21 +01:00
sebres 3d7b072a15 covering short form of IPv6 (written-out full form of IPv6 is safe, no matter with or without square brackets) 2019-02-22 12:50:34 +01:00
Yannik Sembritzki 62acaae327 Add asterisk ipv6 test cases with and without port (related to #2317) 2019-02-22 12:43:07 +01:00
Sergey G. Brester d3f6d6ffdd Merge pull request #2286 from crazy-max/0.10
New filter `traefik-auth`
2019-02-21 22:27:04 +01:00
Sergey G. Brester dcede9b3f1 comment rewritten (belongs to the filter) 2019-02-21 22:26:28 +01:00
Sergey G. Brester d84fb8a4b1 regex rewritten (more secure now, resolves catch-all vulni) 2019-02-21 22:19:04 +01:00
sebres 9ed35c423a Merge branch '0.9' into 0.10 (gh-2317) 2019-02-21 20:13:54 +01:00
Sergey G. Brester 5c44ca714f Merge pull request #2317 from Yannik/patch-2
Fix asterisk filter not catching attackers when port is logged (in pjsip module)
2019-02-21 20:09:05 +01:00
sebres e046b09c8a coverage for get ban --with-time 2019-02-21 17:56:31 +01:00
sebres e44cd671b2 Merge branch '0.10' into 0.11 (conflicts resolved, tests fixed) 2019-02-21 17:29:04 +01:00
sebres 883864c774 optimizes processing of server-configuration stream by start and reload (no interim outputs produced, several calls of get-functions avoided also). 2019-02-21 15:54:56 +01:00
sebres 34dba44816 MANIFEST: forgotten test file 2019-02-21 15:50:12 +01:00
Sergey G. Brester 487e19420e Merge pull request #2351 from sebres/0.10-multi-ban-unban-in-jail
fail2ban-client: multi ban/unban and attempt for set jail
2019-02-21 15:42:00 +01:00
Sergey G. Brester a48d50efc0 Update ChangeLog 2019-02-21 14:37:07 +01:00
sebres fc92021211 coverage and few enhancements 2019-02-21 14:36:18 +01:00
sebres 2dd3c546dd small code review (normalization and duplicated codes removal) 2019-02-20 16:48:11 +01:00
sebres 00a6717953 fail2ban-client: extended with new feature which allows to inform fail2ban about single or multiple attempts (failure) for IP (failure-ID), syntax:
set <JAIL> attempt <IP> [<failure1> ... <failureN>]
2019-02-20 16:47:53 +01:00
sebres 84cec5e861 implements gh-2349: fail2ban-client set jain banip/unbanip ip1 .. ipN extended to ban/unban multiple tickets;
reorganized banning facilities (addBannedIP moved from filter to actions in order to ban directly without implication of fail-manager in between.
2019-02-20 14:56:00 +01:00
sebres 4a829cb51b Merge branch '0.10' into 0.11 2019-02-18 17:19:33 +01:00
sebres e30ebb1f3b closes gh-2277: fixed and optimized cache facilities (operations on OrderedDict are not atomic); increased max-size of IPAddr cache; don't cache raw objects (it is fast enough). 2019-02-18 17:05:11 +01:00
sebres 14f997231d add test case to cover gh-2277, testOverflowedIPCache testing overflow of IP-cache multi-threaded (2 "parasite" threads flooding cache) 2019-02-18 16:56:43 +01:00
Viktor Szépe 824afbf52d Fix whitespaces 2019-02-17 09:12:30 +00:00
Viktor Szépe 24b0e048d1 Normalizing quote usage in initd 2019-02-17 09:08:59 +00:00
Yaroslav Halchenko c545315192 ENH: travis - run shellcheck on files/debian-initd 2019-02-17 09:08:43 +00:00
Yaroslav Halchenko 62f957973d ENH: disable shell check for $DAEMON_ARGS expansion 2019-02-17 09:08:32 +00:00
Viktor Szépe dfd2a2063d Safer, nicer, uniform Debian initd script 2019-02-17 09:08:29 +00:00
Yaroslav Halchenko 31e6ec3c5b Merge pull request #2323 from todgru/fix-spelling-abuseipdb-conf
fix: correct spelling category
2019-02-15 17:08:45 -05:00
Cool Fire 27526e431b Changes static logfile string to variable
Since we don't want to re-declare a log file name we already
have a varialbe for, use the existing variable to set dovecot_log.
2019-02-13 10:10:24 +01:00
Cool Fire b31a018e7c Add override for dovecot failed logins on debian 2019-02-13 10:01:14 +01:00
sebres 5a54a44559 provide more meaningful error-message if invalid datepattern set;
fail2ban-regex: catch errors/exceptions by set of parameter, more verbose output if needed (`-v` or log-level `debug` would produce output of call-stack additionally).
2019-02-12 14:36:40 +01:00
sebres a602a61cba Merge branch '0.10' into debian 2019-02-11 23:29:44 +01:00
sebres 1647d0090e Merge branch '0.10' into 0.11 2019-02-11 19:19:44 +01:00
Sergey G. Brester c819a18a0a Update ChangeLog 2019-02-11 19:15:11 +01:00
sebres e651bc7866 amend to #1622: jail-reader supports now multi-line option for multi-line action parameter:
logpath = a.log
            b.log
            c.log
  action  = ban[...]
          = log[logpath="%(logpath)s"]
closes gh-2341, ultimate fix for gh-976
2019-02-11 11:54:58 +01:00
sebres 99296679d6 Merge branch '0.10' into wc/debian 2019-02-11 10:58:57 +01:00
todgru 39ed016a1e fix: correct spelling category 2019-01-14 22:08:38 -08:00
sebres 89c611064d test-cases: be sure the test-files always written with new-line at end 2019-01-14 19:00:42 +01:00
sebres d88ce7181c Merge branch '0.10' into 0.11 2019-01-07 01:51:59 +01:00
Sergey G. Brester 4108e04ab4 Update ChangeLog 2019-01-07 01:50:44 +01:00
sebres a13fdcf4f7 closes gh-2314: extended regex for mysql 8.0.13 if used logging with details (e. g. log-error-verbosity = 3, so log output has few additional words enclosed in brackets after "[Note]"). 2019-01-07 01:34:12 +01:00
Sergey G. Brester 53684af0e3 Merge pull request #2315 from psvi/ban_list
New command `fail2ban-client get <JAIL> banip`
2019-01-07 01:11:28 +01:00
sebres 59688d7cd5 move helper to test, normalize invocations in order to emphasize assert comparison. 2019-01-07 00:05:27 +01:00
sebres 963e14c685 resolve sporadic timing errors (unban if ban still not occurred, resp. get list of IPs if not yet banned);
simplify helper procedure for testJailBanList.
2019-01-06 23:49:05 +01:00
sebres 4b934c784d normalized time to string calls. 2019-01-06 23:33:28 +01:00
sebres f959f58e15 extend protocol (command-line) and regenerate man's 2019-01-06 22:45:48 +01:00
sebres df97fd33cf ip-list is sorted now (by end of ban) per default;
extended with new option `--with-time` to provide more pretty and informative result (separated by new-line, including time strings: time of ban + ban-time = end of ban):
  192.0.2.1    2019-01-06 22:24:48 + 300 = 2019-01-06 22:29:48
  192.0.2.2    2019-01-06 22:24:48 + 600 = 2019-01-06 22:34:48
also it is possible now to provide separator-character as extra-parameter after `get <jail> banip ?sep-char?` (default is space).
removed unneeded test-cases (test code-base minimization) and unexpected manually changed files.
2019-01-06 22:31:23 +01:00
Sergey G. Brester 67247999ff closes #2313: missing dependency to nftables.service 2019-01-06 17:03:09 +01:00
SP 7f5f7017db ENH: added new test cases for fail2ban-client get <JAIL> banip command (gh-1916) 2019-01-04 18:00:38 +03:00
Yannik Sembritzki 547504873e Add test case for new asterisk pjsip log syntax which includes the port 2019-01-03 23:59:38 +01:00
Yannik Sembritzki 6b4404b1bc Fix asterisk filter not catching attackers when port is logged (Fixes #2316) 2019-01-03 23:55:42 +01:00
SP 3d477d229d ENH: added new command fail2ban-client get <JAIL> banip to get the banned ip addresses (gh-1916) 2019-01-03 23:55:35 +03:00
sebres c9ba695ba3 minor, no cover for 3.x (2.6 only) 2018-12-28 00:04:15 +01:00
sebres 966fa1be89 Merge branch '0.10' into 0.11 2018-12-27 20:09:15 +01:00
sebres 4a4780be04 test-cases: prevent sporadic timing errors (unban if ban still not occurred) 2018-12-27 18:10:09 +01:00
sebres 0298c8a31e closes gh-2277: fixed cache-object clean-up process (if max-size reached) used multi-threaded (del can throw KeyError if get/unset changes the list);
additionally OrderedDict is used now for cache (if available, so >= 2.7) - avoids (slow) search of expired items in full cache and always prefers older objects to remove (like FIFO).
2018-12-27 18:07:23 +01:00
sebres 2010dda6fa Merge branch '0.10' into 0.11 2018-12-19 12:20:10 +01:00
Alexander Koeppe df9b352bac Update information reg. ipdns.py as successor for dnsutils.py 2018-12-19 12:17:44 +01:00
Sergey G. Brester cadcc69bc0 minor amend for better readability 2018-12-17 18:42:28 +01:00
Sergey G. Brester 3fa54559e5 Update ChangeLog 2018-12-17 18:39:31 +01:00
Sergey G. Brester f87a43487e Merge pull request #2287 from angeloc/0.11
setup.py: adding option `--without-tests` to skip building and
installing of tests files
2018-12-17 18:37:08 +01:00
Sergey G. Brester c540babfb6 matches not empty username only 2018-12-17 12:30:46 +01:00
CrazyMax 7cdabdd7ae Update traefik-auth failregex 2018-12-14 19:06:09 +01:00
sebres c1ccabc1f9 fixed read of included config-files (.local overwrites options of .conf for config-files included with before/after) 2018-12-11 15:43:25 +01:00
sebres 9b96a7de89 fix of SafeConfigParserWithIncludes 2018-12-11 15:39:43 +01:00
sebres 0245777c84 SafeConfigParserWithIncludes: fixed read of included config-files (expands with localized version, so inc.local overwrites options of inc.conf for config-files included with before/after);
added new test to cover this case.
2018-12-11 14:48:48 +01:00
CrazyMax 90516d6b67 Add login success example for traefik-auth 2018-11-28 00:37:24 +01:00
Sergey G. Brester 3b8842e618 Merge pull request #2284 from jedie/patch-1
Add link to https://fail2ban.readthedocs.io in README
2018-11-26 13:12:52 +01:00
Sergey G. Brester c4c713ca6e Update README.md 2018-11-26 13:10:30 +01:00
Angelo Compagnucci 9b918bba2f setup.py: adding option to install without tests
Tests files are not always needed especially when installing on low
resource systems like an embedded one.
This patch adds the --without-tests option to skip building and
installing of tests files.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2018-11-26 08:47:36 +01:00
CrazyMax a160c38211 Fix UTC Time mismatch 2018-11-24 23:16:27 +01:00
CrazyMax a8fbdd6a87 Fix UTC Time mismatch 2018-11-24 23:13:50 +01:00
CrazyMax a51f82770b New filter traefik-auth 2018-11-24 22:44:44 +01:00
Jens Diemer 52f6bfc2df Add link to https://fail2ban.readthedocs.io in README 2018-11-23 15:47:37 +01:00
sebres b49c1ab4b3 Merge branch '0.10' into 0.11 2018-11-21 13:06:44 +01:00
sebres 555b29e8e6 Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10 2018-11-21 13:05:42 +01:00
Sergey G. Brester c40e4c7bad Merge pull request #2279 from sebres/sshd-filter-gh-2239
sshd filter enhancements (gh-2239)
2018-11-21 11:50:32 +01:00
Sergey G. Brester 0ac5c8941c Update ChangeLog 2018-11-20 12:39:38 +01:00
sebres 1c1d2cc435 introduces new failregex-flag tag <F-MLFGAINED> signaled that the access to service was gained (ATM used similar to <F-NOFAIL>, but does not added to matches);
filter.d/sshd.conf: extended with new rules:
- Disconnecting ...: Change of username or service not allowed
- Disconnected from ... [preauth] (extra/aggressive mode only)
2018-11-19 21:19:57 +01:00
Sergey G. Brester 189c3f964b Merge pull request #2276 from dienteperro/patch-1
"be" instead of "me" in shorewall.conf
2018-11-15 21:47:33 +01:00
dienteperro 0df221b54b "be" instead of "me" in shorewall.conf 2018-11-15 14:34:51 -05:00
sebres 657b147c0d fixed dependency issue if setup invoked using python 3.x: invocation of 2to3 takes place after setup (and __init__.py) loaded;
closes gh-2255.
2018-10-10 12:25:53 +02:00
sebres d518868691 Merge branch '0.10' into 0.11 2018-10-09 22:13:43 +02:00
sebres e99635650a dnsToIp and other DNSUtils primitives uses sets instead of lists now (speed-up search of ip, e. g. ignoreself/ignoreip check process) 2018-10-09 18:24:50 +02:00
sebres f9f7e29295 Merge branch '0.10' into 0.11 (version bump after r.0.10.4) 2018-10-04 13:08:25 +02:00
sebres 0ae02ba2a1 version bump (back to dev-version) 2018-10-04 11:57:56 +02:00
sebres aa565eb80e release 0.10.4 - ten-four-on-due-date-ten-four 2018-10-04 11:26:22 +02:00
Sergey G. Brester 1752c19b6f Merge pull request #2205 from benrubson/patch-1
Add loglevel option to badips.py
2018-10-02 13:12:03 +02:00
Sergey G. Brester 65676baf8c fixed py3 incompatibility (for some reasons this file seems to be excluded from 2to3), anyway not needed, because int-type is already checked in str2LogLevel 2018-10-02 13:00:20 +02:00
Sergey G. Brester 4b751c84c3 badips.py: Rewrite new bool option "log" as "loglevel" and revert default to log-level (DEBUG). 2018-10-02 12:32:15 +02:00
sebres a462966cf6 Merge branch '0.10' into 0.11 2018-09-27 13:13:28 +02:00
sebres 6067579464 Fixed action parameter timeout: it is a time (integer), so avoid to convert it to string (for replacement); fix substituteRecursiveTags using auto-convert to string.
Closes gh-2241.
2018-09-27 12:51:57 +02:00
sebres 17da4943df use short log-names for special pure numeric log-level (e.g. "Level 25" could be truncated by short formats) 2018-09-26 21:00:51 +02:00
sebres 6b52f90ad6 Merge branch '0.10' into 0.11 2018-09-21 15:54:16 +02:00
sebres 2a4c47ea32 .travis.yml: coveralls doesn't support python 2.6 now 2018-09-21 15:31:37 +02:00
sebres 58b510a5be filter.d/domino-smtp.conf:
- recognizes failures logged using another format (something like session-id, IP enclosed in square brackets);
  - failregex extended to catch connections rejected for policy reasons (gh-2228);
2018-09-21 14:14:00 +02:00
sebres 8a0c06ba9e Merge branch '0.10' into 0.11 2018-09-14 11:01:40 +02:00
sebres 08f3f12f10 fix sporadic test-cases fails: change debug transmitter-message (sometimes confused with expected "Server ready" of server), better syntax for internal subst _use_flush; 2018-09-14 10:59:59 +02:00
Sergey G. Brester ba9643de45 Merge pull request #2221 from jelmer/vcs-field-uses-insecure-uri
Use secure URI in Vcs control header.
2018-09-14 07:49:05 +02:00
Jelmer Vernooij d7070f31ed Use secure URI in Vcs control header.
Fixes lintian: vcs-field-uses-insecure-uri
See https://lintian.debian.org/tags/vcs-field-uses-insecure-uri.html for more details.
2018-09-14 01:06:16 +01:00
sebres d01fe9d22a action.d/*.conf: correct comments for actionstart/actionstop 2018-09-12 16:01:57 +02:00
Ben RUBSON 9d7c0e00c1 Also log number of IPs removed/added 2018-09-08 09:28:42 +02:00
Sergey G. Brester 5b0c3e75d3 Merge pull request #2189 from yarikoptic/bf-initd-exit
debian-initd: exit with non-0 if fail, account that 255 is "Ok" exit code, use 255 explicitly instead of -1
2018-09-06 13:54:16 +02:00
Ben RUBSON 70e53b55c5 Typo 2018-08-19 22:39:18 +02:00
Ben RUBSON ec4c4b12c1 Add yes/no log option to badips.py 2018-08-19 22:35:09 +02:00
sebres 714fd8c915 Merge branch '0.10' into 0.11 2018-08-14 16:01:00 +02:00
sebres e392f510e2 fix sporadic time-related (multi-threaded) assertion errors (message was not found in the log). 2018-08-14 15:37:23 +02:00
Sergey G. Brester ee207d8c31 Merge pull request #2151 from benrubson/merge
Apache SNI error / misredirect attempts rules are combined in one regex
2018-08-14 14:56:49 +02:00
Ben RUBSON 77b35b8db7 Improvement 2018-08-14 14:07:32 +02:00
sebres addd26ae55 Merge branch '0.10' into 0.11 2018-08-14 11:13:15 +02:00
sebres e2a255d104 fixed typo in comments by "ignoreself" parameter 2018-08-14 11:11:19 +02:00
sebres 606761b3c7 Merge branch '0.10' into 0.11 2018-08-03 12:06:13 +02:00
sebres 6ad9bb56a0 Update ChangeLog 2018-08-03 12:05:40 +02:00
sebres e995d5a0b6 filter.d/freeswitch.conf: provide mode parameter, allows to avoid matching of messages like auth challenge (REGISTER) (see gh-2163) (currently extra as default to be backwards-compatible), see comments in filter how to set it to mode normal. 2018-08-03 11:42:15 +02:00
sebres bc2dbacc9a filter.d/freeswitch.conf: provide compatibility for log-format from gh-2193:
- extended with new default date-pattern `^(?:%%Y-)?%%m-%%d[ T]%%H:%%M:%%S(?:\.%%f)?` to cover
    `YYYY-mm-dd HH:MM::SS.ms` as well as `mm-dd HH:MM::SS.ms` (so year is optional);
  - more optional arguments in log-line (so accept [WARN] as well as [WARNING] and optional [SOFIA] hereafter);
2018-08-03 11:22:30 +02:00
Yaroslav Halchenko ae359f6f05 BF: $value not $code 2018-07-24 14:29:43 -04:00
Yaroslav Halchenko 298f2c066a BF: account that now code 255 is the one to say "it is Ok, we are already running/stopped" 2018-07-24 13:24:29 -04:00
Yaroslav Halchenko f323eceec7 BF: debian-initd, exit with exit code in logend_msg_wrapper
and do it unconditionally on the verbosity level
2018-07-24 13:24:29 -04:00
Yaroslav Halchenko d9b9b6ba22 RF: exit codes are positive, so exit(255) instead of exit(-1) 2018-07-24 13:24:24 -04:00
sebres eb1156b099 Merge branch '0.10' into 0.11 2018-07-18 15:57:39 +02:00
sebres 22d37cdce2 sshd: fixed failregex for ddos (resp. aggressive) mode, to cover "authenticating user" case in log-message:
Connection closed by authenticating user root 192.0.2.10 ... [preauth]
tests extended (also with few injection tries).
closes gh-2185.
2018-07-18 15:31:04 +02:00
sebres 64d9e164cf extends samples test-case factory to see the matched regex number and expression in assert message (helps if some similar regexp's available in filter) 2018-07-18 15:30:06 +02:00
sebres d92381aaa9 fail2ban-regex: ignore lines having not empty match of <F-NOFAIL> from failregex (not a failure, so count as ignored and not as matched). 2018-07-18 15:23:56 +02:00
sebres 6a81cc9d8c Merge branch '0.10' into 0.11 2018-07-17 15:18:44 +02:00
sebres 8fe07e29ad filter.d/dovecot.conf: failregex enhancement to catch disconnected with "proxy dest auth failed";
closes gh-2184
2018-07-17 15:06:42 +02:00
sebres 4c18a04439 Merge branch '0.10' into 0.11 2018-07-11 13:22:48 +02:00
sebres 94ffd00328 fixes initialization bug if sys.stdout.encoding is None (closes gh-2177). 2018-07-11 13:21:53 +02:00
sebres d65d7fd4d0 Merge branch '0.10' into 0.11 2018-07-10 20:04:48 +02:00
Sergey G. Brester cc321b78da Merge pull request #2176 from sebres/ignore-cache
Introduces cache for ignore-facilities (for `ignoreip`, `ignoreself` and `ignorecommand`)
2018-07-10 19:31:50 +02:00
sebres f8f01d5ab7 introduced new option ignorecache to improve performance of ignore failure check (using caching of ignoreip, ignoreself and ignorecommand) 2018-07-09 14:58:39 +02:00
sebres 9b6d17d07e extend ignorecommand to use actions-similar replacement (ticket-based now, so capable to interpolate all possible tags) 2018-07-09 13:01:16 +02:00
sebres 57f2d9e31c Merge branch '0.10' into 0.11 2018-07-06 18:06:54 +02:00
Sergey G. Brester 11c1bf0149 Update ChangeLog 2018-07-06 18:05:59 +02:00
Daniel Dương a719ba81e9 Fix cymru reference link 2018-07-06 17:50:51 +02:00
sebres d9b9bb5f40 Merge pull request #2125 from jodlajodla/0.11 (rebased) 2018-07-06 17:43:30 +02:00
sebres 1e44b3f085 systemd no cover (currently unsupported by travis) 2018-07-06 17:42:28 +02:00
Jan Sušnik 54a04b3a6a Fixed data type of journal flags from str to int 2018-07-06 17:32:34 +02:00
Jan Sušnik df33322f9f Added test to prove bug when specifying journal flags to systemd backend 2018-07-06 17:32:32 +02:00
Sergey G. Brester 75330568d9 Merge pull request #2168 from dpavlin/dovecot-add-F-USER
dovecot: collect F-USER and variants
2018-07-06 17:16:43 +02:00
sebres f7962469a9 Merge pull request #2173 from mattsta/fix/findtime-backsearch-on-file-load (rebased) 2018-07-06 17:11:35 +02:00
sebres 1eb93e2556 filter.py: repair start-time of initial seek to time (regardless the position of findtime option in config);
jailreader.py: additionally relocate the option `logpath` after all log-related data (backend, date-pattern, etc) that may be needed by the first usage (gh-2173).
Thanks to Matt Stancliff (mattsta)
2018-07-06 17:04:10 +02:00
Matt Stancliff 00a0e98041 Load logpath only after findtime is configured
When new log paths are configured, their start offset is immediately determined
by a filter searching for (now - findTime).
But, since findTime is configured *after* the log is loaded and
searched, logs are only searched back by the default 10 minute findTime,
regardless of user configuration of jail settings.

So, findTime must be configured before logpath or else the default findtime
is used, which ignores any findtime time defined by the user.

This fixes new reads on startup for actual log files. The systemd filter
always performed as expected due to being setup after the jail's
findtime config submission.
2018-07-06 16:42:36 +02:00
sebres 6e40cb12ab fix ban-time correction of restored tickets, could be set to persistent (-1) if increment allowed and no maxtime was specified. 2018-07-06 15:53:42 +02:00
sebres 9de1657aab Merge branch '0.10' into 0.11 2018-07-06 11:43:56 +02:00
sebres 857d6954c4 Merge pull request #2171 from sebres/0.10-fix-decoding-issues 2018-07-06 11:42:48 +02:00
sebres d0945120bf ChangeLog 2018-07-06 11:41:05 +02:00
sebres 73e89df912 amend to bcf557990e: wrong logging syntax will not throw an error anymore (logged now, as logging is safe) 2018-07-05 23:04:38 +02:00
sebres bcf557990e relocate exception-safe logging from database json-handler to common logger handling, using injection on _log-method of Logger class;
additionally provides more info if handler/conversion failed (with double protection inside catch-case);
tests/utils.py: log handler "_MemHandler" of LogCaptureTestCase fixed now to be safe also (test-cases only);
tests/misctestcase.py: the safe logging of all possible constellations is covered in testSafeLogging now.
2018-07-05 22:36:30 +02:00
sebres 06f2130575 typo/indent fix (no functional changes) 2018-07-05 19:27:07 +02:00
sebres 6ce67a6d21 coverage 2018-07-05 16:27:36 +02:00
sebres bd54d472b3 extend test-cases to check the database is still operable (not locked) after all the errors during the simulation 2018-07-05 16:23:33 +02:00
sebres 7c0ac467bb getCurrentBans: ignore tickets with the ban-time changed after correction (if other max ban-time of jail as in the database) 2018-07-05 13:54:37 +02:00
sebres 76cb1c64ce Merge branch '0.10-fix-decoding-issues' into 0.11 2018-07-04 20:47:34 +02:00
sebres 3be82a9ce9 coverage 2018-07-04 20:16:11 +02:00
sebres 5a4b47464b a bit optimized helpers 2018-07-04 18:37:25 +02:00
sebres 7dffa7a2a1 coverage related, after default encoding change 2018-07-04 18:01:39 +02:00
sebres c81de46d21 remove some no cover pragma's - covered now 2018-07-04 17:17:21 +02:00
sebres 48c2cbfa0b improve failure-message of assertNotLogged in case of single match given 2018-07-04 17:05:36 +02:00
sebres 7c9146feb3 ticket can contains bytes now (if deserialized from json by py3.x) 2018-07-04 17:04:12 +02:00
sebres 930cc6c8f1 improve adapter/converter handlers working on invalid characters in sense of json and/or sqlite-database;
both should be additionally exception-safe, so avoid possible errors in log-handlers (concat, str. conversion, etc);
test cases extended to cover any possible variants (invalid chars in unicode, bytes, str + unterminated char-sequence) with both cases (with replace of chars, with and without errors inside adapter-handlers).
2018-07-04 17:03:04 +02:00
sebres 85fd1854bc minimize influence of implicit conversions errors (between unicode, bytes and str), provide new universal helper uni_string, which uses safe explicit conversion to string (also if default encoding is ascii); avoid conversion errors on wrong-chars by replace tags. 2018-07-04 16:51:18 +02:00
Dobrica Pavlinusic 6f1e789f31 dovecot: collect F-USER and variants
We are prefering ruser= if availble because this are credentials
presented to dovecot from remote client.
2018-06-30 16:16:03 +02:00
sebres 227550684a **interim** try to fix several conversion errors 2018-06-29 22:02:41 +02:00
sebres 79350e916e fixes issue with wrong-chars in string items of CallingMap by its representation, additionally don't calculate values implicitly (may be unexpected for some constellations resp. too slow in DEBUG) 2018-06-29 18:33:24 +02:00
Sergey G. Brester ddff67acb3 Update README.md
removed travis-test refernce to 0.9th branch
2018-06-28 14:17:18 +02:00
sebres 1aebd55f26 Merge branch '0.10' into 0.11 2018-06-14 15:57:59 +02:00
sebres 2f5059ebfb test-cases: rewrite dirty-read algorithm of _MemHandler to avoid sporadic reset of dirty flag by too fast logging;
prevents sporadic tests-failures (too often by pypy) if waiting for some log-message (that was mistakenly swallowed up from cache-mechanism, so was logged but "dirty" flag is already reset)
2018-06-14 15:57:46 +02:00
sebres 0eaa0ecd86 Merge branch '0.10' into 0.11 2018-06-14 12:36:22 +02:00
sebres 8cbe1e6b13 Merge pull request #2155 2018-06-14 12:35:57 +02:00
cheese1 43db4411de small typo 2018-06-14 12:35:04 +02:00
sebres 9fdc6e0e82 Merge branch '0.10' into 0.11 2018-06-11 14:36:35 +02:00
sebres 8ec225e20a Merge pull request #2153 2018-06-11 14:36:17 +02:00
sebres 38631d0cd4 fix test-case from gh-2153 (test-suite running in year 2005) 2018-06-11 14:34:28 +02:00
Boris Gulay 34f363f6af Added test case for updated dovecot failregex. 2018-06-11 14:30:12 +02:00
Boris Gulay a923cd209b filter.d/dovecot.conf: failregex enhancement to catch sql password mismatch errors; 2018-06-11 14:30:10 +02:00
benrubson f54f6caece Merge Apache SNI error / misredirect attempts rules 2018-06-09 10:19:27 +02:00
sebres 47d3a1213c Merge branch '0.10' into 0.11 2018-05-28 19:15:18 +02:00
sebres 61e30949b3 Merge branch '0.10-short-version' into 0.10 2018-05-28 19:13:00 +02:00
sebres f220aba26f minor: added missing new-line (no functional changes) 2018-05-28 19:09:41 +02:00
sebres e36f4667ab fail2ban-client, fail2ban-server and fail2ban-regex will return version without logo info, additionally option -V can be used to get version in normalized machine-readable short format;
closes gh-2122.
2018-05-28 19:07:38 +02:00
Sergey G. Brester a3cb1dbd4d Update jailreader.py
changed log-level of annoying message "no file(s) found for glob" to NOTICE - this is rather a warning (not error).
2018-05-25 19:42:28 +02:00
Sergey G. Brester f5f5423cc9 Merge pull request #2138 from glaslos/patch-1
replacing badly scaling png badges with svg
2018-05-24 14:15:34 +02:00
Lukas Rist c256bfc02e replacing badly scaling png badges with svg 2018-05-22 13:13:39 +02:00
sebres 7a3932efc0 amend for 1b4ba602ba: use common bool-converter 2018-04-26 16:52:40 +02:00
sebres 532cb35aa8 Merge branch '0.10' into 0.11 2018-04-26 16:48:37 +02:00
sebres 1b4ba602ba normalize bool conversion, introduced common helper function _as_bool 2018-04-26 16:48:23 +02:00
sebres eba8bd4faa Merge branch '0.10' into 0.11 2018-04-26 16:24:53 +02:00
sebres 60b36c4213 rewritten preventive measure to convert "unexpected" type before pickled in CS-protocols: don't convert all basic types now (also bool, int etc).
Fixed bug with ignoreself option, which reached fail2ban-server as string 'False' (and not as boolean), so no matter which value was set - it results always in True (see gh-2078).
2018-04-26 16:24:35 +02:00
sebres 0d40dd42b1 Merge branch '0.10' into 0.11 2018-04-26 13:43:15 +02:00
sebres e01981cc72 tweak performance a bit (filter.py: inIgnoreIPList: changed default of parameter log_ignore=True, mostly used against filter-calls) 2018-04-25 19:13:56 +02:00
sebres a208b11796 added log message if ignored by ignoreself rule (similar to both other rules ignoreip and ignorecommand), and test covered now; 2018-04-25 19:06:03 +02:00
sebres 4099897be0 test dummy action first 2018-04-17 19:10:31 +02:00
Sergey G. Brester 9f3a80a21a Update ChangeLog 2018-04-17 19:08:48 +02:00
sebres bba7a6c5cf amend to (gh-2067) / b34ae5999e: fix parameter in config (dynamic parameters stating with '_' are protected and don't allowed in command-actions);
the interpolation of hostsdeny is test-covered now;
closes gh-2114.
2018-04-17 18:59:24 +02:00
sebres a92f25b48e Merge branch '0.10' into 0.11 2018-04-09 14:44:52 +02:00
sebres 22e9ccb387 amend to 5f021aa648: void throw a socket error on shutdown for already closed connection;
closes gh-2109
2018-04-09 14:19:48 +02:00
sebres 0707695146 Merge branch '0.10' into 0.11, version bump
# Conflicts resolved:
#	fail2ban/server/database.py
2018-04-05 12:58:11 +02:00
sebres 8069eef50c badips: try to fix sporadic test errors if badips-server timed out resp. not available (502 bad gateway or similar). 2018-04-05 12:31:29 +02:00
sebres 414469c102 Merge '0.10.3.fix1' into 0.10 2018-04-05 00:41:29 +02:00
sebres ac0d441fd6 0.10.3.fix1: version bump 2018-04-05 00:21:30 +02:00
sebres cb0f4cbb32 test_badips.py: amend to 2ff65f5d3c:
increase timeout in normal mode + catch timeout exceptions to skip the test (avoid sporadic CI errors if badips gets slowly).
2018-04-05 00:17:00 +02:00
sebres c1923f9644 update ChangeLog 2018-04-04 23:32:22 +02:00
sebres 34b586b51e fix for JSON serialization bug for set object (gh-2103): currently there are only users, so simply serialized as a list. 2018-04-04 23:28:44 +02:00
sebres 187514eda7 bump version (0.10.3 -> 0.10.4.dev1) 2018-04-04 20:17:26 +02:00
sebres 0a50f2e19e next release of 0.10: bump version, update ChangeLog, man's and MANIFEST etc. 2018-04-04 19:44:09 +02:00
sebres 70d099bbd6 Merge branch '0.10' into 0.11 2018-04-04 18:59:44 +02:00
sebres 5dfba17663 Merge pull request #2064 from mgrant0/0.11 (rebased)
Sendmail logs IPv6 addresses with the prefix 'IPv6:'.  Changed <HOST> to (?:IPv6:<IP6>|<IP4>)
2018-04-04 18:59:13 +02:00
sebres 4a8506fcca update ChangeLog 2018-04-04 18:57:41 +02:00
Michael Grant 57bc502d5c Update sendmail-reject.conf 2018-04-04 18:52:36 +02:00
Michael Grant 2ab6a5ae62 Update sendmail-auth.conf 2018-04-04 18:52:35 +02:00
Michael Grant 87520e8008 Sendmail logs IPv6 addresses with the prefix 'IPv6:'. Added (IPv6:)? before all <HOST> regexes to match the IPv6 address (but not the prefix). 2018-04-04 18:52:33 +02:00
sebres aac6398517 Merge branch '0.10' into 0.11 2018-04-04 18:02:05 +02:00
sebres 2ff65f5d3c test_badips.py: increase timeout in normal mode (avoid sporadic CI errors if badips gets slowly). 2018-04-04 18:01:51 +02:00
sebres 1fdad90b4d Merge branch '0.10' into 0.11 2018-04-04 16:49:57 +02:00
Sergey G. Brester 521de5edfd Merge pull request #2101 from mercurytoxic/mercurytoxic-patch-1
Fixes abuseipdb curl cypher error and comment $f2bV_matches
2018-04-04 16:48:56 +02:00
Sergey G. Brester d9525ad3aa Update ChangeLog 2018-04-04 16:47:18 +02:00
Luis Aranguren fc76ccf192 Fixes abuseipdb curl cypher error and comment $f2bV_matches
Fixed https://github.com/fail2ban/fail2ban/issues/2044 #2044
and used https://github.com/fail2ban/fail2ban/issues/2039 to fix comment in abuseipdb.com only showing $f2bV_matches
2018-04-04 16:39:16 +02:00
Sergey G. Brester 7bbc26d67e Merge pull request #2097 from benrubson/sni
Detect Apache SNI error / misredirect attempts
2018-04-04 16:31:38 +02:00
Sergey G. Brester 28ae32f0ca Update ChangeLog 2018-04-04 16:31:14 +02:00
sebres f877980da9 Merge branch '0.10' into 0.11 2018-04-04 15:55:59 +02:00
sebres 02bae2962d fixed test cases: www.epfl.ch seems to change again the static IP address, tests rewritten using dynamic mechanism (via resolver). 2018-04-04 15:24:59 +02:00
Yaroslav Halchenko f530348562 minor typo fix, thanks lintian 2018-04-04 01:12:18 -04:00
Yaroslav Halchenko 2c4e777216 BF: B-Depend on python3-setuptools and dh-python, Fixed up hardcoded path to the .build-ed package for testing
Will require tune ups for backports later on
2018-04-04 01:06:14 -04:00
Yaroslav Halchenko 450b890fb1 BF: remove all non-existing services from PartOf of fail2ban.service.
Should resolve inability to restart firewalld (its .service is
left in PartOf) upon upgrades.
2018-04-04 00:51:03 -04:00
benrubson bd74f7ba8b Detect Apache SNI error / misredirect attempts, typos 2018-04-04 00:20:58 +02:00
sebres e786dbf132 New logging parameter padding, default enabled, excepting the SYSLOG (for backwards compatibility purposes);
Closes gh-2099.
2018-04-03 17:58:17 +02:00
sebres 7dfd61f462 Merge branch '0.10' into 0.11-2 2018-04-03 14:14:44 +02:00
sebres 8423f017e7 Merge branch 'sshd-ddos-mode-closed-preauth' into 0.10 2018-04-03 14:12:35 +02:00
Sergey G. Brester 4ee7af742a Merge pull request #2090 from sebres/fix-sshd-filter-suff
sshd, multi-line failures, alternate groups capture, etc.
2018-04-03 14:08:46 +02:00
sebres 4ee07adde6 Merge branch '0.10' into fix-sshd-filter-suff
# Conflicts resolved:
#	fail2ban/server/filter.py
2018-04-03 13:30:57 +02:00
sebres 50d7c649ba Skip several test-cases of systemd backend, if journal seems to be not available (e. g. no rights to read journal);
Closes gh-2100
2018-04-03 12:39:37 +02:00
sebres fd0471927d badips: increase age for /list/cat in the test-cases (default 24h is too short, so the tests can sporadic fail) 2018-04-03 11:53:03 +02:00
sebres 4963295729 Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10 2018-04-03 11:43:58 +02:00
benrubson 30dc22fb2e Detect Apache SNI error / misredirect attempts 2018-03-29 11:36:49 +02:00
Sergey G. Brester 088192ea9f Merge pull request #1960 from comradekingu/patch-1
https, "Fail2Ban", other language improvements
2018-03-22 11:44:50 +01:00
Sergey G. Brester 9710c8c996 minor fix with reindent 2018-03-22 11:43:15 +01:00
Sergey G. Brester 02114ea073 Merge pull request #1912 from alxnorden/patch-1
Update README.md with clarifications
2018-03-22 11:10:06 +01:00
Sergey G. Brester 1b8840d333 Update README.md 2018-03-22 11:09:49 +01:00
Sergey G. Brester 8796c3b27e Merge pull request #2093 from ravage84/patch-1
Improve wording
2018-03-22 11:02:50 +01:00
sebres 218905c924 performance optimization: findFailure, search regex etc, handling with buffer/tuple-lines optimized (especially multi-regex resp. multi-lines filters) 2018-03-22 10:16:40 +01:00
Marc Würth 077f58b228 Improve wording 2018-03-21 17:53:05 +01:00
Sergey G. Brester 67df796f93 Merge pull request #2088 from sebres/fix-gh-2073
filter.d/apache-noscript.conf: extended to match "Primary script unknown", got from php-fpm module
2018-03-21 09:56:38 +01:00
sebres 79019967a7 datepattern: fix epoch/long-epoch name, if custom pattern specified 2018-03-20 23:34:18 +01:00
Sergey G. Brester 6dc9c23a25 fixed typo in pragma-comment 2018-03-20 23:14:43 +01:00
Sergey G. Brester 80725ae870 Update sshd
comment/minimalistic: no functional change
2018-03-20 19:02:44 +01:00
sebres e5735b9951 ChangeLog updated 2018-03-20 18:54:25 +01:00
sebres 4f6532f810 filter.d/sshd.conf: mode ddos (and aggressive) extended to catch Connection closed by ... [preauth], so in DDOS mode it causes failure now on closed within preauth stage;
at least using both modes can ban port-scanners and prevent for other annoying "intruders", closing connection within preauth-stage (see gh-2085 for example).
2018-03-20 18:54:22 +01:00
sebres cd7f1354c6 remove end-anchors for expressions that are precise enough (with clear flow, simple branches, without catch-all's, etc.) 2018-03-20 18:47:42 +01:00
sebres ed7d5d8ea1 ChangeLog updated 2018-03-20 16:04:42 +01:00
sebres c31eb1c562 quick optimization: normalizes pam-generic prefregex (more similar to the same regex within sshd-filter) + datepattern anchored now; 2018-03-20 16:00:21 +01:00
sebres 4129f940bb revert non-empty incremental multi-line failure merge (just simply overwrite method used ATM);
revert sshd test case (better to use last given failure-id, so ipv6 instead ipv4, e. g. because of some wrong multi-line-id recognition);
improved output on AssertionError in samples-testcase factory.
2018-03-20 15:27:59 +01:00
sebres 25cc42129a hold all user names affected by interim attempts in order to avoid forget a failures after success login:
intruder (as legitimate user) firstly tries to login with another user-name (brute-force), so hopes to reset failure counter by succeeded login;
this is fixed and covered in tests now;
sshd-filter extended to cover multiple-login attempts (also fully implements gh-2070);
2018-03-20 13:09:05 +01:00
sebres a9c94686b6 fixed multiple regexs matched 2018-03-20 09:09:42 +01:00
sebres 5603055a58 failregex: introduced capturing alternate groups, for example non-empty values of alt_user_1, alt_user_2 will overwrite user if it is empty (or alt_host -> host, etc.) 2018-03-20 09:05:02 +01:00
sebres 8028d3940d amend with better match of optional suffix-groups;
remove end-anchors for expressions are precise enough (with clear flow, simple branches, without catch-all's, etc.);
2018-03-19 17:29:26 +01:00
sebres 66d2436f21 filter.d/sshd.conf: extend suffix with optional port, move it to prefregex at end outside of the content 2018-03-19 16:50:49 +01:00
sebres 7b3442c4e2 amend to 185cb998e7: capture error prefix outside of the failure content; 2018-03-19 14:53:56 +01:00
sebres 185cb998e7 make prefregex more precise in order to avoid catch the content for non failure lines 2018-03-19 14:38:47 +01:00
sebres 8763cf0a36 ChangeLog updated 2018-03-19 14:26:51 +01:00
sebres e8ffab28fb filter.d/apache-noscript.conf: extended to match "Primary script unknown", got from php-fpm module. 2018-03-19 14:23:24 +01:00
Sergey G. Brester 20fffc44c1 Merge pull request #2087 from sebres/fix-recidive-by-syslog
filter.d/recidive.conf: fixed if logging into systemd-journal (SYSLOG)
2018-03-19 14:08:46 +01:00
Yaroslav Halchenko 75a11a4a92 make nftables alternative recommend to iptables 2018-03-10 08:34:41 -05:00
Arturo Borrero Gonzalez b67dc5e908 d/control: add nftables references
The nftables framework replaces iptables. The fail2ban software already
includes support for nftables, so reflect that in the packaging.

Also, no need to `Recommends: iptables`, since is installed by default in every
Debian system. Instead, do `Recommends: nftables`.

Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
2018-03-09 09:48:38 -05:00
Yaroslav Halchenko 400b260a32 A note on incorrect changelog record 2018-03-09 09:48:26 -05:00
sebres a6fb33bdec filter.d/recidive.conf: fixed if logging into systemd-journal (SYSLOG) with daemon name in prefix, gh-2069 2018-03-09 13:56:38 +01:00
sebres 2e533a3a3a better handling of default date templates (bounds, replacement using own expressions ...{DATE}..., etc.) 2018-03-09 13:54:04 +01:00
sebres ce6ca0029a minimize log output in trace case (index instead of full-regexp by "matched" log-line) 2018-03-07 16:27:42 +01:00
sebres a3739bbf27 trim name and add one space after padding 2018-03-07 16:25:54 +01:00
sebres 71b19d9eba stability of time-related test-cases: a bit increased timeouts; code normalization, review and coverage 2018-03-07 15:25:27 +01:00
Sergey G. Brester 92f19d0604 Merge pull request #2067 from fail2ban/sebres-fix-hostdeny-ipv6
action.d/hostdeny.conf: fixes IPv6 syntax
2018-03-07 12:35:07 +01:00
sebres 5b63ad17c6 stability of the test-cases: avoid echoing of server-ready in configure thread, if heavy-debug (only answer from new internal command "server-status"). 2018-03-05 21:54:18 +01:00
Sergey G. Brester b16aafe233 Update ChangeLog 2018-03-05 19:42:05 +01:00
Sergey G. Brester b34ae5999e action.d/hostdeny.conf: fixes IPv6 syntax
differentiate the IPv4 and IPv6 syntax (where it is enclosed in square brackets)
2018-03-05 19:35:10 +01:00
sebres ccb1daf30a Merge branch '0.10' into 0.11 2018-03-02 21:42:07 +01:00
sebres cfc3979c84 Merge branch '0.10' with 'socket-stability-fix' 2018-03-02 21:40:13 +01:00
sebres 1bdda6c8eb cache coverage 2018-03-02 21:39:13 +01:00
sebres 96836cb199 fix several errors (shutdown in test-cases during stop communication, better error handling by unpickle/deserialization, etc) 2018-03-02 21:39:08 +01:00
sebres 29bedd70d5 socket stability and coverage: cherry picked from 0.11 version (avoid many sporadic unhandled exceptions) 2018-03-02 21:31:19 +01:00
sebres 2b282ead09 Merge branch '0.10' into 0.11 2018-03-02 19:48:15 +01:00
Sergey G. Brester 9f969e7aab Merge pull request #2062 from MatthieuBarbu/patch-2
filter.d/sshd.conf: fixed normal and ddos-mode regex (extended with port)
2018-03-02 19:31:10 +01:00
sebres caa2bdfee6 amendment for gh-2061: it looks like the port was added here also 2018-03-02 19:24:47 +01:00
sebres a3bcbe2d1b backwards-compatibility, test-cases and ChangeLog update 2018-03-02 19:15:10 +01:00
MatthieuBarbu 6b5516b851 fix sshd rule #2
in line 58, rule don't match with "%(__suff)s" but work fine if I replace with "%(__on_port_opt)s"
Debian 9 stretch : fail2ban 0.10.3
2018-03-02 18:40:36 +01:00
Sergey G. Brester e9a43f739c Merge pull request #2061 from MatthieuBarbu/patch-1
fix sshd rule (space before "11:" is optional now)
2018-03-02 18:19:24 +01:00
sebres 1d7aa2ff21 filter.d/sshd.conf: rewrite fix (for new ssh log-format) backwards compatible + test-cases extended to cover both cases 2018-03-02 18:17:17 +01:00
MatthieuBarbu 9f5c873526 fix sshd rule
just remove the space before ":11" line 52 because don't match on my Debian 9 stretch...
I don't know if this is wrong on all OS
2018-03-02 17:53:35 +01:00
sebres 5ea76789c6 Merge branch '0.10' into 0.11 2018-03-02 17:18:37 +01:00
sebres 5f021aa648 shutdown sockets before close, avoid socket leakage by use of the explicit socket close in async_chat;
better error handling with error counting, differentiate special case ([Errno 24] Too many open files), with resulting stop of the server
(avoid flood the log file, closes gh-991 and similar issues);
restored auto-garbage, because of non-reference-counting python's (like pypy), otherwise it may leak there on objects like unix-socket, etc.
2018-03-02 17:08:23 +01:00
sebres fa520f36c3 stability test-cases fix: avoid rare sporadic error on start of server (threaded in foreground);
additionally show the log output of the thread-server in case of any error there.
2018-03-02 17:00:01 +01:00
sebres 8c291cad38 filter.d/asterisk.conf: fixed failregex prefix by log over remote syslog server (gh-2060) 2018-03-02 09:17:04 +01:00
Ben RUBSON b112250ef0 (Free)BSD IPFW does not allow 2 identical rules (#2054)
ipfw actionban fixed to allow same rule added several times (and actionunban to ignore error by deletion of missing rule)
2018-02-27 10:18:59 +01:00
Ben RUBSON 857767f04b Add 'any' badips.py bancategory (#2056)
action.d/badips.py: allow `any` as bancategory to retrieve IPs from all categories
2018-02-27 10:12:22 +01:00
sebres 47a7f83a0b Merge branch '0.10' into 0.11 2018-02-26 19:30:54 +01:00
sebres 07fcb24ff6 Merge pull request #2057 from benrubson/https
Use httpS with badips
2018-02-26 18:50:35 +01:00
Sergey G. Brester 117dcca414 Merge pull request #2059 from benrubson/str
badips.py, solve a str() issue - expected string, IPAddr found
2018-02-26 18:42:32 +01:00
sebres 933670d034 pragma: no cover - availability (once after error case only) 2018-02-26 18:35:30 +01:00
sebres f52c67238a action.d/badips.py: code review, ban command covered, debug log-messages, etc; 2018-02-26 18:16:20 +01:00
sebres 095a909c84 action.d/badips.py: increases score in test-cases (5 now, ssh/3 returns to large list, which can cause timeout if badips server to busy); 2018-02-26 18:14:44 +01:00
benrubson 8ed892b8bb Changelog 2018-02-26 16:15:29 +01:00
benrubson fce2a50165 badips.py, solve a str() issue under FreeBSD 2018-02-26 15:55:21 +01:00
benrubson 9a8add0ef0 changelog 2018-02-26 10:28:51 +01:00
benrubson e2665d39fd Use httpS with badips 2018-02-26 09:58:37 +01:00
sebres a5155f55e7 Merge branch '0.10' into 0.11 2018-02-21 09:31:35 +01:00
Sergey G. Brester 7070664772 Merge pull request #2048 from sebres/exim-too-many-errors
Exim-filter: too many errors
2018-02-21 09:25:42 +01:00
Sergey G. Brester 879f580c9a Update ChangeLog 2018-02-19 15:59:45 +01:00
sebres e636567d23 filter.d/exim.conf: failregex extended with SMTP call dropped: too many syntax or protocol errors. 2018-02-19 09:50:46 +01:00
sebres 19a5a2f8c0 filter.d/murmur.conf: fixed detection of failures reading from journal (systemd-backend only):
- extended with optional prefix for the systemd-journal (with second date-pattern as optional match);
- added `journalmatch` filtering;
closes gh-2043
2018-02-09 11:43:55 +01:00
sebres 3e15343343 fail2ban-regex: bug fixed, if running over systemd-journal and journalmatch missing in filter. 2018-02-09 11:34:02 +01:00
sebres 730e760666 Merge branch '0.10' into 0.11 2018-02-06 18:19:50 +01:00
sebres 98f4d70371 fixed cymru-info resolved to answers with multiple data-records (as comma-separated list now) 2018-02-06 18:00:50 +01:00
Sergey G. Brester 3b8b9c4acf README: extended systemd-prerequirements: python-systemd package 2018-02-06 17:02:23 +01:00
sebres 5c2fba0398 Merge branch '0.10' into 0.11 2018-02-01 19:41:26 +01:00
sebres f1661d35ea fix sporadic error, wait for shutdown/exit messages by assert-check, better prevention of dual (parallel) stop 2018-02-01 18:30:00 +01:00
sebres 2c03f5ad28 simple syntax change (wrong escape in string): no functional changes 2018-02-01 18:04:04 +01:00
sebres 201ae0dac2 Merge branch '0.10' into 0.11 2018-01-31 12:20:34 +01:00
Sergey G. Brester 3a1c386958 Update ChangeLog 2018-01-31 12:18:56 +01:00
Sergey G. Brester 0e0e478483 Merge pull request #2038 from sebres/long-epoch-and-epoch-pattern
Long epoch and epoch pattern
2018-01-31 12:13:46 +01:00
sebres dcbf904876 allow to parse milliseconds as float + more test cases;
normalize capturing with epoch-pattern match - similar to `{DATE}` should capture and cut out the whole pattern match from the log-line;
2018-01-31 11:07:49 +01:00
sebres 3e8098d427 python 3.x compatibility: fix replacement string (may fail with errors like bad escape \d ..., etc) 2018-01-31 11:07:48 +01:00
sebres 442b0b1c59 extends date-detector with long epoch (LEPOCH) to parse milliseconds/microseconds posix-dates;
provide opportunity to specify own regex-pattern to match epoch date-time, e. g. "^\[{EPOCH}\]";
closes gh-2029
2018-01-31 11:07:46 +01:00
Sergey G. Brester 01f3df03c8 Merge pull request #2034 from sebres/0.10_/fix-gh-2028
0.10 - extend section-related interpolation, fix gh-2028
2018-01-31 11:04:06 +01:00
sebres 0ed11817c1 restore coverage: no cover for normally unreachable scopes (only if test cases failed) 2018-01-30 13:30:31 +01:00
sebres 0be0e43d47 amend to 03b577d7b9: add new-line after matches via tag <br> without usage of interim variable 2018-01-30 12:52:26 +01:00
sebres 03b577d7b9 action.d/blocklist_de.conf: fixed tag substitution (in 0.10 it can be variables supplied via shell-arguments), expand <matches> with trailing newline;
tests extended;
closes gh-2028
2018-01-30 12:27:03 +01:00
sebres 435f359a06 allow substitute section-related parameters like <Definition/option> in all config-readers as well as during substitute after supply of init arguments;
test cases extended;
2018-01-30 12:15:36 +01:00
sebres f547a7c7b1 LogCaptureTestCase: use almost non-blocking handling by getvalue/_is_logged (especially important in tests with waiting for logged via assertLogged(..., wait=TO)):
- try to acquire lock without blocking, if not possible - return cached/empty (max 5 times, otherwise do lock);
- minimized time of the lock of messages list;
- avoid sporadic dead-locking during cross lock together with lock within handling of self._strm.
2018-01-26 20:25:11 +01:00
sebres 4942578de0 Merge branch '0.10' into 0.11 2018-01-24 20:36:22 +01:00
sebres 5f3ba289d6 restore code coverage (decreased in latest "fixes") - no cover for unreachable cases; 2018-01-24 20:03:46 +01:00
sebres faab77cc79 Merge branch '0.10' into 0.11, with resolved conflicts. 2018-01-24 17:56:58 +01:00
sebres ac9d5f61e7 rewrite keywords reserved in python 3.7 (async -> nonsync) 2018-01-24 15:50:19 +01:00
Sergey G. Brester 6b7cca07ae Merge pull request #2025 from yarikoptic/bf-0.10-debian
A number of fixes toward making tests pass while building Debian pkg for 0.10.2
2018-01-24 08:42:36 +01:00
sebres 7a757645bb introduces new decorator/conditional helper in order to skip some STOCK-related test-cases (if running outside of stock-config environment). 2018-01-23 22:06:22 +01:00
sebres 9af9ec25f5 allow to override use_stock_cfg values (used as default value now), e. g. actions rest filters only, reject d1afbb566f0304487b5d578b4aacef8e647ee74b 2018-01-23 22:06:20 +01:00
Yaroslav Halchenko 3f51c158cd Added manpage (still would need tuning) for fail2ban-python 2018-01-23 22:06:18 +01:00
Yaroslav Halchenko a5b9128fcc BF: RF test for "being a root" to check if actually can read the file 2018-01-23 22:06:16 +01:00
Yaroslav Halchenko 49be8de902 BF: look for system.journal also under system-state-logs (i.e. /var/log)
as it happens on Debian systems
2018-01-23 22:06:14 +01:00
Yaroslav Halchenko 2f0bc491e2 BF: use tests.utils.CONFIG_DIR instead of hardcoded "config" in fail2banclienttestcase
Since otherwise cannot provide custom path to the config via env var
and thus cannot test in a build directory which is out of source
2018-01-23 22:06:12 +01:00
Allan Nordhøy d7e320b96d reverting linux indentation 2018-01-23 21:09:53 +01:00
Sergey G. Brester 3ac6166b48 Merge pull request #2027 from yarikoptic/bf-0.10-review
Minor spelling typos etc
2018-01-23 19:45:44 +01:00
Yaroslav Halchenko 527bb9a7c3 dos2unix for helpers-common.conf
Original report: http://bugs.debian.org/888110
2018-01-23 08:48:36 -05:00
sebres 077a45cc93 Merge branch '0.11-fix-get-current-bans-v2' into 0.11 2018-01-23 09:42:11 +01:00
sebres 7526f50706 amend to a54b401ee2 (0.11-fix-get-current-bans):
- differentiate between unknown ban-time after upgrade (-2) and persistent ban-time (-1);
- better handling to correct current ban-time, uses `bantime.maxtime` (if increment allowed) or `bantime` of jail;
- extended test-cases in order to cover the change of `bantime.maxtime`.
2018-01-23 09:41:43 +01:00
Yaroslav Halchenko ba2538ba04 DOC: minor typos spotted around comments etc 2018-01-22 21:39:56 -05:00
Yaroslav Halchenko af2de7ff2f RF: COND_FAMILIES - use tuple
no need for a dict where tuple would be preferable (deterministic order)
2018-01-22 21:08:44 -05:00
Yaroslav Halchenko b9facb80d2 debian/README.Debian - Instructions on how to establish correct startup/shutdown sequence in systemd for shorewall (Closes: #847728)
final recipe
2018-01-22 10:38:48 -05:00
Yaroslav Halchenko 071023526f updated the patch for elderly systems to use python2 2018-01-22 10:04:52 -05:00
Yaroslav Halchenko 11911c0ccd information about new "mode" setting and new filters/actions into changelog 2018-01-22 10:01:43 -05:00
sebres 7e1bc59f80 code review after merge (removed unnecessary code-pieces resp. code-duplication) 2018-01-22 11:10:22 +01:00
sebres 05951a23a5 Merge branch '0.10' into 0.11 2018-01-22 11:08:25 +01:00
sebres 8cfd97a68f skip a testRepairDb if no sqlite3 command-helper available; code review (removed unnecessary code-pieces resp. code-duplication)
closes #2026
2018-01-22 10:42:33 +01:00
Sergey G. Brester 757ff8a7d4 Merge pull request #2022 from sebres/0.11-fix-get-current-bans
0.11: fix get current bans (after upgrade DB)
2018-01-22 10:00:57 +01:00
Yaroslav Halchenko 1c283f12f7 debian/control - sqlite3 is now needed for some tests, thus added to build-depends and suggests 2018-01-21 23:31:17 -05:00
Yaroslav Halchenko 0f24d53730 Boost policy to 4.1.3, obey lintian and demand recent debhelper (or dh-systemd), VCS fields to provide a branch 2018-01-21 22:45:32 -05:00
Yaroslav Halchenko 2cccd24ce6 NEWS entry 2018-01-21 22:35:12 -05:00
Yaroslav Halchenko f5134ae479 changlog tune up 2018-01-21 22:21:03 -05:00
Yaroslav Halchenko c7986a1089 Fixed up paths to systemd file and create monit/monitorc.d 2018-01-21 22:10:00 -05:00
Yaroslav Halchenko 2bc71e9f4b One more patch to please fakeroot 2018-01-21 22:03:27 -05:00
Yaroslav Halchenko 404dbc98d3 One more relative path in test configs + tests from upstream PR 2018-01-21 21:50:38 -05:00
Yaroslav Halchenko b2688c6c11 verbose debian build and verbose tests 2018-01-21 21:50:31 -05:00
Yaroslav Halchenko 1aa4522cd3 refreshed the patch 2018-01-21 00:27:00 -05:00
Yaroslav Halchenko 70f2b5c550 initial changelog for 0.10.2-1 2018-01-20 22:13:32 -05:00
Yaroslav Halchenko e9c1b5d6fa Merge tag '0.10.2' into debian
* tag '0.10.2': (623 commits)
  prepare release: bump version, update ChangeLog, man's and MANIFEST etc.
  ChangeLog update
  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).
  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
  nginx-http-auth: match usernames with spaces
  regex updated using non-capturing groups
  extended test-cases to cover new log-format (http_auth -> mod_auth)
  Update lighttpd-auth.conf
  file-filter's: provide stop function in order to explicitly delete/stop monitoring of each file.
  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
  should fix sporadic coverage decrease (don't cover "return", because too sporadic to get idle in pyinotify-callback);
  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
  action.d/hostsdeny.conf: actionunban rewritten using sed, also dots in IP were escaped now.
  micro-fix: delete temporary file (forgotten in test-case `test_move_dir` by reassign to directory)
  Update ChangeLog
  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).
  filter.d/sendmail-auth.conf - extended daemon for Fedora 24/RHEL - the daemon name is "sendmail" (gh-1632)
  test cases extended in order to cover `firewallcmd-ipset` with `allports`
  Update ChangeLog
  firewallcmd-ipset-allports: implemented in `action.d/firewallcmd-ipset.conf` now (`action.d/firewallcmd-ipset-allports.conf` removed), usage:
  ...
2018-01-20 21:59:34 -05:00
sebres 9440956575 Update ChangeLog 2018-01-19 19:37:37 +01:00
sebres a54b401ee2 upgrade database: update new created bips table with entries from table bans (allows restore current bans after upgrade from version <= 0.10);
algorithm of restore current bans after restart changed: update the restored ban-time (and therefore end of ban) of the ticket with ban-time of jail (as maximum), for all tickets with ban-time greater (or persistent); not affected if ban-time of the jail is unchanged between stop/start.
2018-01-19 19:35:31 +01:00
sebres 0a4a76c4c4 Merge branch '0.10' into 0.11 2018-01-19 12:32:48 +01:00
sebres 9d5f20aab2 FilterPyinotify: fixed sporadic test-case error (multi-threaded) - 'NoneType' object has no attribute 'stop'. 2018-01-19 12:32:24 +01:00
sebres c50875ccf6 Update ChangeLog: all major 0.11 changes combined in 0.11th block now 2018-01-19 11:41:54 +01:00
sebres aa47937d4f Merge branch '0.10' into 0.11: bum version after release of 0.10.2 2018-01-18 16:47:13 +01:00
sebres 9a38d5697f bump version (0.10.2 -> 0.10.3.dev1) 2018-01-18 16:40:48 +01:00
sebres a45488465e prepare release: bump version, update ChangeLog, man's and MANIFEST etc. 2018-01-18 14:49:01 +01:00
sebres 1ca3df877b Merge branch '0.10' into 0.11 2018-01-18 14:32:00 +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 38b3290516 Merge branch '0.10' into 0.11 2018-01-17 16:43:45 +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 576eeb70dd Merge branch '0.10' into 0.11 2018-01-15 18:17:18 +01: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 416240e80e Merge branch '0.10' into 0.11 2018-01-15 17:21:23 +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 0befbfd766 Merge branch '0.10' into 0.11 2018-01-11 20:23:55 +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 5ddab17089 Merge branch '0.10' into 0.11 2018-01-11 13:28:31 +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 da86ebca31 Merge branch '0.10' into 0.11 2018-01-11 11:21:02 +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
sebres 039ac7c7c4 Merge branch '0.10' into 0.11 2018-01-11 10:29:46 +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 0e68c9a720 Merge branch '0.10' into 0.11 2018-01-10 12:22:31 +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 a83a6c38e4 Merge branch '0.10' into 0.11
# Conflicts:
#	fail2ban/server/database.py
2018-01-09 12:25:30 +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
Serg G. Brester 2deb356356 Update observer.py
Change log-level to debug for purge-event message
2018-01-08 10:14:50 +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 19c2d24c29 merge point 2017-12-22 17:22:11 +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 5028f17f64 Merge branch '0.10' into 0.11, rewrite updateDb because it can be executed after repair, and some tables can be missing.
# Conflicts:
#	fail2ban/server/database.py
#	fail2ban/tests/fail2banclienttestcase.py
#	fail2ban/tests/sockettestcase.py
2017-12-22 17:05:45 +01:00
sebres 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 309a1cb337 restore timeout for ipset-based actions: on some systems ipset created without default timeout may cause "Kernel error received: Unknown error -1" (gh-1994);
thus new option `default-timeout` introduced (because of dynamical bantime in 0.10, it cannot be used here).
2017-12-06 02:38:10 +01:00
sebres 2179db3692 Merge branch '0.10' into 0.11 2017-12-06 01:41:29 +01:00
sebres 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 7e5d8f37fd Merge branch '0.10' into 0.11
# Conflicts:
#	config/action.d/firewallcmd-ipset.conf
#	fail2ban/server/jail.py
#	fail2ban/tests/servertestcase.py
2017-12-06 00:14:23 +01:00
sebres 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 cc153888d5 Merge branch '0.10' into 0.11 2017-12-01 15:55:10 +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 5cc0abbb02 Merge branch '0.10' into 0.11
# Conflicts:
#	fail2ban/tests/fail2banclienttestcase.py
2017-11-28 16:37:51 +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
sebres 12b55bb8cc Merge remote-tracking branch '0.10' into 0.11 2017-11-27 12:02:46 +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 95f29f457a Merge branch '0.10' into 0.11 2017-11-24 13:45:43 +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 8aeaaf06ee Merge branch '0.10' into 0.11 2017-11-23 22:57:21 +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 70b933f405 Merge branch '0.10' into 0.11 2017-11-06 18:57:53 +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 12419b75f2 Merge branch '0.10' into 0.11
# Conflicts:
#	fail2ban/tests/servertestcase.py
2017-10-30 14:02:41 +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
Yaroslav Halchenko f3b3a41639 changelog on the change of location 2017-10-27 17:31:41 -04:00
Yaroslav Halchenko 67706bebb3 Merge commit 'github_szepeviktor_fail2ban/patch-9^' into debian
* commit 'github_szepeviktor_fail2ban/patch-9^':
  Monit files are moved
2017-10-27 17:30:04 -04: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 a99513a43e version bump (0.11.0.dev0) after merge 0.10 2017-10-18 19:05:20 +02:00
sebres 76f5e3659e Merge branch '0.10' into 0.11 2017-10-18 19:03:08 +02:00
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
Alex 8175a53826 Update README.md with clarifications
+ Added new user clarification for installing from source with git clone.
? Right now it is not clear where the  fail2ban-0.11.0.tar.bz2 is available for download.
+ Added command for checking fail2ban version.
2017-10-10 23:15:56 +02:00
sebres 93634dd822 Merge branch '0.10' into 0.11 2017-10-04 14:25:02 +02:00
sebres 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 6c1d481135 Merge branch '0.10' into 0.11 2017-10-04 09:57:43 +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 037a0be3ae Merge branch '0.10' into 0.11 2017-10-02 15:43:55 +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
sebres e0fede621e Merge branch '0.10' into 0.11 2017-09-08 11:33:19 +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
sebres 32058ed268 Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.11 2017-09-01 10:37:52 +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 b80692f602 Merge branch '0.10' into 0.11 2017-08-18 15:44:43 +02: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 9dc9477e71 Merge branch '0.10' into 0.11 (pull request gh-1868) 2017-08-18 14:03:40 +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
sebres eca63ab32a No functional changes, just merge point for "PR #1867 cherry picked into 0.10". 2017-08-18 13:33:25 +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
Serg G. Brester 579d2477f5 Merge pull request #1867 from distler/0.11
Tweaks to action.d/pf.conf: introduced parameter `block` with default `block quick`
2017-08-17 17:34:05 +02:00
Jacques Distler d646d06e91 Tweaks to action.d/pf.conf
Document recent changes.
Add an option to customize the pf block rule (surely, what the user
really wants, here, is "block quick").
2017-08-17 09:13:32 -05:00
sebres fdcd847f4a Merge branch '0.10' into 0.11 2017-08-16 21:26:00 +02:00
sebres 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 870a33247b Merge branch '0.10' into 0.11 2017-08-16 20:54:53 +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 aa140f0fa7 Merge branch 0.10 to 0.11, restores merge-point after rebased PR gh-1866 (mistakenly created and merged on 0.11th base); 2017-08-16 17:58:52 +02:00
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
Serg G. Brester 7c01a9c7b9 Merge pull request #1866 from koeppea/patch-1
Update pf.conf fixing #1863: erroneous flush of all rulesets, also not created with fail2ban.
2017-08-16 17:49:30 +02:00
sebres 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 3f83b22de2 action.d/pf.conf: anchored call arguments combined as <pfctl> parameter;
test cases fixed;
2017-08-16 11:58:39 +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
Alexander Köppe 55baf93635 Update pf.conf fixing #1863
Fix #1863
Introduce own PF anchors for fail2ban rules.
2017-08-16 11:33:45 +02:00
sebres 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 099e35103f Merge branch '0.10' into 0.11 2017-08-14 18:31:52 +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
Serg G. Brester 409de18a65 Update README.md
0.11: CI stats, etc.
2017-08-10 15:45:50 +02:00
Serg G. Brester b5dd5adb08 Merge pull request #1460 from sebres/0.10-full
0.11 ban-time-incr
2017-08-10 15:23:18 +02:00
sebres 1c06a8b1ef 0.11 - prepared new development edition: README.md, ChangeLog, version.py 2017-08-10 15:19:43 +02:00
Viktor Szépe c88f5e9038 Monit files are moved
/etc/monitrc.d -> /etc/monit/conf-available
http://anonscm.debian.org/cgit/collab-maint/monit.git/commit/?id=0bcc9189cb4f43863f08b2423cc54097a3e124ef

Was #896
2017-08-10 15:18:49 +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
Yaroslav Halchenko 8c218d566b changelog to upload to unstable 2017-08-03 22:50:58 -04: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
sebres d2c39d2e45 Merge branch '0.10' into 0.10-full
# Conflicts:
#	fail2ban/server/database.py - resolved and test-case with persistent ban-time fixed/extended (bantime presents in database)
2017-06-16 09:35:27 +02:00
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 8403eab2c4 Merge branch '0.10-incr-dynamic-bantime' into 0.10-full 2017-05-17 21:30:20 +02:00
sebres 17a03ebc11 changelog update / typos fixed 2017-05-17 21:03:35 +02:00
sebres 1842f30359 [ticket] remove unneeded code - ticket will be just wrapped from FailTicket to BanTicket;
normalize increment of ban-count or time (count increased in BanManager now, some dual increments fixed in the test-cases);
introduced new action-tag `<bancount>`, that is always incremented by each ban (starting by 1), opposite to tag `<bantime>` which can be prolonged retarded (up to 10 seconds)
2017-05-17 19:54:52 +02:00
sebres 157a85451a [tickets] use slots in ticket (saves memory, and have better performance); uses the same ticket between Fail- and BanManagers, so makes possible operate with more actual data between workers (e. g. ban count and time by increment from observer) 2017-05-17 17:58:26 +02:00
sebres b893356c49 avoid sporadic errors on time-related test-cases: observer can prolong ticket (increase ban-time) before banning, so blocked before banFound called, to test prolong case. 2017-05-17 15:40:24 +02:00
sebres c21b4e4d56 [ban-time-incr] prolong ban, dynamic bantime, etc.:
- dynamic bantime: introduces new action-tag `<bantime>` corresponds to the current ban-time of the ticket;
  Note: because it is dynamic, it should be normally removed from `jail.conf` (resp. `jail.local`).
- introduced new action command `actionprolong`, used for prolongation of the timeout (ban-time of the ticket);
- removed default `timeout` from `actionstart` of several actions;
- faster and safer function escapeTag (replacement at once in one run, '\n' and '\r' escaped also);
2017-05-17 13:25:06 +02:00
sebres 54729f9ef3 Merge branch '0.10' into 0.10-full 2017-05-17 12:24:01 +02:00
sebres 9b83a3128d code review, try to increase coverage 2017-05-17 12:23:28 +02:00
sebres 6724de54e6 Merge branch '0.10' into 0.10-full 2017-05-17 11:35:33 +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 abb2feafe7 added patch to fix rel symlink for tests to be ran out of source 2017-05-10 23:27:49 -04:00
Yaroslav Halchenko 1561d5fb14 changelog and dropping absorbed patch 2017-05-10 22:11:27 -04:00
Yaroslav Halchenko 96323b1da0 Merge tag '0.9.7' into debian
ver. 0.9.7 (2017/05/11) - awaiting-victory
-----------

0.9.x line is no longer heavily developed.  If you are interested in
new features (e.g. IPv6 support), please consider 0.10 branch and its
releases.

* Fixed a systemd-journal handling in fail2ban-regex (gh-1657)
* filter.d/sshd.conf
    - Fixed non-anchored part of failregex (misleading match of colon inside
      IPv6 address instead of `: ` in the reason-part by missing space, gh-1658)
      (0.10th resp. IPv6 relevant only, amend for gh-1479)
* config/pathes-freebsd.conf
    - Fixed filenames for apache and nginx log files (gh-1667)
* filter.d/exim.conf
    - optional part `(...)` after host-name before `[IP]` (gh-1751)
    - new reason "Unrouteable address" for "rejected RCPT" regex (gh-1762)
    - match of complex time like `D=2m42s` in regex "no MAIL in SMTP connection" (gh-1766)
* filter.d/sshd.conf
    - new aggressive rules (gh-864):
      - 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), according to gh-1206;
    - fixed expression received disconnect auth fail (optional space after port
      part, gh-1652)
      and suffix (logged from several ssh versions), according to gh-1206;
* filter.d/suhosin.conf
    - greedy catch-all before `<HOST>` fixed (potential vulnerability)
* filter.d/cyrus-imap.conf
    - accept entries without login-info resp. hostname before IP address (gh-1707)
* Filter tests extended with check of all config-regexp, that contains greedy catch-all
  before `<HOST>`, that is hard-anchored at end or precise sub expression after `<HOST>`

* New Actions:
    - action.d/netscaler: Block IPs on a Citrix Netscaler ADC (gh-1663)

* New Filters:
    - filter.d/domino-smtp: IBM Domino SMTP task (gh-1603)

* Introduced new log-level `MSG` (as INFO-2, equivalent to 18)

* tag '0.9.7': (33 commits)
  Preparing for 0.9.7 release
  Added newly added files to MANIFEST
  update ChangeLog
  filter.d/exim.conf: added new reason for "rejected RCPT" regex: Unrouteable address
  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
  filter.d/exim.conf: cherry-picked from 0.10, match complex time like `D=2m42s` (closes gh-1766)
  Update ChangeLog #1757
  filter.d/exim.conf: optional part `(...)` after host-name before `[IP]`, normalized over whole config file.
  BF: specify explicit time offset not a time zone name to avoid needing tzdata during testing
  Update ChangeLog
  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)
  Update mysqld-auth.conf
  Update ChangeLog
  filter.d/cyrus-imap.conf: fixed `failregex` - accept entries without login-info resp. hostname before IP address
  evil symlink removed: does not supported by some file systems (e. g. development over net share)
  sshd-amend: optional space after port part
  suhosin.conf: removed greedy match
  sshd.conf: fixed expression "received disconnect ... auth fail" - optional space after port part (gh-1652)
  change log update after rebase
  sshd: additionally aggressive filter rules - no matching cipher resp. no matching key exchange method (gh-1545, gh-1117)
  ...
2017-05-10 21:39:51 -04: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 7e0e9cda50 changelog for the patch 2017-04-17 10:28:43 -04:00
Yaroslav Halchenko 0f3217f352 "cherry-pick" a639f0b083 (BF: specify explicit time offset not a time zone name to avoid needing tzdata during testing) 2017-04-17 10:27:01 -04: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 ef975307c4 errors on closed socket are too sporadic to cover it (prevents "coverage decreased" over and over again) 2017-03-14 16:24:45 +01:00
sebres 5ff63b66a0 Merge branch '0.10' into 0.10-full 2017-03-14 13:36:32 +01:00
sebres 482e5265d7 output execution time of each test case if verbosity > 2 2017-03-14 13:34:54 +01:00
sebres 3cf068670c Merge branch '0.10' into 0.10-full 2017-03-14 11:47:38 +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
sebres 875295320e Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full 2017-03-13 02:12:39 +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 bae38a9fdf Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full 2017-03-01 15:24:28 +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
sebres 4b53c6b975 socket, asyncserver: several fixes, python version dependency removed + test coverage extended 2017-02-28 19:52:44 +01:00
sebres 9129a414e3 small fix (missing import of logging) + test coverage 2017-02-28 17:04:01 +01:00
sebres 28b5262976 Merge branch '0.10' into 0.10-full 2017-02-28 15:14:51 +01:00
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 fa20b0aff2 Merge branch 'py-3.6-compat' into 0.10-full 2017-02-15 19:18:35 +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 a4ec017d1c Merge branch '0.10' into 0.10-full 2017-02-15 09:26:01 +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 8c54675750 fix sporadic time related errors after fail2ban restart resp. reload jail:
- ValueError: need more than N values to unpack
- empty banip from restoreCurrentBans, etc.
2017-01-23 11:45:29 +01:00
sebres 0636b3247d observer fix: wait it becomes idle in reload test case (complete writing of failures to database); 2017-01-23 09:52:04 +01:00
sebres 8e2711681c small performance fix after merge with 0.10 2017-01-23 09:51:52 +01:00
sebres 99634638ba Merge branch '0.10' into 0.10-full 2017-01-23 09:51:36 +01:00
sebres 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 eec7c9bbca remove generated symlink under bin/fail2ban-python 2016-12-09 09:45:47 -05:00
Yaroslav Halchenko 6de7c2a127 changelog entry 2016-12-09 09:40:24 -05:00
Yaroslav Halchenko 623bb39ca6 Merge branch 'enh-rel0.9.6' into debian
* enh-rel0.9.6: (60 commits)
  updated man pages
  ENH: prep for 0.9.6 release (as of tomorrow)
  BF: added missing entires into MANIFEST
  Update ChangeLog
  ChangeLog entry added + jail.conf review
  code review, makes the test cases workable, added dev-notes
  ChangeLog update
  `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
  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
  Update jail.conf
  Use Fedora's backend-settings for openSUSE
  amend after code review of merge gh-1581
  Make changes and add test file
  Add Mongodb-auth filter and jail
  Update FILTERS
  filter.d/sshd.conf: Match 'Invalid user' with 'port \d*'
  ChangeLog entry added
  filter.d/sendmail-reject.conf: double space (should be by missing dns-host only) Closes #1578
  Update Changelog to reflect the new np.conf action
  Create npf.conf for the NPF packet filter
  ...
2016-12-09 09:37:33 -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
sebres ce2b4fe634 amend after newest merge of 0.10:
- database duplicate code removed resp. merged with incr. version;
  - ignores expired ban ticket directly in ban manager;
  - don't change start of ban time for restored tickets in restoreCurrentBans (because of possible timing issues in the test-cases);
  - small code review;
2016-10-15 19:53:54 +02:00
sebres cbfecea112 Merge remote-tracking branch 'remotes/gh-upstream/0.10' into 0.10-full 2016-10-15 19:19:58 +02:00
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 53adc9d84a Merge branch 0.10-full with 0.10
Resolved several conflicts and code review after merge
2016-10-14 19:55:20 +02:00
sebres 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 18ebd9ac21 Merge branches 0.10-full and 0.10 2016-08-17 18:00:25 +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 8f42580c05 some typos and TODOs -- thanks lintian 2016-07-15 09:00:29 -04:00
sebres 3bbbe640c0 MANIFEST update for release ban-time-incr version of 0.10 2016-07-15 10:48:02 +02:00
sebres 922213f3d9 Merge tag '0.10.0a1' into 0.10-full 2016-07-15 10:32:42 +02:00
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 1a86683bea Merge tag '0.9.5' into debian
ver. 0.9.5 (2016/07/15) - old-not-obsolete
-----------

0.9.x line is no longer heavily developed.  If you are interested in
new features (e.g. IPv6 support), please consider 0.10 branch and its
releases.

* `filter.d/monit.conf`
    - Extended failregex with new monit "access denied" version (gh-1355)
    - failregex of previous monit version merged as single expression
* `filter.d/postfix.conf`, `filter.d/postfix-sasl.conf`
    - Extended failregex daemon part, matching also `postfix/smtps/smtpd`
      now (gh-1391)
* Fixed a grave bug within tags substitutions because of incorrect
  detection of recursion in case of multiple inline substitutions
  of the same tag (affected actions: `bsd-ipfw`, etc).  Now tracks
  the actual list of the already substituted tags (per tag instead
  of single list)
* `filter.d/common.conf`
    - Unexpected extra regex-space in generic `__prefix_line` (gh-1405)
    - All optional spaces normalized in `common.conf`, test covered now
    - Generic `__prefix_line` extended with optional brackets for the
     date ambit (gh-1421), added new parameter `__date_ambit`
* `gentoo-initd` fixed `--pidfile` bug: `--pidfile` is option of
  `start-stop-daemon`, not argument of fail2ban (see gh-1434)
* `filter.d/asterisk.conf`
    - Fixed security log support for PJSIP and Asterisk 13+ (gh-1456)
    - Improved log support for PJSIP and Asterisk 13+ with different
      callID (gh-1458)

* New Actions:
    - `action.d/firewallcmd-rich-rules` and `action.d/firewallcmd-rich-logging`
        (gh-1367)
* New filters:
    - slapd - ban hosts, that were failed to connect with invalid
        credentials: error code 49 (gh-1478)

* Extreme speedup of all sqlite database operations (gh-1436),
  by using of following sqlite options:
    - (synchronous = OFF) write data through OS without syncing
    - (journal_mode = MEMORY) use memory for the transaction logging
    - (temp_store = MEMORY) temporary tables and indices are kept in memory
* journald journalmatch for pure-ftpd (gh-1362)
* Added additional regex filter for dovecot ldap authentication failures (gh-1370)
* `filter.d/exim*conf`
    - Added additional regexes (gh-1371)
    - Made port entry optional

* tag '0.9.5':
  Added missing files to MANIFEST
  BF: do not rely on long relative path to upstairs config - symlink common.conf
2016-07-14 22:25:40 -04: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 944c24f2d1 debian/watch -- not using githubredir service any longer 2016-07-14 21:46:14 -04:00
Yaroslav Halchenko 9a1960369c CPed patch dropped now 2016-07-14 21:43:32 -04:00
Yaroslav Halchenko 401173c2a6 changelog 2016-07-14 21:43:29 -04:00
Yaroslav Halchenko bbbe592788 Merge tag '0.9.5' into debian
ver. 0.9.5 (2016/07/15) - old-not-obsolete
-----------

0.9.x line is no longer heavily developed.  If you are interested in
new features (e.g. IPv6 support), please consider 0.10 branch and its
releases.

* `filter.d/monit.conf`
    - Extended failregex with new monit "access denied" version (gh-1355)
    - failregex of previous monit version merged as single expression
* `filter.d/postfix.conf`, `filter.d/postfix-sasl.conf`
    - Extended failregex daemon part, matching also `postfix/smtps/smtpd`
      now (gh-1391)
* Fixed a grave bug within tags substitutions because of incorrect
  detection of recursion in case of multiple inline substitutions
  of the same tag (affected actions: `bsd-ipfw`, etc).  Now tracks
  the actual list of the already substituted tags (per tag instead
  of single list)
* `filter.d/common.conf`
    - Unexpected extra regex-space in generic `__prefix_line` (gh-1405)
    - All optional spaces normalized in `common.conf`, test covered now
    - Generic `__prefix_line` extended with optional brackets for the
     date ambit (gh-1421), added new parameter `__date_ambit`
* `gentoo-initd` fixed `--pidfile` bug: `--pidfile` is option of
  `start-stop-daemon`, not argument of fail2ban (see gh-1434)
* `filter.d/asterisk.conf`
    - Fixed security log support for PJSIP and Asterisk 13+ (gh-1456)
    - Improved log support for PJSIP and Asterisk 13+ with different
      callID (gh-1458)

* New Actions:
    - `action.d/firewallcmd-rich-rules` and `action.d/firewallcmd-rich-logging`
	(gh-1367)
* New filters:
    - slapd - ban hosts, that were failed to connect with invalid
	credentials: error code 49 (gh-1478)

* Extreme speedup of all sqlite database operations (gh-1436),
  by using of following sqlite options:
    - (synchronous = OFF) write data through OS without syncing
    - (journal_mode = MEMORY) use memory for the transaction logging
    - (temp_store = MEMORY) temporary tables and indices are kept in memory
* journald journalmatch for pure-ftpd (gh-1362)
* Added additional regex filter for dovecot ldap authentication failures (gh-1370)
* `filter.d/exim*conf`
    - Added additional regexes (gh-1371)
    - Made port entry optional

* tag '0.9.5': (70 commits)
  DOC: preparations for 0.9.5 release
  Added missing files to MANIFEST
  another variant of regex
  add trailing anchor to failregex
  DOC: Reformatted ChangeLog into legit Markdown (Closes #962)
  DOC: tuned up ChangeLog entries for 0.9.5
  add PR id to ChangeLog
  improved failregex according to @sebres recomendations
  Improved changes of gh-1458:   `[^']*` after callid was wrong, changed to `[^\)]*`;   regexp anchored at the end;   almost the same regex grouped to one;
  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
  * 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
  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
  amend for new option of `usedns=raw` - forgotten validation fix inside setUseDns
  RF: for consistency use (?:XXX)? instead of (?:|XXX)
  ...
2016-07-14 21:36:59 -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 334bfd50ff Merge branch '0.10' into 0.10-full 2016-06-12 15:12:50 +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
sebres facda17945 Prevent travis failure with "The log length has exceeded the limit of 4 MB. The job has been terminated" 2016-06-10 02:12:11 +02:00
sebres 12ff119841 Merge branch 'ban-time-incr' into 0.10-full 2016-06-09 22:50:31 +02:00
sebres e3ab10196e Merge remote-tracking branch 'remotes/gh-origin/f2b-perfom-prepare-716-cs-0.10' into 0.10-full 2016-06-09 22:13:48 +02:00
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
Yaroslav Halchenko 9664406719 Merge pull request #1404 from Aeyoun/patch-1
Assert https not http
2016-04-30 12:23:47 -04:00
Daniel Aleksandersen 75eb240846 Assert https not http
Resolves test regression from issue #1395.
2016-04-30 16:18:56 +02:00
Yaroslav Halchenko 2948026a60 Merge pull request #1395 from Aeyoun/patch-2
Use HTTPS in Debuggex URLs
2016-04-27 21:14:16 -04:00
Yaroslav Halchenko d7b0a2f249 Merge pull request #1397 from jungle-boogie/patch-1
update doc url
2016-04-27 21:13:55 -04:00
Yaroslav Halchenko d2f1de5da8 Merge pull request #1400 from yarikoptic/bf-cymru
BF+ENH: fixed up testing querying cymru information + assert_dict_equal
2016-04-27 08:36:42 -04:00
Yaroslav Halchenko 340a5a23f4 BF+ENH: fixed up testing querying cymru information + assert_dict_equal helper 2016-04-26 09:30:36 -04:00
jungle-boogie d889918f19 update doc url
direct to confluence page. no code changes.
2016-04-24 21:35:18 -07:00
Daniel Aleksandersen add67227f4 Use HTTPS in Debuggex URLs 2016-04-24 02:20:02 +02:00
Yaroslav Halchenko aa303acfd6 Merge pull request #1381 from theDogOfPavlov/patch-3
Tightened up exim regexes to catch rDNS entries
2016-04-23 18:27:38 -04:00
sebres e595fefc9b change log and thanks entries 2016-04-14 14:50:17 +02:00
Alexandre Perrin 7712310d2d Be more backward compatible on matching postfix/smtps/smtpd
Support trailing smtps also and not only smtpd.

suggested by @sebres
2016-04-14 13:54:58 +02:00
Alexandre Perrin 1a299409e5 Fix postfix/smtps/smtpd matching. 2016-04-14 12:10:58 +02:00
Alexey Korepanov 5773eb71b8 ensure /var/run/fail2ban is created in systemd service file 2016-04-12 21:20:19 +01:00
theDogOfPavlov fcca1413b0 rDNS tests
added additional tests to cover logs with rDNS
2016-04-01 18:47:19 +01:00
theDogOfPavlov 1eb51b1bc2 Tightened up regexes to catch rDNS entries 2016-04-01 18:07:01 +01:00
Yaroslav Halchenko 1153c0a5c6 Merge pull request #1359 from yarikoptic/bf-blocktype
BF: Include iptables-common (not removed iptables-blocktype) within firewallcmd- actions
2016-04-01 07:19:28 -04:00
sebres 9d7e860edb possibility to increase verbosity up to heavy debug (partial ported from 716-cs) 2016-04-01 10:38:11 +02:00
Yaroslav Halchenko db2dd070ad Merge pull request #1356 from opoplawski/bug-1354
Fedora use mariadb by default, fix log path
2016-03-31 22:11:10 -04:00
Serg G. Brester b9b7ecbf6b Merge pull request #1357 from sebres/monit-new-fltr
monit filter fixup for the new version (gh-1355)
2016-03-26 11:39:26 +01:00
TorontoMedia 3d239215cd Two new firewalld actions with rich rules for firewalld-0.3.1+ (gh-1367)
closes #1367
2016-03-25 17:28:30 +01:00
sebres ac27c9cb96 Merge branch 'patch-2' (gh-1371) 2016-03-25 17:05:23 +01:00
Serg G. Brester 0effe76971 Merge pull request #1370 from theDogOfPavlov/patch-1
Added regex for LDAP authentication failures
2016-03-25 15:30:39 +01:00
Serg G. Brester fad4121709 Merge pull request #1365 from jblachly/sshd-pam-failed
SmartOS PAM Authentication failed (not failURE)
2016-03-24 13:47:49 +01:00
jblachly e9202fa0b2 Placed failure (illumos) at end of regex 2016-03-24 00:43:15 -04:00
theDogOfPavlov 33ef2311e7 added tests to cover exim regex additions 2016-03-23 11:58:03 +00:00
theDogOfPavlov 28e246b5d7 added note to cover additional exim filters 2016-03-23 11:52:09 +00:00
theDogOfPavlov 42f43d0f8a added note to cover dovecot ldap regex 2016-03-23 11:51:12 +00:00
theDogOfPavlov eaf6bbb08f add test to catch LDAP auth failures 2016-03-23 11:47:31 +00:00
theDogOfPavlov fe1475be95 Additional exim regexes to cover common attacks... 2016-03-21 05:59:59 +00:00
theDogOfPavlov cf2aa9c1c0 Added regex for LDAP authentication failures 2016-03-21 05:53:23 +00:00
jblachly 25c2334bc8 SmartOS PAM Authentication failed (not failURE)
SmartOS (and likely other Illumos platforms) enter log entries for failed sshd logins of the form:
`Authentication failed for USER from HOST`
The current sshd.conf regex matches `failure` -- add to this a match for `failed` to support Illumos
2016-03-16 13:52:01 -04:00
Yaroslav Halchenko bfac42eb2e changelog for journalmatch pure-ftpd 2016-03-14 11:10:28 -04:00
Yaroslav Halchenko 86024f745b Merge pull request #1362 from weberhofer/patch-2
define journalmatch setting for pure-ftps
2016-03-14 11:09:16 -04:00
Johannes Weberhofer bd25a43417 define journalmatch setting for pure-ftps 2016-03-11 18:19:53 +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 eed1a0d686 BF: Include iptables-common (not removed iptables-blocktype) within firewallcmd- actions (Closes #1254) 2016-03-09 23:06:59 -05: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
Orion Poplawski f3f813a925 - mysqld does not log login attempts to the journal.
- Add /var/log/mysqld.log to mysql_log
2016-03-09 13:52:50 -07:00
sebres 9d13bb0c3a ChangeLog and THANKS entries 2016-03-09 20:11:14 +01:00
sebres 37c9075fad fixed monit filter: failregex find now both previous and new versions:
- failregex of previous monit version merged as single expression;
- extended failregex with new monit "access denied" version;
2016-03-09 20:06:14 +01:00
Orion Poplawski dfc65018da Fedora use mariadb by default, fix log path 2016-03-09 11:36:06 -07:00
Yaroslav Halchenko d533c0761d Merge pull request #1349 from yarikoptic/bf-tests-use-configdir
BF: use tests.utils.CONFIG_DIR instead of fixed one (Closes #1348)
2016-03-08 09:11:34 -05:00
Yaroslav Halchenko 634e68036e Get ready for further developments 2016-03-08 08:36:29 -05:00
Yaroslav Halchenko 27a3997f19 added a patch to use CONFIG_DIR variable which listens to envrion 2016-03-07 22:46:45 -05:00
Yaroslav Halchenko bb0dc17a87 BF: use tests.utils.CONFIG_DIR instead of fixed one (Closes #1348) 2016-03-07 22:40:36 -05:00
Yaroslav Halchenko c188acd8ef policy boost 2016-03-07 21:55:17 -05:00
Yaroslav Halchenko a525a24cb1 changelog entry 2016-03-07 21:55:02 -05:00
Yaroslav Halchenko 45dce3cab0 Merge tag '0.9.4' into debian
ver. 0.9.4 (2016/03/08) - for-you-ladies
-----------

- Fixes:
   * roundcube-auth jail typo for logpath
   * Fix dnsToIp resolver for fqdn with large list of IPs (gh-1164)
   * filter.d/apache-badbots.conf
     - Updated useragent string regex adding escape for `+`
   * filter.d/mysqld-auth.conf
     - Updated "Access denied ..." regex for MySQL 5.6 and later (gh-1211, gh-1332)
   * filter.d/sshd.conf
     - Updated "Auth fail" regex for OpenSSH 5.9 and later
   * Treat failed and killed execution of commands identically (only
     different log messages), which addresses different behavior on different
     exit codes of dash and bash (gh-1155)
   * Fix jail.conf.5 man's section (gh-1226)
   * Fixed default banaction for allports jails like pam-generic, recidive, etc
     with new default variable `banaction_allports` (gh-1216)
   * Fixed `fail2ban-regex` stops working on invalid (wrong encoded) character
     for python version < 3.x (gh-1248)
   * Use postfix_log logpath for postfix-rbl jail
   * filters.d/postfix.conf - add 'Sender address rejected: Domain not found' failregex
   * use `fail2ban_agent` as user-agent in actions badips, blocklist_de, etc (gh-1271)
   * Fix ignoring the sender option by action_mw, action_mwl and action_c_mwl
   * Changed filter.d/asterisk regex for "Call from ..." (few vulnerable now)
   * Removed compression and rotation count from logrotate (inherit them from
     the global logrotate config)

- New Features:
   * New interpolation feature for definition config readers - `<known/parameter>`
     (means last known init definition of filters or actions with name `parameter`).
     This interpolation makes possible to extend a parameters of stock filter or
     action directly in jail inside jail.local file, without creating a separately
     filter.d/*.local file.
     As extension to interpolation `%(known/parameter)s`, that does not works for
     filter and action init parameters
   * New actions:
     - nftables-multiport and nftables-allports - filtering using nftables
       framework. Note: it requires a pre-existing chain for the filtering rule.
   * New filters:
     - openhab - domotic software authentication failure with the
       rest api and web interface (gh-1223)
     - nginx-limit-req - ban hosts, that were failed through nginx by limit
       request processing rate (ngx_http_limit_req_module)
     - murmur - ban hosts that repeatedly attempt to connect to
       murmur/mumble-server with an invalid server password or certificate.
     - haproxy-http-auth - filter to match failed HTTP Authentications against a
       HAProxy server
   * New jails:
     - murmur - bans TCP and UDP from the bad host on the default murmur port.
   * sshd filter got new failregex to match "maximum authentication
     attempts exceeded" (introduced in openssh 6.8)
   * Added filter for Mac OS screen sharing (VNC) daemon

- Enhancements:
   * Do not rotate empty log files
   * Added new date pattern with year after day (e.g. Sun Jan 23 2005 21:59:59)
     http://bugs.debian.org/798923
   * Added openSUSE path configuration (Thanks Johannes Weberhofer)
   * Allow to split ignoreip entries by ',' as well as by ' ' (gh-1197)
   * Added a timeout (3 sec) to urlopen within badips.py action
     (Thanks M. Maraun)
   * Added check against atacker's Googlebot PTR fake records
     (Thanks Pablo Rodriguez Fernandez)
   * Enhance filter against atacker's Googlebot PTR fake records
     (gh-1226)
   * Nginx log paths extended (prefixed with "*" wildcard) (gh-1237)
   * Added filter for openhab domotic software authentication failure with the
     rest api and web interface (gh-1223)
   * Add *_backend options for services to allow distros to set the default
     backend per service, set default to systemd for Fedora as appropriate
   * Performance improvements while monitoring large number of files (gh-1265).
     Use associative array (dict) for monitored log files to speed up lookup
     operations. Thanks @kshetragia
   * Specified that fail2ban is PartOf iptables.service firewalld.service in
     .service file -- would reload fail2ban if those services are restarted
   * Provides new default `fail2ban_version` and interpolation variable
     `fail2ban_agent` in jail.conf
   * Enhance filter 'postfix' to ban incoming SMTP client with no fqdn hostname,
     and to support multiple instances of postfix having varying suffix (gh-1331)
     (Thanks Tom Hendrikx)
   * files/gentoo-initd to use start-stop-daemon to robustify restarting the service

* tag '0.9.4': (138 commits)
  MANIFEST RELEASE and man pages updates
  Changes for the 0.9.4 release
  datedetector: epoch time expression fix (now 10-11 chars, only whole number - anchored ^...\b or by special case within [], audit()) + test cases extended (positive/negative)
  changelog about gentoo initd
  added wp-admin
  ENH(TST): a hypothetical example to show/test needing trailing anchoring
  ENH: revert back to having detailed suffix anchored at the end for mysqld-auto.conf
  Changelog for the recent PR and added Tom to THANKS
  mysqld: failregex fixed (accepts different log level, more secure expression now); closes #1332
  Add support for matching postfix multi-instance daemon names by default
  DOC: removed Nick from listed as FreeBSD maintainer
  DOC: adjusted ISSUE_TEMPLATE.md picking on @sebres's version
  ENH: github templates for issues and PRs
  ENH: add codecov support to travis.yml and bandge to README.md
  gentoo-initd: Use start-stop-daemon in order to handle crashes better
  regexp rewritten (few vulnerable as previous) + test case added
  Update asterisk filter: changed regex for "Call from ...". Sometimes extension can have a plus symbol (+) because they can be phone number. Closes #1309
  Add new regex into postfix filter. The new regexp is able to detect bad formatted SMTP EHLO command
  Remove compression and count from logrotate
  gentoo-initd: do not hide useful output
  ...
2016-03-07 21:50:47 -05:00
Yaroslav Halchenko 0298ba2c1b MANIFEST RELEASE and man pages updates 2016-03-07 21:50:10 -05:00
Yaroslav Halchenko 5ffc15ac68 Changes for the 0.9.4 release 2016-03-07 21:45:44 -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
Yaroslav Halchenko 150007b128 Merge pull request #1345 from sebres/dd-epoch-time-fix
datedetector: epoch time expression fix
2016-03-07 13:05:11 -05:00
sebres e075815833 datedetector: epoch time expression fix (now 10-11 chars, only whole number - anchored ^...\b or by special case within [], audit()) + test cases extended (positive/negative) 2016-03-07 17:57:22 +01:00
sebres dca3db941e merge getTime2 functionality to getTime 2016-03-07 17:28:37 +01:00
Yaroslav Halchenko 19850d71e9 changelog about gentoo initd 2016-03-07 10:52:47 -05:00
Yaroslav Halchenko 5106b5943a Merge pull request #1322 from jsuter1/master
gentoo-initd: Use start-stop-daemon in order to handle crashes better
2016-03-07 10:51:14 -05:00
Yaroslav Halchenko 385b50e4a9 Merge pull request #1343 from denics/master
adding wp-admin to bot search
2016-03-07 10:23:37 -05:00
Yaroslav Halchenko ec54b74921 Merge pull request #1338 from yarikoptic/enh-return-mysql-suffix-back
Enh return mysql suffix back
2016-03-07 10:21:26 -05:00
sebres 1ec6782f32 fix test cases by testing with multi-threaded execution (wait for threaded execution done) 2016-03-06 18:37:52 +01:00
sebres bf0adc1fdf Merge remote-tracking branch 'f2b-perfom-prepare-716-cs' into ban-time-incr (+ conflicts resolved) 2016-03-06 15:12:48 +01:00
Denix ed0e572bfc added wp-admin
bot are very annoying and I am getting a lot of checks on wp-admin. This should calm them.
2016-03-02 16:52:03 +01:00
Denix 04e932baa2 Merge pull request #1 from fail2ban/master
sync fork
2016-03-02 16:48:51 +01:00
Yaroslav Halchenko a11c878fb2 ENH(TST): a hypothetical example to show/test needing trailing anchoring 2016-02-28 12:12:36 -05:00
Yaroslav Halchenko 6ffbc1ffad ENH: revert back to having detailed suffix anchored at the end for mysqld-auto.conf
As discussed in https://github.com/fail2ban/fail2ban/pull/1333#discussion_r54100127
2016-02-28 12:07:46 -05:00
Yaroslav Halchenko 2adf5855ac Changelog for the recent PR and added Tom to THANKS 2016-02-28 12:03:13 -05:00
Yaroslav Halchenko 3e31145c33 Merge pull request #1331 from whyscream/postfix-multi-instance-support
Add support for matching postfix multi-instance daemon names by default
2016-02-28 12:00:24 -05:00
sebres 667785b608 mysqld: failregex fixed (accepts different log level, more secure expression now);
closes #1332
2016-02-24 17:17:51 +01:00
Tom Hendrikx 6c606cf98f Add support for matching postfix multi-instance daemon names by default 2016-02-23 20:23:04 +01:00
Yaroslav Halchenko bd822d02a4 DOC: removed Nick from listed as FreeBSD maintainer 2016-02-22 09:13:30 -05:00
Yaroslav Halchenko 8b00ca2744 Merge pull request #1327 from yarikoptic/enh-cov-templates
ENH: use codecov + templates for PRs and issues
2016-02-21 09:56:17 -05:00
Yaroslav Halchenko 705b91e6a7 DOC: adjusted ISSUE_TEMPLATE.md picking on @sebres's version 2016-02-20 11:20:33 -05:00
Yaroslav Halchenko 9667c4cb42 ENH: github templates for issues and PRs 2016-02-17 21:20:51 -05:00
Yaroslav Halchenko 72638975a9 ENH: add codecov support to travis.yml and bandge to README.md 2016-02-17 20:43:50 -05:00
Jack Suter fb779a78c5 gentoo-initd: Use start-stop-daemon in order to handle crashes better
Currently, if fail2ban is killed (or crashes), its status will be
reported by '/etc/init.d/fail2ban status' as 'running' even though it
is not. Attempting to restart the service also fails, because Gentoo
unsuccessfully tries to stop the service.

By using start-stop-daemon and providing a pidfile, Gentoo will
instead report the status as 'crashed' and allow the service to be
restarted as normal.
2016-02-16 01:46:27 -05:00
sebres 27659c85e6 Merge remote-tracking branch 'master' into f2b-perfom-prepare-716-cs 2016-02-15 21:03:51 +01:00
sebres 70c329e235 increase verbosity for travis/py3 (currently "debug", use "heavydebug" for more details if needed) 2016-02-15 20:44:35 +01:00
sebres 95af3c63ac increase readability and details level by increased verbosity 2016-02-15 20:42:12 +01:00
sebres 0fef5022f0 reader bug fix: prevent to silent "load" of not existing jail;
coverage of test cases increased;
2016-02-15 20:41:20 +01:00
sebres 4ec70d7851 code review, timeout fix, better tracing (and test coverage) by start of server/client (with or without fork) 2016-02-15 19:19:31 +01:00
sebres 6cd19894e9 some compatibility fixes (prevent forking of testcase-process, code review), wait 4 server ready, test cases fixed (py2/py3) 2016-02-15 14:41:12 +01:00
sebres 0e11d81adb several bug fixed: fork in client-server test cases prohibited, all worker threads daemonized (to prevent hanging on exit). 2016-02-11 21:39:06 +01:00
sebres f120877756 client/server (bin) test cases introduced, ultimate closes #1121, closes #1139
small code review and fixing of some bugs during client-server communication process (in the test cases);
2016-02-11 17:57:23 +01:00
Yaroslav Halchenko 905c87ca4a Merge pull request #1310 from yarikoptic/pr-1288
NF: HAProxy HTTP Auth filter
2016-02-11 08:35:48 -05:00
sebres 4d696d69a0 starting of the server (and client/server communication behavior during start and daemonize) completely rewritten:
- client/server functionality moved away from bin and using now the common interface (introduced in fail2bancmdline);
  - start in foreground fixed;
  - server can act as client corresponding command line;
  - command "restart" added: in opposite to "reload" in reality restarts the server (new process);
  - several client/server bugs during starting process fixed.
2016-02-11 08:56:12 +01:00
sebres 3fda77227e temporary commit (move client/server from bin) 2016-02-11 08:52:41 +01:00
Yaroslav Halchenko 3dc57af19c Merge branch 'logrotate' of https://github.com/sbraz/fail2ban
* 'logrotate' of https://github.com/sbraz/fail2ban:
  Remove compression and count from logrotate
2016-02-10 18:41:01 -05:00
sebres 44490664f5 try to start server in foreground
# Conflicts:
#	fail2ban/server/server.py
2016-02-10 22:00:42 +01:00
Yaroslav Halchenko 09bc2e978d Merge pull request #1319 from sebres/asterisk-gh1309
Asterisk regexp fix to catch phone # and relax trailing anchoring

 (replacement for Update asterisk.conf gh-1309)
2016-02-08 10:58:53 -05:00
sebres d8e81eb417 regexp rewritten (few vulnerable as previous) + test case added 2016-02-08 12:01:25 +01:00
3eBoP 257b7049d8 Update asterisk filter: changed regex for "Call from ...". Sometimes extension can have a plus symbol (+) because they can be phone number.
Closes #1309
2016-02-08 11:51:37 +01:00
Pierre GINDRAUD b5a07741c8 Add new regex into postfix filter. The new regexp is able to detect bad formatted SMTP EHLO command 2016-02-08 11:11:59 +01:00
Yaroslav Halchenko b435e1e4c8 Merge pull request #1311 from sbraz/gentoo-init
gentoo-initd: do not hide useful output
2016-01-29 09:54:35 -05:00
Louis Sautier 869d99dd37 Remove compression and count from logrotate
Initially reported at https://bugs.gentoo.org/show_bug.cgi?id=549856
2016-01-29 00:15:48 +01:00
Louis Sautier 294a7790a9 gentoo-initd: do not hide useful output
Gentoo applies a patch for this: https://bugs.gentoo.org/show_bug.cgi?id=536320
2016-01-28 23:40:36 +01:00
Yaroslav Halchenko 3f437b32db Merge remote-tracking branch 'pr/1288/head'
* pr/1288/head:
  Update haproxy-http-auth.conf
  Added HAProxy HTTP Auth filter

 Conflicts:
	config/jail.conf - resolved + removed unnecessary filter/enabled (defaults should be as good)
2016-01-28 08:51:45 -05:00
Yaroslav Halchenko 377ea32441 Merge pull request #1295 from obounaim/master
The sender option is ignored by some actions
2016-01-28 08:48:22 -05:00
Serg G. Brester fe14c8fa05 Merge pull request #1292 from albel727/master
Add nftables actions
2016-01-24 23:55:50 +01:00
Jordan Moeser d7b46509d8 Update haproxy-http-auth.conf
Updated failregex to be more strict
2016-01-12 08:37:33 +10:00
local 58a8736e0f Updating changelog. 2016-01-10 00:10:05 +01:00
local 40c0bed82c action_mw, action_mwl, action_cf_mwl ignore the "sender" option when sending a notification email.
This commit adds "sender="%(sender)s"" to the three actions to correct this issue.
2016-01-10 00:05:03 +01:00
Yaroslav Halchenko 5d0d96a5cb Merge pull request #1286 from yarikoptic/enh-jail
ENH: harmonize jail.conf + 1 more test that passed bantime is non-degenerate and int
2016-01-08 08:51:08 -05:00
Alexander Belykh 985e8938a4 Refactor nftables actionstop into smaller parts 2016-01-06 17:39:54 +06:00
Alexander Belykh 9779eeb986 Add nftables_type/family/table parameters 2016-01-06 17:33:14 +06:00
Alexander Belykh 260c30535d Escape curly braces in nftables actions 2016-01-06 17:13:30 +06:00
Alexander Belykh 1983e15580 Add empty line between parameters in nftables-common.conf 2016-01-06 16:55:29 +06:00
Alexander Belykh cb2d70d7a8 Add ChangeLog entry for new nftables actions 2016-01-05 19:04:44 +06:00
Alexander Belykh f7f91a8bd4 Refactor common code out of nftables-multiport/allports.conf 2016-01-05 19:03:47 +06:00
sebres 25a09352e4 + ChangeLog entry 2016-01-04 14:46:43 +01:00
sebres 69f5623f83 code simplifying (remove duplication): agent will be always supplied as parameter from jail.conf 2016-01-04 09:30:32 +01:00
Alexander Belykh 618e97bce8 Add nftables actions 2016-01-04 01:36:28 +06:00
sebres ac31121432 amend to fix fail2ban-version: correct user-agent for badips.py "Fail2Ban/ver", changeable within jail/config now; 2015-12-31 02:32:17 +01:00
Jordan Moeser e133762a28 Added HAProxy HTTP Auth filter 2015-12-31 11:16:23 +10:00
sebres cf334421bd Provides fail2ban version to jail (as interpolation variable during parse of jail.conf);
BF: use `fail2ban_agent` as user-agent in actions badips, blocklist_de, etc. (closes #1271, closes #1272)
2015-12-31 01:38:25 +01:00
Yaroslav Halchenko b76aede40d ENH(TST): verify that passed bantime is non-0 and int 2015-12-29 20:22:06 -05:00
Yaroslav Halchenko 28c9832293 RF: harmonize jail.conf (no explicit enabled=false in jails, match filter name for screesharingd, etc) 2015-12-29 19:43:52 -05:00
Yaroslav Halchenko 69aa1feac0 Merge "Mac OS Screen Sharing filter" PR 1232
* pr/1232/head:
  removed system.log
  Removed old svn revision comment
  removed false matches
  Removed includes comment for screensharing jail
  Now using a literal logpath for screensharing jail
  Fixed blatant typo in regex
  clarified comments on sample log format
  Fixed name (again?)
  Made screensharing jail off by default
  Changed regex prequel
  added entry for new screensharingd filter
  name change & new sample data
  Added json metadata
  Sample log for test case
  Replaced .* with literal
  Update jail.conf
  Added new path variable for system.log
  Added in settings for screensharingd filter
  Created file

Conflicts:
	ChangeLog - moved to New Features
	config/jail.conf  - kept at the end
2015-12-29 19:36:59 -05:00
Yaroslav Halchenko 16710237e3 Merge remote-tracking branch 'origin/master'
* origin/master:
  Add 'Sender address rejected: Domain not found' Postfix failregex
2015-12-29 19:31:04 -05:00
sebres 6daa152c0c Merge branch 'f2b-perfom-prepare-716' into ban-time-incr 2015-12-29 19:53:07 +01:00
sebres b3d4ce291e start observer together with the server (parametrized to prevent constantly start/stop of observer by addJail in test cases) 2015-12-29 19:52:16 +01:00
sebres 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 9d4f163e88 code review and minor repair after merge with performance branch (changed naming convention, wrong resolved conflicts, etc) 2015-12-29 17:36:00 +01:00
sebres 21f058a9f7 Merge remote-tracking branch 'remotes/gh-origin/f2b-perfom-prepare-716' into ban-time-incr 2015-12-29 14:04:41 +01:00
sebres 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
Yaroslav Halchenko 26dd6d7425 Merge pull request #1258 from aleksandrs-ledovskis/feature/postfix-domain-not-found-failregex
Add 'Sender address rejected: Domain not found' Postfix failregex
2015-12-18 09:23:54 -05:00
Yaroslav Halchenko dfaf82d68a Changelog entry for PartOf in .service fix 2015-12-18 09:23:12 -05:00
Yaroslav Halchenko 9f15d02910 Merge pull request #1251 from fastest963/master
Added PartOf to service file so f2b restarts when deps do
2015-12-18 09:21:43 -05:00
Yaroslav Halchenko edcbdf6eab Merge pull request #1264 from rbrownwsws/master
Added filter and jail for murmur/mumble-server.
2015-12-18 09:20:45 -05:00
Yaroslav Halchenko 39d202b623 Merge pull request #1273 from yarikoptic/enh-log-matchtuple
ENH: log at heavydebug level what actually we are matching for failregex
2015-12-18 09:20:02 -05:00
Ross Brown 8d12dba245 Merge remote-tracking branch 'upstream/master' 2015-12-17 18:01:17 +00:00
Ross Brown 16aa2fa13e Updated ChangeLog to include new murmur jail. 2015-12-17 17:57:45 +00:00
Ross Brown ead2d509dc Updated 'murmur' filter to use new double-anchored regex based on @yarikoptic's suggestions. 2015-12-17 17:45:24 +00:00
Yaroslav Halchenko 61b2653f9e Merge pull request #1274 from yarikoptic/enh-new-sshd-too-many
ENH: sshd filter -- match new "maximum auth attempts exceeded"
2015-12-16 06:58:47 -05:00
Ross Brown fd36b058ce Changed usernames in sample log file for 'murmur' filter. 2015-12-15 21:55:07 +00:00
Ross Brown ba535826a8 Updated ChangeLog to include new murmur filter. 2015-12-15 21:46:35 +00:00
Yaroslav Halchenko 5d6cead996 ENH: sshd filter -- match new "maximum auth attempts exceeded" (Closes #1269) 2015-12-13 23:21:04 -05:00
Yaroslav Halchenko 9ee08fed48 ENH: log at heavydebug level what actually we are matching for failregex 2015-12-13 23:06:02 -05:00
sebres 6d984717b5 ordered dict replaced with dict + change log entry fix
# Conflicts:
#	fail2ban/server/filter.py
2015-12-12 15:48:49 +01:00
Yaroslav Halchenko 48202f998d RF: prefer log over container in getLog and local variables
Even though I have left FileContainer class name intact
2015-12-02 22:57:40 -05:00
Yaroslav Halchenko 59da27b9f6 ENH: add a check to testTail to assure correct test logic below it 2015-12-02 22:53:28 -05:00
Yaroslav Halchenko dd9d1912e8 RF: Filter.getLogPaths -> getLogs
Since it returns log containers not paths per se
2015-12-02 22:49:47 -05:00
sebres 6ce7522d3c unordered (python 2.6) compatibility fix and coverage extended; 2015-12-02 21:29:27 +01:00
sebres 3a179ec5d7 small code review: (much pretty) handling of filename as key - FileFilter contains (ordered) dict of files (not list), as discussed in gh-1265 2015-12-02 20:45:01 +01:00
Ross Brown 4c837f0333 Added sample log file for 'murmur' filter. 2015-11-29 16:28:47 +00:00
Ross Brown 106c3eab9a Added filter and jail for murmur/mumble-server. 2015-11-29 15:56:56 +00:00
Serg G. Brester 1b0560d2f1 Merge pull request #1262 from sarneaud/gentoo-initd
Small fixes for Gentoo initd script
2015-11-28 21:00:28 +01:00
sarneaud 5b88a84fe8 Small fixes for Gentoo initd script
These fixes are pretty pedantic, but they do simplify the script a
little.

* Checking the existence of a file/directory before creating/deleting
  it adds complexity and raciness.  There are better options.
* mkdir -p does the job of making sure a directory exists.  (It only
  fails if there's a filesystem error or something.)
* Likewise, rm -f doesn't fail if the file doesn't exist.
* rm -r isn't neccessary because the socket shouldn't be a directory.
  (If it is for some reason, that should be an error.)
2015-11-28 15:03:09 +11:00
Aleksandrs Ļedovskis fa59a6850f Add 'Sender address rejected: Domain not found' Postfix failregex
Signed-off-by: Aleksandrs Ļedovskis <aleksandrs@ledovskis.lv>
2015-11-22 12:01:15 +02:00
Yaroslav Halchenko fe8d585d91 Merge pull request #1225 from opoplawski/journaldefault
Add *_backend options for services to allow distros to set the default backend
2015-11-14 10:49:45 -05:00
Orion Poplawski c656cb0d36 Merge branch 'master' into journaldefault
Conflicts:
	ChangeLog
2015-11-13 15:22:59 -07:00
James Hartig 9905396eb8 Added PartOf to service file so f2b restarts when deps do 2015-11-11 23:10:35 -05:00
Yaroslav Halchenko b3ed19b36a DOC: tune up to jail.conf.5 - some line breaks, typos etc 2015-11-10 08:47:13 -05:00
Yaroslav Halchenko 6af6e40b62 Merge pull request #1241 from sebres/known/param-tag
New interpolation feature for definition config readers - `<known/parameter>`
2015-11-10 08:35:57 -05:00
Yaroslav Halchenko 441dffbe2a ENH: Pruned some "pragma: no cover"s in fail2banregex
This code should and can be unit-tested, so no reason to keep it with
no cover
2015-11-10 08:31:56 -05:00
Yaroslav Halchenko 584f3af5af Merge pull request #1240 from yarikoptic/master
ENH: .mailmap file to bring some names together for git shortlog -sn
2015-11-10 08:30:06 -05:00
Yaroslav Halchenko aa0588dd1a Merge pull request #1250 from sebres/_sb/fail2ban-regex-coverage
RF: fail2ban-regex code moved into client/ codebase, unittested
2015-11-10 08:28:56 -05:00
sebres 689dfa1e6a debuggexURL fixed for wrong encoded character; test cases extended; 2015-11-10 13:29:54 +01:00
sebres 38f09b417a fail2ban-regex command line (after fail2ban-regex functionality moved to the client) 2015-11-10 13:26:34 +01:00
sebres 0877d66228 fail2ban-regex moved to the client + test cases for initial coverage added 2015-11-10 11:46:19 +01:00
sebres 46b116e86a filter test cases improved + log captured inside such tests + python 3.x compatibility;
changelog entry;
2015-11-09 22:02:05 +01:00
sebres a42aa726ab fixed fail2ban-regex reads invalid character (in sense of given encoding); continuing to process line ignoring invalid characters (still has no test cases).
filter test cases added for same issue inside fail2ban-server / fail2ban-testcases;
closes gh-1248
2015-11-09 20:47:15 +01:00
Yaroslav Halchenko b100ee6302 Merge pull request #1244 from opoplawski/typo
Fix typo
2015-11-02 17:55:30 -05:00
Orion Poplawski ba76f4ca2f Fix typo 2015-11-02 15:21:14 -07:00
sebres 94cffece12 New interpolation feature for definition config readers - <known/parameter>, as extension to interpolation %(known/parameter)s, that does not works for filter and action init parameters; 2015-11-02 21:45:03 +01:00
Simon Brown 69bb532db0 removed system.log 2015-11-02 09:26:45 -08:00
Simon Brown 3e16f33dbe Removed old svn revision comment 2015-11-02 09:08:47 -08:00
Simon Brown d16ad80597 removed false matches
For non-screensharingd related messages
2015-11-02 09:06:32 -08:00
Yaroslav Halchenko b40c6cbd9a ENH: .mailmap file to bring some names together for git shortlog -sn 2015-11-01 11:28:58 -05:00
sebres 5767191988 fixed misleading documentation of banaction 2015-11-01 17:08:00 +01:00
sebres fcf03790f4 fixed misleading documentation of banaction 2015-11-01 17:05:02 +01:00
Serg G. Brester eef7771b4e Merge pull request #1238 from sebres/fix/gh-1216
Fixed directly defined banaction for allports jails like pam-generic, recidive, etc
2015-10-31 13:17:04 +01:00
sebres e825e977cc Nginx log paths extended (prefixed with "*" wildcard)
closes gh-1237
2015-10-30 17:51:30 +01:00
sebres f359ed8c36 Fixed directly defined banaction for allports jails like pam-generic, recidive, etc with new default variable banaction_allports (+ man entries for both variables added);
closes gh-1216
2015-10-30 15:36:18 +01:00
Simon Brown 5839a3bd80 Removed includes comment for screensharing jail 2015-10-29 16:07:54 -07:00
sebres 53b39162a1 Shortly, much faster and stable version of regexp (possible because expression is start-anchored and does not contains closely to catch-all sub expressions) 2015-10-29 23:55:23 +01:00
sebres 6884593ab8 New filter nginx-limit-req ban hosts, that were failed through nginx by limit request processing rate (ngx_http_limit_req_module) 2015-10-29 23:15:20 +01:00
Orion Poplawski 0661aece46 Merge branch 'master' into journaldefault
Conflicts:
	ChangeLog
2015-10-29 15:22:37 -06:00
Simon Brown 65bc5cf6ba Now using a literal logpath for screensharing jail 2015-10-29 09:03:01 -07:00
Simon Brown cabd46f069 Fixed blatant typo in regex
However, still failing test, even though ```PYTHONPATH=. fail2ban-regex -v fail2ban/tests/files/logs/screensharingd  /etc/fail2ban/filter.d/screensharingd.conf``` gives desired result
2015-10-28 20:58:25 -07:00
Simon Brown bed28eaa62 clarified comments on sample log format 2015-10-28 15:32:58 -07:00
Simon Brown c936d19805 Fixed name (again?) 2015-10-28 15:30:31 -07:00
Simon Brown acee68a9ee Made screensharing jail off by default
Also added note about requiring paths-osx.conf.
2015-10-28 15:11:11 -07:00
Simon Brown 4b4d5a95b7 Changed regex prequel
Use standard prefix macro instead of literal daemon name.
2015-10-27 21:30:20 -07:00
Simon Brown 3dd1c305ce added entry for new screensharingd filter 2015-10-27 21:20:12 -07:00
Simon Brown 6a5f10ee72 name change & new sample data
changed name to match daemon, log samples with year
2015-10-27 16:27:14 -07:00
Simon Brown 3e4a77a568 Added json metadata 2015-10-27 12:31:51 -07:00
Simon Brown b3a18631e2 Sample log for test case 2015-10-27 10:43:43 -07:00
Simon Brown 4c3f778b82 Replaced .* with literal
Per Serg's suggestions. Possible I'm missing some auth attempt types, but I couldn't find anything where literal wasn't sufficient.
2015-10-27 10:33:30 -07:00
Simon Brown d17d837b8c Update jail.conf
Added logencoding to screensharing jail to avoid encoding error messages in fail2ban log
2015-10-27 10:28:07 -07:00
Simon Brown de14946542 Added new path variable for system.log
Logging location for the majority of Mac OS daemons.
2015-10-26 18:02:07 -07:00
Simon Brown 80546c6164 Added in settings for screensharingd filter 2015-10-26 17:50:49 -07:00
Simon Brown 3ec725a2ba Created file
From https://github.com/beezwax/filemaker-fail2ban/blob/master/fail2ban/filter.d/screensharingd.conf
2015-10-26 17:35:38 -07:00
sebres eb87638ead ChangeLog entry for OpenHAB home automation filter (gh-1223) 2015-10-26 15:56:01 +01:00
1technophile 2861a957a9 filter for openhab domotic software authentication failure with the rest api and web interface + test cases;
closes gh-1223
2015-10-26 15:48:23 +01:00
Serg G. Brester 26517b0464 Merge pull request #1226 from pablorf-dev/master
Minor fix and enhancement (fake google domains)
2015-10-22 14:23:47 +02:00
Pablo Rodriguez Fernandez 2c576c64f8 Change domain filter regex
Change domain filter regex since there are other Google crawlers.
See "Google crawlers"
<https://support.google.com/webmasters/answer/1061943?hl=en>
2015-10-20 10:46:00 +02:00
Pablo Rodriguez Fernandez 74fcb219ab Enhanced Google domain detection in apache-fakegooglebot
Previously, an attacker could fake a domain like
crawl-1-1-1-1.googlebot.com.fake.net and get resolved. This change
avoids to resolve fake Google domains.
2015-10-20 10:45:53 +02:00
Orion Poplawski 3a9cf2b3da Add and use default_backend to set individual backend defaults to auto 2015-10-19 19:50:03 -06:00
Orion Poplawski 81a26266a9 Add changlog entry for postfix-rbl logpath change 2015-10-19 19:46:43 -06:00
Orion Poplawski ced7be94b2 Fix postfix_log typo 2015-10-19 19:43:10 -06:00
Orion Poplawski 75d33c0f09 Add *_backend options for services to allow distros to set the default backend
per service.
Set default to systemd for Fedora as appropriate.
2015-10-18 20:18:50 -06:00
Pablo 7e6964dd9d Fix section jail.conf.5 manpage
The section of jail.conf manpage is wrong, should be 5, not 10
2015-10-15 10:40:56 +02:00
Serg G. Brester 3a5d4fdd26 Merge pull request #1221 from pablorf-dev/master
Add check in apache-fakegooglebot to protect against PTR fake record (gh-1221)
2015-10-14 11:33:06 +02:00
Pablo Rodriguez Fernandez a28e6b442e Add check in apache-fakegooglebot to protect against PTR fake record
An attacker may return a PTR record which fakes a Googlebot's domain
name. This modification resolves the PTR records to verify it.

See "Verifying Googlebot":
<https://support.google.com/webmasters/answer/80553?vid=1-635800030504666679-1963774919>
2015-10-13 17:11:49 +02:00
Yaroslav Halchenko 16443f7b05 Merge pull request #1219 from agentmoller001/patch-1
Updated route.conf to clear warnings (Closes #1026)
2015-10-09 21:26:53 -04:00
agentmoller001 617302fcc2 Updated route.conf to clear warnings
Does not throw warnings when starting/restarting by adding three lines of code.
2015-10-09 18:16:36 -07:00
Yaroslav Halchenko 6fb5e3a494 removed outdated and "problematic" .pydevproject 2015-10-09 14:10:02 -04:00
Serg G. Brester 42598fbf26 Merge pull request #1215 from paulmenzel/strip-trailing-whitespace-from-files-under-files
files: Strip trailing whitespace from files
2015-10-08 18:39:40 +02:00
Paul Menzel 078e2048f2 files: Strip trailing whitespace from files
Run the command `StripWhitespace` from the [Vim Better Whitespace
Plugin](https://github.com/ntpeters/vim-better-whitespace).
2015-10-08 16:18:08 +02:00
sebres 2696ede251 mysqld-auth: Updated "Access denied ..." regex for MySQL 5.6 and later
closes gh-1211
2015-10-07 14:34:13 +02:00
sebres 61ac481703 IpToName test case fixed ('66.249.66.1' resp. 'crawl-66-249-66-1.googlebot.com' seems to be unresolvable) 2015-10-07 13:36:21 +02:00
Serg G. Brester 68db52474d Merge pull request #1206 from kevinoid/ssh-match-auth-fail
ssh.conf: Fix disconnect "Auth fail" matching
2015-10-05 10:15:53 +02:00
Kevin Locke 2a5c93cfb5 Update ChangeLog and THANKS for "Auth fail" changes
Document the changes from 36919d9f in the ChangeLog and add myself to
the THANKS file (at @sebres suggestion).

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-10-05 00:31:13 -07:00
Kevin Locke 42b0e9258d Test cases for ssh.conf disconnect "Auth fail"
Add test coverage for the new disconnect "Auth fail" matching added in
36919d9f.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-10-02 15:56:26 -07:00
Kevin Locke 36919d9f97 ssh.conf: Fix disconnect "Auth fail" matching
The regex for matching against "Auth fail" disconnect log message does
not match against current versions of ssh.  OpenSSH 5.9 introduced
privilege separation of the pre-auth process, which included
[logging through monitor.c](http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/monitor.c.diff?r1=1.113&r2=1.114)
which adds " [preauth]" to the end of each message and causes the log
level to be prepended to each message.

It also fails to match against clients which send a disconnect message
with a description that is either empty or includes a space, since this
is the content in the log message after the disconnect code, per
[packet.c:1785](http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/packet.c?annotate=1.215),
which was matched by \S+.  Although I have not observed this yet, I
couldn't find anything which would preclude it in [RFC
4253](https://tools.ietf.org/html/rfc4253#section-11.1) and since the
message is attacker-controlled it provides a way to avoid getting
banned.

This commit fixes both issues.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-10-02 15:46:29 -07:00
Yaroslav Halchenko 8311bad4ea Merge pull request #1204 from szepeviktor/patch-8
Added CloudFlare API error codes URL
2015-09-30 07:54:30 -07:00
Viktor Szépe 0d8968daa9 Added CloudFlare API error codes URL 2015-09-30 16:07:45 +02:00
Yaroslav Halchenko 7f3b31aa37 Merge pull request #1198 from yarikoptic/enh-split-comma
ENH: allow to split ignoreip by space and/or comma (Closes #1197)
2015-09-27 11:09:55 -04:00
Yaroslav Halchenko ff06176e9e Merge remote-tracking branch 'origin/master' into enh-split-comma
* origin/master:
  DOC: changelog for the timeout change
  Set Timeout at urlopen to 3 seconds
  README :: init/service example mentions debian based systems as the example
  README :: fitted paragraph style
  BF: disable testing on python 3.2 until coverage gets a fix
  README :: Some style/grammar tweaks, and init/service script mention. Re: #1193
  Set Timeout at urlopen to 3 seconds
2015-09-27 00:52:14 -04:00
Yaroslav Halchenko 4c48e994eb Merge pull request #1201 from yoosefi/master
README :: Some style/grammar tweaks, and init/service script mention.…
2015-09-27 00:51:16 -04:00
Yaroslav Halchenko 6c0f898ec7 DOC: changelog for the timeout change 2015-09-27 00:49:57 -04:00
Yaroslav Halchenko 166e99d2ba Merge pull request #1203 from maxbeth/master
Add a timeout (3 sec) to urlopen within badips.py action
2015-09-27 00:48:50 -04:00
M. Maraun ebfd223320 Merge branch 'master' of github.com:maxbeth/fail2ban 2015-09-26 21:30:04 +02:00
M. Maraun 2895d981fa Set Timeout at urlopen to 3 seconds 2015-09-26 21:26:55 +02:00
Ryan Yoosefi 0610791ffe README :: init/service example mentions debian based systems as the example 2015-09-25 02:25:11 -07:00
Ryan Yoosefi c1b80a5e1b README :: fitted paragraph style 2015-09-25 02:23:08 -07:00
Yaroslav Halchenko d618ee3d90 BF: disable testing on python 3.2 until coverage gets a fix 2015-09-24 09:53:55 -04:00
Ryan Yoosefi 4744e16539 README :: Some style/grammar tweaks, and init/service script mention. Re: #1193 2015-09-24 06:37:01 -07:00
Yaroslav Halchenko 8cf614e221 ENH: allow to split ignoreip by space and/or comma (Closes #1197)
Way too many people ran into this gotcha, so lets just do it
2015-09-23 12:13:52 -04:00
Yaroslav Halchenko 24f875ad3e Merge pull request #1196 from yarikoptic/bf-longer-margin
BF: relax 1 sec delay testing to 100ms margin (Closes #1195)
2015-09-23 09:58:41 -04:00
Yaroslav Halchenko 84afcd8b1f BF(PY26): no assertGreater in 2.6 -- use explicit comparison 2015-09-23 09:45:51 -04:00
Yaroslav Halchenko 17a4289798 BF: relax 1 sec delay testing to 100ms margin (Closes #1195) 2015-09-23 08:38:51 -04:00
Yaroslav Halchenko 55e542b273 Merge remote-tracking branch 'pr/1170/head' -- opensuse paths
* pr/1170/head:
  Updated ChangeLog regarding openSUSE's path config
  Added configuration for opensuse path
2015-09-17 21:59:45 -04:00
Yaroslav Halchenko 82e528d1dd Merge pull request #1191 from yarikoptic/enh-year-after-day
ENH: new date pattern with year after day (not after entire entry)
2015-09-17 21:50:46 -04:00
Yaroslav Halchenko db1a3f17e1 ENH: new date pattern with year after day (not after entire entry) 2015-09-16 08:56:46 -04:00
Yaroslav Halchenko 41edfe8caf Merge pull request #1188 from yarikoptic/rf-assertLogged
RF(TST): self.assertTrue(self._is_logged()) -> self.assertLogged
2015-09-15 09:14:58 -04:00
Yaroslav Halchenko d0e6644acd Merge branch 'rf-assertLogged'
* rf-assertLogged:
  RF/BF: py26 has no {} sets, so just pass multiple entries as *args
  RF(TST): self.assertTrue(self._is_logged()) -> self.assertLogged
2015-09-15 08:58:15 -04:00
Yaroslav Halchenko d60c52b84f Merge pull request #1187 from yarikoptic/bf-nasty-children-tests
BF+RF: executeCmd should only return bool status on success and not throw exceptions (when timedout/killed) (Closes #1155)
2015-09-15 08:56:59 -04:00
Yaroslav Halchenko fbdd0b74a1 DOC: Changelog entry for this fix 2015-09-13 10:45:39 -04:00
Yaroslav Halchenko c2c4c40805 Merge remote-tracking branch 'origin/master' into bf-nasty-children-tests
* origin/master:
  Comment spelling fixes
  logrotate: Do not rotate empty logs
  logrotate: Remove outdated Fedora comment
  Updated Changelog
  Bugfix for dnsToIp resolver for fqdn with large list of IPs; closes #1164
  Added apache-badbots.conf
  Update gen_badbots
  Update apache-badbots.conf
  changelog for freshly merged PR (roundcube-auth definition of logpath)
  Fixed line suspected to be faulty
  renamed <NAME> to correct <ACT> in protocol

Conflicts:
    fail2ban/tests/actiontestcase.py -- due to comments fix up
2015-09-13 10:42:51 -04:00
Yaroslav Halchenko bfa286b8e4 Merge pull request #1189 from scop/logrotate
Logrotate tweaks
2015-09-13 10:36:20 -04:00
Yaroslav Halchenko cafc77d7db Merge pull request #1190 from scop/spelling
Comment spelling fixes
2015-09-13 10:33:41 -04:00
Ville Skyttä 943efdb1a0 Comment spelling fixes 2015-09-13 11:08:04 +03:00
Ville Skyttä 67a94733a9 logrotate: Do not rotate empty logs
As a useful side effect, prevents "Unable to contact server. Is it
running?" mails from cron when fail2ban hasn't been (intentionally)
running nor thus logging anything either.
2015-09-13 11:05:33 +03:00
Ville Skyttä 63c7ceb81d logrotate: Remove outdated Fedora comment 2015-09-13 10:57:51 +03:00
Yaroslav Halchenko 8a4dcafc8f RF/BF: py26 has no {} sets, so just pass multiple entries as *args 2015-09-12 21:37:40 -04:00
Yaroslav Halchenko 5ed731d3b3 RF(TST): self.assertTrue(self._is_logged()) -> self.assertLogged
and corresponding one for not + support for multiple entries at once,
and failure message listing actual log to ease troubleshooting
2015-09-12 19:59:55 -04:00
Yaroslav Halchenko 7cbb3980eb BF+RF: only return bool status on failed commands execution + mitigate different exit codes between bash/dash
Closes #1155
2015-09-12 19:39:44 -04:00
Yaroslav Halchenko 85b298e49c RF: try/except/finally in a single statement (while at it)
since we support now python >= 2.6
2015-09-12 12:59:37 -04:00
Yaroslav Halchenko 5b655639ab Merge pull request #1186 from EdwardBeckett/master
Updated Changelog
2015-09-11 11:43:58 -04:00
Edward Beckett f5b88bd377 Updated Changelog 2015-09-11 10:12:57 -04:00
Yaroslav Halchenko 4a53629004 Merge pull request #1184 from fail2ban/gh-1164-fix
Bugfix for dnsToIp resolver for fqdn with large list of IPs;
2015-09-09 18:07:26 -04:00
sebres 4cf3b576b9 Bugfix for dnsToIp resolver for fqdn with large list of IPs;
closes #1164
2015-09-08 18:20:48 +02:00
Yaroslav Halchenko 818be64ae1 Merge pull request #1180 from EdwardBeckett/master
Update apache-badbots.conf
2015-09-06 09:46:47 -04:00
Edward Beckett 4bd7991573 Added apache-badbots.conf 2015-09-06 01:12:19 -04:00
Edward Beckett 03460d5ed0 Update gen_badbots
Added plus char to the regex for escaping user-agent strings.
2015-09-06 01:05:52 -04:00
Edward Beckett 835b3ff483 Update apache-badbots.conf
Useragent strings including `+http` need to be escaped to be valid.
2015-09-05 00:12:28 -04:00
weberho 2d69fd20ae Updated ChangeLog regarding openSUSE's path config 2015-08-26 15:37:14 +02:00
weberho f7af93a677 Added configuration for opensuse path 2015-08-26 15:25:59 +02:00
Yaroslav Halchenko 60fbf7d750 changelog for freshly merged PR (roundcube-auth definition of logpath) 2015-08-26 09:03:23 -04:00
Yaroslav Halchenko db9ab7ffd0 Merge pull request #1169 from weberhofer/master
Fixed line suspected to be faulty
2015-08-26 09:02:13 -04:00
weberho d278fbca30 Fixed line suspected to be faulty 2015-08-26 14:48:55 +02:00
Yaroslav Halchenko 1b6800c889 Merge pull request #1147 from pheanex/rename-name-act
renamed <NAME> to correct <ACT> in protocol
2015-08-02 10:19:05 -04:00
Konstantin Manna 7de78f4bb8 renamed <NAME> to correct <ACT> in protocol 2015-08-02 14:55:38 +02:00
Yaroslav Halchenko 9ebf01293b Post release tune ups 2015-08-01 09:17:31 -04:00
Yaroslav Halchenko d67f502ff5 Tuned up removal of /run within package installation -- now in the root as well 2015-07-31 22:16:30 -04:00
Yaroslav Halchenko dce6e1cd3a Changelog and adjusted debian/control description to describe recommends 2015-07-31 22:16:25 -04:00
Yaroslav Halchenko bceb35ab34 Merge tag '0.9.3' into debian
ver. 0.9.3 (2015/08/01) - lets-all-stay-friends
----------

- IMPORTANT incompatible changes:
   * filter.d/roundcube-auth.conf
     - Changed logpath to 'errors' log (was 'userlogins')
   * action.d/iptables-common.conf
     - All calls to iptables command now use -w switch introduced in
       iptables 1.4.20 (some distribution could have patched their
       earlier base version as well) to provide this locking mechanism
       useful under heavy load to avoid contesting on iptables calls.
       If you need to disable, define 'action.d/iptables-common.local'
       with empty value for 'lockingopt' in `[Init]` section.
   * mail-whois-lines, sendmail-geoip-lines and sendmail-whois-lines
     actions now include by default only the first 1000 log lines in
     the emails.  Adjust <grepopts> to augment the behavior.

- Fixes:
   * reload in interactive mode appends all the jails twice (gh-825)
   * reload server/jail failed if database used (but was not changed) and
     some jail active (gh-1072)
   * filter.d/dovecot.conf - also match unknown user in passwd-file.
     Thanks Anton Shestakov
   * Fix fail2ban-regex not parsing journalmatch correctly from filter config
   * filter.d/asterisk.conf - fix security log support for Asterisk 12+
   * filter.d/roundcube-auth.conf
     - Updated regex to work with 'errors' log (1.0.5 and 1.1.1)
     - Added regex to work with 'userlogins' log
   * action.d/sendmail*.conf - use LC_ALL (superseeding LC_TIME) to override
     locale on systems with customized LC_ALL
   * performance fix: minimizes connection overhead, close socket only at
     communication end (gh-1099)
   * unbanip always deletes ip from database (independent of bantime, also if
     currently not banned or persistent)
   * guarantee order of dbfile to be before dbpurgeage (gh-1048)
   * always set 'dbfile' before other database options (gh-1050)
   * kill the entire process group of the child process upon timeout (gh-1129).
     Otherwise could lead to resource exhaustion due to hanging whois
     processes.
   * resolve /var/run/fail2ban path in setup.py to help installation
     on platforms with /var/run -> /run symlink (gh-1142)

- New Features:
   * RETURN iptables target is now a variable: <returntype>
   * New type of operation: pass2allow, use fail2ban for "knocking",
     opening a closed port by swapping blocktype and returntype
   * New filters:
     - froxlor-auth - Thanks Joern Muehlencord
     - apache-pass - filter Apache access log for successful authentication
   * New actions:
     - shorewall-ipset-proto6 - using proto feature of the Shorewall. Still requires
       manual pre-configuration of the shorewall. See the action file for detail.
   * New jails:
     - pass2allow-ftp - allows FTP traffic after successful HTTP authentication

- Enhancements:
   * action.d/cloudflare.conf - improved documentation on how to allow
     multiple CF accounts, and jail.conf got new compound action
     definition action_cf_mwl to submit cloudflare report.
   * Check access to socket for more detailed logging on error (gh-595)
   * fail2ban-testcases man page
   * filter.d/apache-badbots.conf, filter.d/nginx-botsearch.conf - add
     HEAD method verb
   * Revamp of Travis and coverage automated testing
   * Added a space between IP address and the following colon
     in notification emails for easier text selection
   * Character detection heuristics for whois output via optional setting
     in mail-whois*.conf. Thanks Thomas Mayer.
     Not enabled by default, if _whois_command is set to be
     %(_whois_convert_charset)s (e.g. in action.d/mail-whois-common.local),
     it
     - detects character set of whois output (which is undefined by
       RFC 3912) via heuristics of the file command
     - converts whois data to UTF-8 character set with iconv
     - sends the whois output in UTF-8 character set to mail program
     - avoids that heirloom mailx creates binary attachment for input with
       unknown character set

* tag '0.9.3': (99 commits)
  Release changes (too much of manual "labor"! ;))
  BF: realpath for /var/run/fail2ban Closes #1142
  Changelog entry for killpg fix
  Changelog entries for Serge's fixes
  bug fix: option 'dbpurgeage' was never set (always default) by start of fail2ban, because of invalid sorting of options ('dbfile' should be always set before other database options) / closes #1048, closes #1050
  BF: guarantee order of dbfile to be before dbpurgeage (Closes #1048)
  DOC: Changelog for shorewall-ipset-proto6.conf + adjusted its description
  DOC: moved and adjusted changelog entry from 0.9.2 within 0.9.3 to come
  TST: test to verify killing stuck children processes
  BF: kill the entire process group upon timeout (Close #1129)
  Limit the number of log lines in *-lines.conf actions
  ipjailmatches is on one line with its description in man jail.conf
  DOC: Changelog for iptables -w change
  Remove self.printlog() call
  Remove literal "TODO" from method's name
  BF: do not wrap iptables into itself. Thanks Lee
  Added a space between IP address and the following colon
  BF: symbiosis-blacklist-allports now also requires iptables-common.conf
  RF: use <iptables> to take effect of it being a parameter
  ENH: added lockingopt option for iptables actions, made iptables cmd itself a parameter
  ...
2015-07-31 21:34:06 -04:00
Yaroslav Halchenko 70ba5cb005 Release changes (too much of manual "labor"! ;)) 2015-07-31 21:32:13 -04:00
Yaroslav Halchenko 84ad3525e6 Merge pull request #1144 from yarikoptic/bf-realpath-var-run-1142
BF: realpath for /var/run/fail2ban Closes #1142
2015-07-31 15:50:46 -04:00
Yaroslav Halchenko 776322cea3 BF: realpath for /var/run/fail2ban Closes #1142 2015-07-31 10:12:14 -04:00
Yaroslav Halchenko c37009aec7 Merge branch 'grep-m1k' of github.com:szepeviktor/fail2ban
* 'grep-m1k' of github.com:szepeviktor/fail2ban:
  Limit the number of log lines in *-lines.conf actions

Conflicts:
  ChangeLog -- took both versions and adjusted the new one
  for -n 1000 change
2015-07-27 22:37:46 -04:00
Yaroslav Halchenko a80820e356 Changelog entry for killpg fix 2015-07-27 22:34:40 -04:00
Yaroslav Halchenko 38c320798d Merge pull request #1127 from yarikoptic/enh-iptables-w-close-1122
WIP ENH Add <lockingopt> (Close: #1122) and <iptables> to define the iptables call
2015-07-27 22:30:54 -04:00
Yaroslav Halchenko cb101e9f4a Merge pull request #1136 from yarikoptic/bf-timeout-nested-commands-killpg
WiP BF: kill the entire process group upon timeout (Close #1129)
2015-07-27 22:30:09 -04:00
Yaroslav Halchenko de69855157 Changelog entries for Serge's fixes 2015-07-27 10:35:14 -04:00
sebres 8a37a46fbb bug fix: option 'dbpurgeage' was never set (always default) by start of fail2ban, because of invalid sorting of options ('dbfile' should be always set before other database options) / closes #1048, closes #1050 2015-07-27 10:59:14 +02:00
Yaroslav Halchenko 17472a8b56 BF: guarantee order of dbfile to be before dbpurgeage (Closes #1048) 2015-07-27 10:18:29 +02:00
Yaroslav Halchenko 0041bc3770 DOC: Changelog for shorewall-ipset-proto6.conf + adjusted its description 2015-07-26 23:10:08 -04:00
Yaroslav Halchenko de2f9504c0 Merge pull request #978 from ediazrod/patch-2
shorewall-ipset-proto6.conf for shorewall
2015-07-26 23:00:58 -04:00
Yaroslav Halchenko 65cd218e10 Merge remote-tracking branch 'origin/master'
* origin/master:
  ipjailmatches is on one line with its description in man jail.conf
  Added a space between IP address and the following colon
2015-07-26 22:47:43 -04:00
Yaroslav Halchenko 333dd842f9 DOC: moved and adjusted changelog entry from 0.9.2 within 0.9.3 to come 2015-07-26 22:44:52 -04:00
Yaroslav Halchenko b566f992a6 Merge pull request #1128 from szepeviktor/text-selection
Added a space between IP address and the following colon
2015-07-26 22:13:29 -04:00
Yaroslav Halchenko 515ad6dc12 TST: test to verify killing stuck children processes 2015-07-26 21:52:38 -04:00
Yaroslav Halchenko 7112e4f6c6 BF: kill the entire process group upon timeout (Close #1129)
Requires also establishing a new process group for a child
process, which changes previous behavior
2015-07-26 20:41:43 -04:00
Viktor Szépe c8b3ee10a0 Limit the number of log lines in *-lines.conf actions 2015-07-27 02:35:21 +02:00
Yaroslav Halchenko 6577387b5a Merge pull request #1133 from szepeviktor/patch-7
ipjailmatches is on one line with its description in man jail.conf
2015-07-26 19:40:37 -04:00
Viktor Szépe 9547812526 ipjailmatches is on one line with its description in man jail.conf 2015-07-27 01:05:05 +02:00
Yaroslav Halchenko 33b204a2ee DOC: Changelog for iptables -w change 2015-07-26 18:25:42 -04:00
Thomas Mayer a19cb1b2b9 Merge 923d807ef8 into cf2feea987 2015-07-25 01:23:39 +00:00
Yaroslav Halchenko cf2feea987 Merge pull request #1131 from leeclemens/patch-3
Remove self.printlog() call
2015-07-24 15:29:43 -04:00
Lee Clemens 8822ed4144 Remove self.printlog() call
This seems to have been used for debugging, while unittest method was disabled
2015-07-24 15:13:37 -04:00
Yaroslav Halchenko fe8cc3e83d Merge pull request #1130 from leeclemens/patch-2
Remove literal "TODO" from method's name
2015-07-24 14:22:27 -04:00
Lee Clemens 0ed1cb0aa6 Remove literal "TODO" from method's name
Also need to change expected log message, since this test hasn't been executed, possibly ever.
2015-07-24 13:57:59 -04:00
Yaroslav Halchenko 3c0d7f5a4c BF: do not wrap iptables into itself. Thanks Lee 2015-07-24 11:59:53 -04:00
Viktor Szépe ebdfbae559 Added a space between IP address and the following colon 2015-07-24 09:33:47 +02:00
Yaroslav Halchenko 749d3c160c BF: symbiosis-blacklist-allports now also requires iptables-common.conf 2015-07-23 21:53:37 -04:00
Yaroslav Halchenko 916937bb6a RF: use <iptables> to take effect of it being a parameter 2015-07-23 21:38:10 -04:00
Yaroslav Halchenko 31dc4e2263 ENH: added lockingopt option for iptables actions, made iptables cmd itself a parameter 2015-07-23 21:34:20 -04:00
Yaroslav Halchenko 7a011fca1b DOC: adjusted comment in pass2allow-ftp to my suggested wording 2015-07-16 21:55:20 -04:00
Yaroslav Halchenko 80946ed54c Merge pull request #1112 from szepeviktor/pass2allow
Added pass2allow (knocking with fail2ban)
2015-07-16 21:54:10 -04:00
Viktor Szépe 948b12e5df Fixed definition of knocking_url for pass2allow 2015-07-14 18:35:51 +02:00
Viktor Szépe b638e807ad Explicitly stating that knocking_url needs to be customized 2015-07-13 18:12:04 +02:00
Viktor Szépe 586703dcc2 Test, changelog and fixes to pass2allow 2015-07-13 16:46:04 +02:00
sebres 386da502ba Merge remote-tracking branch 'master' into 'ban-time-incr' 2015-07-13 16:19:33 +02:00
Viktor Szépe 5b7e1de2f4 Instead of allow-iptables-multiport actions swap blocktype and (new) returntype 2015-07-11 18:20:09 +02:00
Viktor Szépe 5d60700c0c Added pass2allow (knocking with fail2ban) 2015-07-10 16:22:43 +02:00
sebres 95c2a2976f unbanip always deletes ip from database (independent of bantime, also if currently not banned or persistent);
merged from #716 where it works;
closes gh-972, closes gh-768
2015-07-10 13:56:26 +02:00
Yaroslav Halchenko 00d8779f87 Merge pull request #1104 from leeclemens/travis-rework
Improve Travis setup and coverage reporting (all versions report)
2015-07-09 19:39:20 -04:00
Lee Clemens 7f68516c5c Re-add shebang to setup.py 2015-07-09 16:48:01 -04:00
Yaroslav Halchenko 76f288fd8a Merge pull request #1108 from leeclemens/version_string
Append 0 to .dev version "number"
2015-07-09 15:26:16 -04:00
Lee Clemens 2c05e8d21d Prevent UserWarning: The version specified requires normalization, add 0 to version 2015-07-09 14:31:51 -04:00
Lee Clemens c56785685b Set VENV path and use pip to install 2015-07-09 11:23:50 -04:00
Lee Clemens fc2b7f8012 Multiple Travis and coverage related changes
Reorganize .travis.yml
Separate coverage tests for Python 2 and Python 3
Execute setup.py install using the environment's Python exe
Sanitize Travis execution order
2015-07-09 10:12:40 -04:00
Lee Clemens 675767ad4f Exclude coverage traceback in smoke test (misctestcase) 2015-07-09 10:12:40 -04:00
Lee Clemens 94bc77aac8 Consolidate coveragerc configs into .coveragerc (delete .travis_coveragerc) 2015-07-09 10:12:40 -04:00
Lee Clemens f50dcf7658 Remove shebang from setup.py 2015-07-09 10:12:40 -04:00
Lee Clemens b1022a4fe4 DOC: Use coverage report and optionally coverage html 2015-07-09 10:12:40 -04:00
sebres 4aff396b05 deserialize "close" message not expected (was not serialized).
closes #1103
2015-07-08 11:10:05 +02:00
Lee Clemens 1ebea39ec5 Merge pull request #1068 from yarikoptic/enh/var-run-fail2ban
BF: 'create' /var/run/fail2ban on systems with /var/run
2015-07-07 21:55:49 -04:00
M. Maraun d412b71f3a Merge branch 'master' of github.com:maxbeth/fail2ban 2015-07-07 21:58:51 +02:00
Yaroslav Halchenko c213d97d25 Moved recently added Changelog (on HEAD addition) to Enhancements 2015-07-07 14:01:24 -04:00
Yaroslav Halchenko e2c0a1060e Merge pull request #1101 from szepeviktor/patch-6
HEAD is a popular break-in attempt type
2015-07-07 13:49:31 -04:00
Viktor Szépe a3b8257b73 Add HEAD method verb to apache-badbots, nginx-badbots 2015-07-07 17:45:40 +02:00
Lee Clemens 57a8b99509 DOC: Fix typo 2015-07-07 11:44:27 -04:00
Yaroslav Halchenko 052418a110 Merge pull request #1098 from yarikoptic/enh/man-testcases
DOC: rudimentary manpage for fail2ban-testcases (+updated other mans for consistency)
2015-07-06 23:43:30 -04:00
Serg G. Brester cbb846bb46 Merge pull request #1099 from fail2ban/_sebres/min-connect-overhead
performance fix: minimizes connection overhead (close only at communication end)
2015-07-06 22:49:00 +02:00
sebres 4a4fe7d76a extending test cases (increase coverage) + changelog entry for #1099 2015-07-06 22:09:13 +02:00
sebres 3e47ce7f2a redefine protocol constants in protocol.py (prevent unnecessary duplication) 2015-07-06 17:37:12 +02:00
sebres 17502bd818 obsolete code removed (python <= 2.5) + test case extended 2015-07-06 13:08:13 +02:00
sebres 81e659b760 performance fix: minimizes connection overhead, using same socket by multiple commands without close it (ex.: 'start' sends several hundreds commands at once) 2015-07-06 12:23:53 +02:00
Yaroslav Halchenko 46510948a7 DOC: rudimentary manpage for fail2ban-testcases (+updated other mans for consistency) 2015-07-05 21:48:14 -04:00
Yaroslav Halchenko 38f8e1a82a DOC: added changelog for LC_ALL fix, tuned up other ChangeLog entries 2015-07-05 21:39:17 -04:00
Yaroslav Halchenko 8c4c17a880 Merge pull request #1004 from tsabi/fix-lc_time
Fix of LC_TIME usage, it should be LC_ALL
2015-07-05 21:36:37 -04:00
Yaroslav Halchenko e38b4b8cb3 Merge pull request #1051 from leeclemens/bf/roundcube
Update regex to work with roundcube 1.0.5 and 1.1.1
2015-07-05 21:35:49 -04:00
Yaroslav Halchenko c0feebfad8 Merge pull request #1088 from leeclemens/bf-595/nonrootmessage
Add specific errors for client socket access (closes 595)
2015-07-05 21:33:56 -04:00
Yaroslav Halchenko e5a5edd35b Merge pull request #1096 from leeclemens/bf/log-args
Fix error logging - not enough arguments (tuple is 1 arg, need 2)
2015-07-05 21:31:14 -04:00
Lee Clemens b5d5a79845 Fix error logging - not enough arguments (tuple is 1 arg, need 2) 2015-07-05 10:30:45 -04:00
Yaroslav Halchenko 034a865c79 Merge pull request #1093 from leeclemens/pep8-e7
Fix PEP8 E701, E703 and E712
2015-07-05 00:05:48 -04:00
Yaroslav Halchenko 7fc93cee37 Merge pull request #1094 from leeclemens/pep8-e3
Fix PEP8 E301, E302 and E303
2015-07-05 00:03:19 -04:00
Lee Clemens fd46b90106 Merge pull request #1095 from leeclemens/bf-1089/disable-pypy
temporarily disabled pypy in .travis.yml
2015-07-04 17:35:09 -04:00
Lee Clemens 6a711503fe temporarily disabled pypy in .travis.yml 2015-07-04 17:24:59 -04:00
Lee Clemens 3e902d7b3a Define roundcube_errors_log in paths-common.conf
Remove from paths-debian
2015-07-04 14:46:31 -04:00
Lee Clemens fdc3172aec Fix PEP8 E302 expected 2 blank lines, found X 2015-07-04 13:47:40 -04:00
Lee Clemens fbeee8bb28 Fix PEP8 E303 too many blank lines 2015-07-04 13:25:20 -04:00
Lee Clemens 60c5c6951c Fix PEP8 E301 expected 1 blank line, found 0 2015-07-04 13:23:08 -04:00
Lee Clemens 31b34950f7 Fix pep8 E712 comparison to False should be 'if cond is False:' or 'if not cond:' 2015-07-04 12:39:42 -04:00
Lee Clemens fe5e7a023e Fix pep8 E701 multiple statements on one line (colon) 2015-07-04 12:39:42 -04:00
Lee Clemens 1a98e15328 Fix pep8 E703 statement ends with a semicolon 2015-07-04 12:39:42 -04:00
Lee Clemens 423d5b761e Add changelog reference for socket error logging message 2015-07-04 12:37:52 -04:00
Lee Clemens 77f5983b42 Test permissions to socket for detailed errors if socket.error raised 2015-07-04 12:35:56 -04:00
Lee Clemens f7444f16b8 Add optional session id prefix for roundcube 1.1.1 2015-07-04 11:06:51 -04:00
Lee Clemens 2796534a5d Update regex to work with roundcube 1.0.5 on CentOS 6 2015-07-04 11:02:04 -04:00
Yaroslav Halchenko e9e00d7599 DOC: ChangeLog -- a better description for cloudflare changes 2015-07-04 10:04:45 -04:00
Yaroslav Halchenko 454546f4ae Merge pull request #1085 from szepeviktor/patch-5
Updated CF action -  added docs  and composite action to jails.conf
2015-07-04 09:33:33 -04:00
Viktor Szépe a00ee15c06 Added Changelog entry 2015-07-04 14:12:38 +02:00
Yaroslav Halchenko 81db2f47dc Merge pull request #1090 from leeclemens/pep8-e401-bin
Fix PEP8 E401 - multiple imports on one line
2015-07-03 20:37:29 -04:00
M. Maraun 6d72602f6b Set Timeout at urlopen to 3 seconds 2015-07-03 22:42:22 +02:00
Viktor Szépe b65a8b065d Other actions do not dive into this gory descriptions, but we do. 2015-07-03 19:17:50 +02:00
Lee Clemens c7e203b20f Fix PEP8 E401 - multiple imports on one line 2015-07-03 13:02:50 -04:00
Yaroslav Halchenko cf3a1c15a0 Merge pull request #1082 from leeclemens/pep8-w6
Fix pep8 w6 - Deprecation warnings
2015-07-03 12:32:13 -04:00
Viktor Szépe 2063ce4b23 All the arguments must be listed in [Init] 2015-07-01 14:48:44 +02:00
Viktor Szépe 79457112e9 Updated CF action 2015-07-01 09:38:36 +02:00
Lee Clemens 8e0145b947 Fix pep8 W604 "backticks are deprecated, use 'repr()'" 2015-06-27 13:57:09 -04:00
Lee Clemens 2310ac44c7 Fix pep8 W602 "deprecated form of raising exception" 2015-06-27 13:57:09 -04:00
Lee Clemens 3e3d1e0cf6 Fix pep8 W601 ".has_key() is deprecated, use 'in'" 2015-06-27 13:57:09 -04:00
Lee Clemens f899340b15 Merge pull request #1083 from leeclemens/pep8-e4
Fix pep8 E401 multiple imports on one line
2015-06-27 11:11:35 -04:00
Lee Clemens 7667712909 Fix pep8 E401 multiple imports on one line 2015-06-26 12:51:19 -04:00
sebres f2d0230a67 reload in interactive mode appends all the jails twice (#825) 2015-06-22 17:57:01 +02:00
sebres 2f283079f8 reload server/jail failed if database used (but was not changed) and some jail active (#1072) 2015-06-22 17:56:39 +02:00
Yaroslav Halchenko 2d9ece2d04 BF: 'create' /var/run/fail2ban on systems with /var/run
Should overcome problems of some users installing using setup.py install
2015-06-11 19:43:42 -10:00
Yaroslav Halchenko 345820d2aa Merge pull request #1056 from ipoddubny/asterisk_security_log
Fix support for Asterisk security log
2015-05-25 12:50:13 -04:00
Yaroslav Halchenko f41872f034 Merge pull request #1013 from szepeviktor/patch-4
Non-US locale warning for proftpd
2015-05-25 10:51:51 -04:00
Yaroslav Halchenko eb091d9b8c Merge remote-tracking branch 'origin/master' into pr-1039
* origin/master:
  minor: no tripple empty lines
  add froxlor-auth filter and jail
  add froxlor-auth filter and jail 0
  add froxlor-auth filter and jail
  BF: Fix fail2ban-regex not parsing journalmatch correctly
2015-05-25 10:50:34 -04:00
Yaroslav Halchenko 8c4d4aa7fb minor: no tripple empty lines 2015-05-25 10:42:19 -04:00
Yaroslav Halchenko 3ac1f057f5 Merge pull request #1058 from jomu78/master
add froxlor-auth filter and jail
2015-05-25 10:40:29 -04:00
Joern Muehlencord de931e6e6b Merge branch 'master' of https://github.com/jomu78/fail2ban 2015-05-25 13:51:56 +02:00
Joern Muehlencord 4296d1a9a9 add froxlor-auth filter and jail 2015-05-25 13:51:06 +02:00
Joern Muehlencord 14a9a2d968 add froxlor-auth filter and jail 0 2015-05-25 13:48:25 +02:00
Joern Muehlencord 964cdb5d9b add froxlor-auth filter and jail 2015-05-25 13:44:50 +02:00
Ivan Poddubny 38d9f3e609 Asterisk security log: add tests and update ChangeLog 2015-05-25 08:32:49 +03:00
Ivan Poddubny 7a4e6fa6e5 Asterisk security log: add support for websocket protocol events
Thanks to @kcormier.
2015-05-25 08:13:30 +03:00
Ivan Poddubny 988d9a08da Asterisk security log: accept events containing Response/ExpectedResponse
Event containing Challenge may come without ReceivedChallenge, but with
Response and ExpectedResponse.
Also Challenge now accepts '/' character, since it is used at least by PJSIP.
2015-05-25 08:12:51 +03:00
Ivan Poddubny 189265a323 Asterisk security log: accept SessionID of PJSIP events
Unlike chan_sip and manager, PJSIP populates SessionID using
Call-Id header of a related SIP message.
As Call-Id of a SIP message can contain almost anything,
the regular expression for SessionID has been loosened.
2015-05-25 08:11:34 +03:00
Ivan Poddubny ab2ac1a367 Asterisk security log: accept <unknown> in AccountID 2015-05-24 12:47:55 +03:00
Ivan Poddubny 977f9955e7 Asterisk security log: accept EventTV in ISO8601
Asterisk uses ISO8601 dates in security log since version 12.

Closes #988
2015-05-24 12:46:54 +03:00
Steven Hiscocks 0c869910ea BF: Fix fail2ban-regex not parsing journalmatch correctly 2015-05-09 10:26:14 +01:00
Anton Shestakov a61cd4687e Merge 56e5821c06 into ab74a35b8a 2015-04-30 08:56:37 +00:00
Anton Shestakov 56e5821c06 Match unknown user in dovecot's passwd-file auth database 2015-04-30 16:53:10 +08:00
Yaroslav Halchenko ab74a35b8a Merge pull request #1038 from yarikoptic/bf-pypy
BF: download/use 2.5.1 release of PyPy to avoid problems with dailies
2015-04-29 10:23:30 -04:00
Yaroslav Halchenko 21b7dfcae9 BF: download/use 2.5.1 release of PyPy to avoid problems with dailies 2015-04-29 10:05:05 -04:00
Yaroslav Halchenko fb336276d4 post-release tune ups
Conflicts:
	ChangeLog
	README.md
2015-04-29 09:02:48 -04:00
Yaroslav Halchenko 77ea6e62b4 update datestamp 2015-04-29 00:00:17 -04:00
Yaroslav Halchenko 39147397d8 Merge tag '0.9.2' into debian
Long delayed

ver. 0.9.2 (2015/04/29) - better-quick-now-than-later
----------

- Fixes:
   * Fix ufw action commands
   * infinite busy loop on _escapedTags match in substituteRecursiveTags gh-907.
     Thanks TonyThompson
   * port[s] typo in jail.conf/nginx-http-auth gh-913. Thanks Frederik Wagner
     (fnerdwq)
   * $ typo in jail.conf. Thanks Skibbi. Debian bug #767255
   * grep'ing for IP in *mail-whois-lines.conf should now match also
     at the beginning and EOL.  Thanks Dean Lee
   * jail.conf
     - php-url-fopen: separate logpath entries by newline
   * failregex declared direct in jail was joined to single line (specifying of
     multiple expressions was not possible).
   * filters.d/exim.conf - cover different settings of exim logs
     details. Thanks bes.internal
   * filter.d/postfix-sasl.conf - failregex is now case insensitive
   * filters.d/postfix.conf - add 'Client host rejected error message' failregex
   * fail2ban/__init__.py - add strptime thread safety hack-around
   * recidive uses iptables-allports banaction by default now.
     Avoids problems with iptables versions not understanding 'all' for
     protocols and ports
   * filter.d/dovecot.conf
     - match pam_authenticate line from EL7
     - match unknown user line from EL7
   * Use use_poll=True for Python 2.7 and >=3.4 to overcome "Bad file
     descriptor" msgs issue (gh-161)
   * filter.d/postfix-sasl.conf - tweak failregex and add ignoreregex to ignore
     system authentication issues
   * fail2ban-regex reads filter file(s) completely, incl. '.local' file etc.
     (gh-954)
   * firewallcmd-* actions: split output into separate lines for grepping (gh-908)
   * Guard unicode encode/decode issues while storing records in the database.
     Fixes "binding parameter error (unsupported type)" (gh-973), thanks to kot
     for reporting
   * filter.d/sshd added regex for matching openSUSE ssh authentication failure
   * filter.d/asterisk.conf:
     - Dropped "Sending fake auth rejection" failregex since it incorrectly
       targets the asterisk server itself
     - match "hacking attempt detected" logs

- New Features:
   - New filters:
     - postfix-rbl  Thanks Lee Clemens
     - apache-fakegooglebot.conf  Thanks Lee Clemens
     - nginx-botsearch  Thanks Frantisek Sumsal
     - drupal-auth  Thanks Lee Clemens
   - New recursive embedded substitution feature added:
     - `<<PREF>HOST>` becomes `<IPV4HOST>` for PREF=`IPV4`;
     - `<<PREF>HOST>` becomes `1.2.3.4` for PREF=`IPV4` and IPV4HOST=`1.2.3.4`;
   - New interpolation feature for config readers - `%(known/parameter)s`.
     (means last known option with name `parameter`). This interpolation makes
     possible to extend a stock filter or jail regexp in .local file
     (opposite to simply set failregex/ignoreregex that overwrites it),
     see gh-867.
   - Monit config for fail2ban in files/monit/
   - New actions:
     - action.d/firewallcmd-multiport and action.d/firewallcmd-allports Thanks Donald Yandt
     - action.d/sendmail-geoip-lines.conf
     - action.d/nsupdate to update DNSBL. Thanks Andrew St. Jean
   - New status argument for fail2ban-client -- flavor:
     fail2ban-client status <jail> [flavor]
     - empty or "basic" works as-is
     - "cymru" additionally prints (ASN, Country RIR) per banned IP
       (requires dnspython or dnspython3)
   - Flush log at USR1 signal

- Enhancements:
   * Enable multiport for firewallcmd-new action.  Closes gh-834
   * files/debian-initd migrated from the debian branch and should be
     suitable for manual installations now (thanks Juan Karlo de Guzman)
   * Define empty ignoreregex in filters which didn't have it to avoid
     warnings (gh-934)
   * action.d/{sendmail-*,xarf-login-attack}.conf - report local
     timezone not UTC time/zone. Closes gh-911
   * Conditionally log Ignore IP with reason (dns, ip, command). Closes gh-916
   * Absorbed DNSUtils.cidr into addr2bin in filter.py, added unittests
   * Added syslogsocket configuration to fail2ban.conf
   * Note in the jail.conf for the recidive jail to increase dbpurgeage (gh-964)

* tag '0.9.2':
  Hope for release tomorrow
  BF: if no /dev/log on Linux -- don't expect setting syslog to work
  Fix actions in ufw.conf
  Add drupal-auth filter and jail
2015-04-28 23:59:34 -04:00
Yaroslav Halchenko d530240c99 BF: enforce C.UTF-8 LC_ALL while running tests 2015-04-29 03:56:08 +00:00
Yaroslav Halchenko acc4c2d104 Hope for release tomorrow 2015-04-28 23:52:48 -04:00
Yaroslav Halchenko 840fea9f71 Merge commit '0f75ed5e2ab1159e45a7771a7a4e90c877ec848e'
* commit '0f75ed5e2ab1159e45a7771a7a4e90c877ec848e':
  Just use a system wide python in the tests digest.py
  DOC: Slight tune up to RELEASE doc -- no need for PYTHONPATH to run tests
  MANIFEST: updated for some new files, sorted all entries, removed some duplicates
  Initial changes for the release -- simplified ChangeLog header etc
2015-04-28 23:51:32 -04:00
Yaroslav Halchenko c0e1333fe6 BF: if no /dev/log on Linux -- don't expect setting syslog to work 2015-04-28 23:51:00 -04:00
Yaroslav Halchenko ced4852383 Merge pull request #1037 from ambrice/ufw
Fix actions in ufw.conf
2015-04-28 20:11:58 -04:00
Aaron Brice 7ae0ef2408 Fix actions in ufw.conf
On Ubuntu 15.04 the ufw action was not working.
- With empty <application>, receiving errors:

2015-04-24 16:28:35,204 fail2ban.filter         [8527]: INFO    [sshd] Found 43.255.190.157
2015-04-24 16:28:35,695 fail2ban.actions        [8527]: NOTICE  [sshd] Ban 43.255.190.157
2015-04-24 16:28:35,802 fail2ban.action         [8527]: ERROR   [ -n "" ] && app="app " -- stdout: b''
2015-04-24 16:28:35,803 fail2ban.action         [8527]: ERROR   [ -n "" ] && app="app " -- stderr: b''
2015-04-24 16:28:35,803 fail2ban.action         [8527]: ERROR   [ -n "" ] && app="app " -- returned 1

- With action = ufw[application=OpenSSH], it was silently not doing
  anything (no errors after "Ban x.x.x.x", but no IP addresses in ufw
  status).

Re-arranged the bash commands on two lines, and it works with or without
<application>.
2015-04-28 11:39:00 -07:00
Yaroslav Halchenko 4aafb2d4ac Merge pull request #1035 from leeclemens/add-drupal-filter
Add drupal-auth filter and jail
2015-04-27 14:39:21 -04:00
Lee Clemens 8f792f52fb Add drupal-auth filter and jail 2015-04-27 13:10:27 -04:00
Yaroslav Halchenko b989027329 refreshed backport patch 2015-04-26 22:03:47 -04:00
Yaroslav Halchenko 5b33e57053 refreshed patches 2015-04-26 22:00:24 -04:00
Yaroslav Halchenko d8469b3973 Added regular python to Recommends since apache-fakegooglebot still python2 2015-04-26 21:59:21 -04:00
Yaroslav Halchenko fc70f0922c Merge tag '0.9.2' into debian 2015-04-26 21:57:40 -04:00
Yaroslav Halchenko 0f75ed5e2a Just use a system wide python in the tests digest.py
to stay inline with the other scripts
2015-04-26 21:57:13 -04:00
Yaroslav Halchenko 5a8d39fc22 updated changelog 2015-04-26 21:52:01 -04:00
Yaroslav Halchenko a1dbfdb478 Merge tag '0.9.2' into debian
Long delayed and possibly incomplete 0.9.2 release:

ver. 0.9.2 (2015/04/26) - better-quick-now-than-later
----------

- Fixes:
   * infinite busy loop on _escapedTags match in substituteRecursiveTags gh-907.
     Thanks TonyThompson
   * port[s] typo in jail.conf/nginx-http-auth gh-913. Thanks Frederik Wagner
     (fnerdwq)
   * $ typo in jail.conf. Thanks Skibbi. Debian bug #767255
   * grep'ing for IP in *mail-whois-lines.conf should now match also
     at the beginning and EOL.  Thanks Dean Lee
   * jail.conf
     - php-url-fopen: separate logpath entries by newline
   * failregex declared direct in jail was joined to single line (specifying of
     multiple expressions was not possible).
   * filters.d/exim.conf - cover different settings of exim logs
     details. Thanks bes.internal
   * filter.d/postfix-sasl.conf - failregex is now case insensitive
   * filters.d/postfix.conf - add 'Client host rejected error message' failregex
   * fail2ban/__init__.py - add strptime thread safety hack-around
   * recidive uses iptables-allports banaction by default now.
     Avoids problems with iptables versions not understanding 'all' for
     protocols and ports
   * filter.d/dovecot.conf
     - match pam_authenticate line from EL7
     - match unknown user line from EL7
   * Use use_poll=True for Python 2.7 and >=3.4 to overcome "Bad file
     descriptor" msgs issue (gh-161)
   * filter.d/postfix-sasl.conf - tweak failregex and add ignoreregex to ignore
     system authentication issues
   * fail2ban-regex reads filter file(s) completely, incl. '.local' file etc.
     (gh-954)
   * firewallcmd-* actions: split output into separate lines for grepping (gh-908)
   * Guard unicode encode/decode issues while storing records in the database.
     Fixes "binding parameter error (unsupported type)" (gh-973), thanks to kot
     for reporting
   * filter.d/sshd added regex for matching openSUSE ssh authentication failure
   * filter.d/asterisk.conf:
     - Dropped "Sending fake auth rejection" failregex since it incorrectly
       targets the asterisk server itself
     - match "hacking attempt detected" logs

- New Features:
   - New filters:
     - postfix-rbl  Thanks Lee Clemens
     - apache-fakegooglebot.conf  Thanks Lee Clemens
     - nginx-botsearch  Thanks Frantisek Sumsal
   - New recursive embedded substitution feature added:
     - `<<PREF>HOST>` becomes `<IPV4HOST>` for PREF=`IPV4`;
     - `<<PREF>HOST>` becomes `1.2.3.4` for PREF=`IPV4` and IPV4HOST=`1.2.3.4`;
   - New interpolation feature for config readers - `%(known/parameter)s`.
     (means last known option with name `parameter`). This interpolation makes
     possible to extend a stock filter or jail regexp in .local file
     (opposite to simply set failregex/ignoreregex that overwrites it),
     see gh-867.
   - Monit config for fail2ban in files/monit/
   - New actions:
     - action.d/firewallcmd-multiport and action.d/firewallcmd-allports Thanks Donald Yandt
     - action.d/sendmail-geoip-lines.conf
     - action.d/nsupdate to update DNSBL. Thanks Andrew St. Jean
   - New status argument for fail2ban-client -- flavor:
     fail2ban-client status <jail> [flavor]
     - empty or "basic" works as-is
     - "cymru" additionally prints (ASN, Country RIR) per banned IP
       (requires dnspython or dnspython3)
   - Flush log at USR1 signal

- Enhancements:
   * Enable multiport for firewallcmd-new action.  Closes gh-834
   * files/debian-initd migrated from the debian branch and should be
     suitable for manual installations now (thanks Juan Karlo de Guzman)
   * Define empty ignoreregex in filters which didn't have it to avoid
     warnings (gh-934)
   * action.d/{sendmail-*,xarf-login-attack}.conf - report local
     timezone not UTC time/zone. Closes gh-911
   * Conditionally log Ignore IP with reason (dns, ip, command). Closes gh-916
   * Absorbed DNSUtils.cidr into addr2bin in filter.py, added unittests
   * Added syslogsocket configuration to fail2ban.conf
   * Note in the jail.conf for the recidive jail to increase dbpurgeage (gh-964)

* tag '0.9.2': (140 commits)
  DOC: Slight tune up to RELEASE doc -- no need for PYTHONPATH to run tests
  MANIFEST: updated for some new files, sorted all entries, removed some duplicates
  Initial changes for the release -- simplified ChangeLog header etc
  added \s after host
  replaced .* before rhost with regex matching all the previous fields
  Fixed typo in filter description authentification instead of authentication
  Fixed the UTC -> CEST difference...
  Added changes to ChangeLog & updated sample test cases
  updated filter.d/sshd.conf
  Do not run smtp tests if no_network set
  BF: if install pypy -- come back to original directory
  BF(OSX): apparently exceptions could not be compared for identity, use repr
  very long time resolving IP for address "abcdef" on some PDC, under NAT etc. - replaced via "abcdef.abcdef" to prevent searching in local domains;
  fix test for invalid IP (use TEST-NET-1 according to RFC 5737): since fef031b3cd failed, because on some platforms like vm:debian 10.0.0.0 returns 'localhost' (intern network).
  Match hacking attempt IP instead of asterisk server IP (closes #1000)
  BF: fixing up version comparison for pypy.  Issue appeared in 2.5.0
  ENH: minor formatting, no functional changes
  BF: do not expect setting logtarget to SYSLOG to work on non-Linuxes
  Added a comment about systemd backend for jails with logs outside of journal (Closes #959)
  DOC: make a warning for recidive jail to increase dbpurgeage (Closes #964)
  ...
2015-04-26 21:51:19 -04:00
Yaroslav Halchenko 1784205ff8 DOC: Slight tune up to RELEASE doc -- no need for PYTHONPATH to run tests 2015-04-26 21:49:58 -04:00
Yaroslav Halchenko 1fb867b839 MANIFEST: updated for some new files, sorted all entries, removed some duplicates 2015-04-26 21:47:28 -04:00
Yaroslav Halchenko ca849b93dc Initial changes for the release -- simplified ChangeLog header etc 2015-04-26 21:39:54 -04:00
Yaroslav Halchenko 23d9e22477 Merge pull request #1001 from leeclemens/bf/1000-asteriskBlocksSelf
Match hacking attempt IP instead of asterisk server IP (closes #1000)
2015-04-26 21:02:04 -04:00
Lee Clemens b530d88eca Merge remote-tracking branch 'upstream/master' into bf/1000-asteriskBlocksSelf
Conflicts:
	ChangeLog
2015-04-26 15:13:59 -04:00
Yaroslav Halchenko 3b4bf59c6a Moved python3-systemd to Recommends from Suggests given that systemd is the default init system now. Should help people upgrading on Ubuntu 15.04 as well 2015-04-26 13:17:01 -04:00
Yaroslav Halchenko 878cbd008e Merge pull request #1024 from themanwhosold/master
updated filter.d/sshd.conf
2015-04-17 08:06:25 -04:00
Markus Oesterle f8c7247f42 added \s after host 2015-04-17 10:22:01 +02:00
Markus Oesterle 5f2807b41f replaced .* before rhost with regex matching all the previous fields 2015-04-17 10:04:35 +02:00
Markus Oesterle 6ba389c70c Fixed typo in filter description authentification instead of authentication 2015-04-16 23:43:57 +02:00
Markus Oesterle 7a1f1c6b0c Fixed the UTC -> CEST difference... 2015-04-16 21:54:57 +02:00
Markus Oesterle b9a09af914 Added changes to ChangeLog & updated sample test cases 2015-04-16 21:33:57 +02:00
Markus Oesterle 8825a5f31b updated filter.d/sshd.conf
Added line to match sshd auth errors on OpenSuSE systems
2015-04-16 19:48:28 +02:00
Viktor Szépe e776a4e1ab Update proftpd.conf 2015-04-08 15:57:39 +02:00
Yaroslav Halchenko 13d56af981 Merge pull request #1018 from opoplawski/no_network
Do not run smtp tests if no_network set
2015-04-07 21:33:09 -04:00
Orion Poplawski aa8113c128 Do not run smtp tests if no_network set 2015-04-07 15:52:29 -06:00
Viktor Szépe f9e8a99a79 Non-US locale warning for proftpd 2015-04-06 17:04:41 +02:00
Thomas Mayer 923d807ef8 use human-readable variable names (issue #1003) 2015-03-29 18:18:30 +02:00
Thomas Mayer 675c3a7c95 use printf instead of echo for POSIX compatibility (issue #1003) 2015-03-29 18:08:47 +02:00
Thomas Mayer ac1e41ea70 Revert "remove '-ne' option as it's not interpreted any way (issue #1003)"
This reverts commit 4a598070c8.
2015-03-29 17:54:25 +02:00
Thomas Mayer 4a598070c8 remove '-ne' option as it's not interpreted any way (issue #1003) 2015-03-28 06:58:01 +01:00
Thomas Mayer 1c2e8f4185 Add myself to the THANKS section 2015-03-27 19:12:05 +01:00
Thomas Mayer 80f11a4d28 Add empty Init Section to pass tests (issue #1003) 2015-03-27 18:36:09 +01:00
Thomas Mayer c0cf3daac8 Add myself to the changelog 2015-03-27 18:20:25 +01:00
Thomas Mayer c9b24839e4 Character detection heuristics for whois output via optional setting in mail-whois*.conf (Closes #1003)
when set by user,
 - detects character set of whois output (which is undefined by RFC 3912) via heuristics of the file command
 - converts whois data to UTF-8 character set with iconv
 - sends the whois output in UTF-8 character set to mail program
 - avoids that heirloom mailx creates binary attachment for input with unknown character set
2015-03-27 14:27:41 +01:00
Csaba Tóth 0720c831b7 Fix of LC_TIME usage, it should be LC_ALL 2015-03-26 03:02:02 +01:00
Yaroslav Halchenko c926af1fce Merge pull request #1002 from sebres/_bf/fix-invalid-ip
fix test for invalid IP (use TEST-NET-1 according to RFC 5737)
2015-03-25 14:02:00 -04:00
Yaroslav Halchenko b2c1673d28 BF: if install pypy -- come back to original directory 2015-03-25 12:56:25 -04:00
Yaroslav Halchenko eb05cd7bd5 BF(OSX): apparently exceptions could not be compared for identity, use repr 2015-03-25 11:27:22 -04:00
sebres 6da0c4ad48 very long time resolving IP for address "abcdef" on some PDC, under NAT etc. - replaced via "abcdef.abcdef" to prevent searching in local domains; 2015-03-25 01:50:51 +01:00
sebres c5ba76aab8 fix test for invalid IP (use TEST-NET-1 according to RFC 5737):
since fef031b3cd failed, because on some platforms like vm:debian 10.0.0.0 returns 'localhost' (intern network).
2015-03-25 01:24:33 +01:00
Lee Clemens 72f4bcfbff Match hacking attempt IP instead of asterisk server IP (closes #1000) 2015-03-24 19:03:26 -04:00
Yaroslav Halchenko d28880fdca Merge pull request #997 from yarikoptic/bf/long-purge-for-recidive
DOC: make a warning for recidive jail to increase dbpurgeage (Closes #964)
2015-03-23 21:30:04 -04:00
Yaroslav Halchenko 54f111429d BF: fixing up version comparison for pypy. Issue appeared in 2.5.0
00:11  yoh: upgraded to 2.5.0 from debianexperimental and now reproduced locally
00:12  yoh: why pypy --version  directs output to stderr?  thereis no error
00:12  mattip: ok, can you try with a nightly from http://buildbot.pypy.org/nightly/trunk ?
00:15 * yoh running with 2.6.0-alpha0...
00:16  yoh: clean -- no crash
2015-03-23 21:28:16 -04:00
Yaroslav Halchenko 9339293413 ENH: minor formatting, no functional changes 2015-03-23 21:26:17 -04:00
ediazrod 5fdd1d1ded Update shorewall-ipset-proto6.conf 2015-03-23 00:56:37 +01:00
ediazrod e26a1ad6b6 Update shorewall-ipset-proto6.conf 2015-03-23 00:55:06 +01:00
Yaroslav Halchenko 4a83741397 BF: do not expect setting logtarget to SYSLOG to work on non-Linuxes
I have no BSD buildbots available for *BSDs etc, so can't speak for all, but
http://nipy.bic.berkeley.edu/builders/fail2ban-py2.6-osx-10.6_master/builds/151/steps/shell_1/logs/stdio
suggests that logically fails on OSX
2015-03-21 22:30:58 -04:00
Yaroslav Halchenko 56aacf872c Merge pull request #952 from ache/master
Update bsd-ipfw.conf
2015-03-21 21:46:54 -04:00
Yaroslav Halchenko 02836b599c Added a comment about systemd backend for jails with logs outside of journal (Closes #959) 2015-03-21 21:25:50 -04:00
Yaroslav Halchenko 320a28a4a4 DOC: make a warning for recidive jail to increase dbpurgeage (Closes #964) 2015-03-21 20:50:03 -04:00
Yaroslav Halchenko 938e6343ea Merge pull request #996 from yarikoptic/bf/no-dns-module
BF/TST: expect ['error'] as a value if no dns module available
2015-03-21 20:27:15 -04:00
Yaroslav Halchenko d5d8bc8134 Merge pull request #986 from yarikoptic/bf/pypy-2.4.0
BF: use daily build of pypy until next one gets released
2015-03-21 20:26:45 -04:00
Yaroslav Halchenko 382e7f02ca BF: expect ['error'] as a value if no dns module available
As many buildbots show:
e.g. http://nipy.bic.berkeley.edu/builders/fail2ban-py2.7-osx-10.8_master/builds/163/steps/shell_1/logs/stdio
2015-03-21 16:04:34 -04:00
Yaroslav Halchenko 782629c256 Merge pull request #985 from yarikoptic/bf/bad_file_descr_3.4
BF: asyncore.loop poll=True for recent (>=3.4) pythons too
2015-03-21 13:31:10 -04:00
Yaroslav Halchenko 3f3ddaceae print travis python version to figure out why not in effect 2015-03-06 08:53:12 -05:00
Yaroslav Halchenko dd9b5f75af BF: use daily build of pypy until next one gets released 2015-03-06 00:20:17 -05:00
Yaroslav Halchenko 31d107d181 BF: asyncore.loop poll=True for recent (>=3.4) pythons too
should avoid
  File /usr/lib/python3.4/asyncore.py, line 208, in loop
    poll_fun(timeout, map)
  File /usr/lib/python3.4/asyncore.py, line 145, in poll
    r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor
2015-03-05 22:52:40 -05:00
Yaroslav Halchenko daa2a9e5d8 Merge pull request #975 from sebres/gh-973-fix
BF: binding parameter error (unsupported type) (closes gh-973) ...
2015-03-05 22:47:45 -05:00
Yaroslav Halchenko 954075449d BF: fixed casing in __sigUSR1handler 2015-02-26 20:59:52 -05:00
Yaroslav Halchenko e52790073d Merge pull request #979 from tgyurci/master
Flush logs at USR1 signal
2015-02-26 21:00:07 -05:00
Teubel György 0254cbf7fb Flush logs at USR1 signal 2015-02-26 23:23:10 +01:00
ediazrod d0887f3234 This is a especific configuration for shorewall ipset proto6
Use ipset proto6 in shorewall. You must follow the rules to enable ipset in you blacklist

if you have a lot of spam (my case) is better use ipset rather than shorewall command line (is my firewall)
stop fail2ban with shorewall on one list of 1000 Ips takes 5 min with ipset in shorewall 10 sec.
2015-02-26 18:48:31 +01:00
sebres 5ab30c88c2 more stable handling of json dump/load different encoded strings for older python versions;
extended test cases (more precise, python version insensitive, etc.)
2015-02-25 22:14:49 +01:00
sebres 2bfe22aa66 makes test case more precise; 2015-02-25 15:05:32 +01:00
sebres 6c788a32ee BF: binding parameter error (unsupported type) by writing json with invalid encoded lines into sqlite database (gh-973);
especially python < 3.0; try to prevent occurring such errors in the future;
2015-02-25 11:56:11 +01:00
Lee Clemens 50cbd4e9eb Merge pull request #961 from yarikoptic/enh/logencoding_msg
ENH: explicitly hint on logencoding setting in jail (Close #909)
2015-02-18 21:19:18 -05:00
Yaroslav Halchenko 82d5e6b840 ENH: explicitly hint on logencoding setting in jail (Close #909) 2015-02-18 21:00:35 -05:00
Yaroslav Halchenko 83805ee5dc Changelog for preceding merge 2015-02-14 16:07:28 -05:00
Yaroslav Halchenko e788e3823e Merge pull request #965 from TorontoMedia/master
Split output of firewallcmd list into separate lines for grepping (Close #908)
2015-02-14 16:06:10 -05:00
TorontoMedia b4f1f613bb Update firewallcmd-allports.conf 2015-02-14 12:32:36 -05:00
TorontoMedia 0fac7e40b6 Update firewallcmd-multiport.conf 2015-02-14 12:31:33 -05:00
Yaroslav Halchenko 54e182e017 Merge pull request #955 from sebres/fail2ban-regex-gh-954
BF: fail2ban-regex does not read '.local' file of given filter (Close #954)
2015-02-14 09:44:54 -05:00
Yaroslav Halchenko ae2af0d51b Minor tune up to changelog (we should eventually just make it into .md format) 2015-02-14 09:37:13 -05:00
Yaroslav Halchenko 07b0ab07ad Merge branch 'master' of https://github.com/rumple010/fail2ban
* 'master' of https://github.com/rumple010/fail2ban:
  Changed default TTL value to 60 seconds.
  Added a reminder to create an nsupdate.local file to set required options.
  Modified the ChangeLog and THANKS files to reflect the addition of action.d/nsupdate.conf.
  add nsupdate action

Conflicts:
	ChangeLog
2015-02-14 09:32:05 -05:00
Yaroslav Halchenko be75519402 Merge pull request #956 from yarikoptic/enh/badips_categories
ENH: check badips.com response on presence of "categories" in it
2015-02-14 09:30:26 -05:00
sebres 74c6f6ac4b BF: fail2ban-regex does not read '.local' file of given filter (gh-954) 2015-02-13 15:36:00 +01:00
Yaroslav Halchenko d5e68abf95 ENH: check badips.com response on presence of "categories" in it
As https://travis-ci.org/fail2ban/fail2ban/jobs/50609529 query might fail in
that response would not contain "categories".  With this change we will handle
it explicitly and will spit out ValueError, providing information about
the response so it could be troubleshooted
2015-02-13 08:55:35 -05:00
Ache ae1451b29f Update bsd-ipfw.conf
Deleting not existent is not error.
Adding already present is not error.
Otherwise all those entries becomes stale forever, not removed and its number increases over time.
2015-02-08 15:55:32 +03:00
Yaroslav Halchenko 3fb2becddb Merge pull request #949 from leeclemens/enh/configSyslogSocket
Configure Syslog Socket Path (closes #814)
2015-02-06 20:08:15 -05:00
Lee Clemens 6268eb32be Use syslogsocket value "auto" to determine syslog socket's path 2015-02-06 19:14:09 -05:00
Yaroslav Halchenko b46ac0b58e Merge pull request #950 from lwh/master
Fixed grammatical error in emails sent
2015-02-06 11:51:19 -05:00
Luke Hollins 549ab24e70 Fixed grammatical error in emails sent 2015-02-06 11:47:03 -05:00
Yaroslav Halchenko 119a7bbb16 Merge pull request #939 from szepeviktor/geoip
Added sendmail-geoip-lines.conf
2015-02-06 11:32:41 -05:00
Viktor Szépe 4c88a00c28 Line notes implemented 2015-02-06 17:22:30 +01:00
Lee Clemens d676a9fd4f update ChangeLog with syslogsocket config enhancement 2015-02-05 23:48:18 -05:00
Lee Clemens 445fd7367f Configure Syslog Socket Path 2015-02-05 23:44:57 -05:00
Yaroslav Halchenko 40068f5f31 Merge pull request #933 from mrc0mmand/nginx-botsearch
Add jail nginx-botsearch and refactor common with apache-botsearch regexes into botsearch-common
2015-02-04 09:27:43 -05:00
Yaroslav Halchenko eaca33e227 Merge branch 'enh/clarifyDnsUtilsMethods' of https://github.com/leeclemens/fail2ban
* 'enh/clarifyDnsUtilsMethods' of https://github.com/leeclemens/fail2ban:
  Update ChangeLog
  Clarify filter.DNSUtils functions' terminology and add unittests

Conflicts:
	ChangeLog -- rephrased a bit as well
2015-02-03 20:29:03 -05:00
Lee Clemens ed71a7cd22 Update ChangeLog 2015-02-03 20:23:25 -05:00
Lee Clemens b28fea4d41 Clarify filter.DNSUtils functions' terminology and add unittests 2015-02-03 20:19:39 -05:00
František Šumšal 9bd25f51c1 Added ChangeLog and THANKS entry 2015-02-04 02:19:15 +01:00
František Šumšal 642e425f75 Merge branch 'master' into nginx-botsearch 2015-02-04 02:18:14 +01:00
Yaroslav Halchenko 5b3aa42c42 Merge pull request #945 from leeclemens/ENH/ChangeLogForLogIgnoreCause
Update ChangeLog from PR 930
2015-02-03 20:16:30 -05:00
Yaroslav Halchenko 43a30f0ad6 Added to CONTRIBUTING.md minimal guidelines for PRs 2015-02-03 20:14:53 -05:00
František Šumšal eb0d086ed0 Merge branch 'master' into nginx-botsearch 2015-02-04 02:13:33 +01:00
Lee Clemens 4091fdde27 Update ChangeLog from PR 930 2015-02-03 19:54:23 -05:00
František Šumšal 1c6d2074fb Changed default settings for nginx-botseach filter 2015-02-04 01:48:59 +01:00
Yaroslav Halchenko 991096e599 Merge pull request #930 from leeclemens/ENH/916-logCauseOfIgnore
Conditionally log Ignore IP, and pass in reason (Closes #916)
2015-02-03 19:24:59 -05:00
Yaroslav Halchenko 51333bb0a6 just a bit of description for a test case 2015-02-03 18:38:19 -05:00
Lee Clemens 50d18f68df fix typo (false positive test) 2015-02-03 18:18:09 -05:00
Lee Clemens c755138672 create OK and NOK methods 2015-02-03 18:11:49 -05:00
Lee Clemens 8233f21fc2 Remove duplicate unittests 2015-02-03 18:06:30 -05:00
Lee Clemens aa848a5f9e Combine ignore cause unitests 2015-02-03 18:02:42 -05:00
Orion Poplawski e7ff7e90b7 [postfix-sasl] update regexes
- Add : to match "SASL LOGIN authentication failed: Password:"
- Add ignoreregex to ignore system authentication issues:
  "warning: unknown[1.1.1.1]: SASL LOGIN authentication failed: Connection lost to authentication server"
- Add test log messages for both
2015-02-03 11:30:16 -07:00
František Šumšal fb0f463eac Include consistency 2015-02-03 15:54:05 +01:00
František Šumšal 705718be52 Filter apache-botsearch.conf now loads variables from botsearch-common.conf 2015-02-03 04:44:33 +01:00
František Šumšal 18778d9174 Created botsearch-common.conf
File contains variables used in -botsearch filters
2015-02-03 04:25:47 +01:00
Lee Clemens 3186df55e3 add Ignore DNS and IP test cases 2015-02-02 21:55:44 -05:00
Yaroslav Halchenko 646c799231 Changelog for above merge 2015-02-02 21:46:38 -05:00
Yaroslav Halchenko 1fbafa46c9 Merge pull request #918 from sebres/issue/161
Issue/161
2015-02-02 21:44:57 -05:00
Yaroslav Halchenko 73af02ffc6 Merge pull request #940 from leeclemens/ENH/ApacheFakeGoogleBot
New jail: apache-fakegooglebot
2015-02-02 21:44:04 -05:00
Yaroslav Halchenko df581fe6e2 Merge pull request #929 from opoplawski/pam_auth
Add filter variable __pam_auth to allow customize for setups with multiple authorization schemes (Close #928)
2015-02-02 21:42:10 -05:00
Yaroslav Halchenko 7f2d1a7269 minor changelog entry reformatting 2015-02-02 21:37:24 -05:00
Yaroslav Halchenko 7ada96b4e9 Merge pull request #932 from opoplawski/dovecot
Dovecot - dovecot auth failure from EL7
2015-02-02 21:37:28 -05:00
František Šumšal f8fe165cd2 Switched from tabs to spaces for indents 2015-02-03 03:35:22 +01:00
Yaroslav Halchenko 767ac4ecac Merge branch 'master' of git://github.com/fail2ban/fail2ban
* 'master' of git://github.com/fail2ban/fail2ban:
  Remove trailing semicolons
2015-02-02 21:21:54 -05:00
Yaroslav Halchenko 8f6d9c6a5a Merge branch 'enh/local_time_zone' of https://github.com/yarikoptic/fail2ban
* 'enh/local_time_zone' of https://github.com/yarikoptic/fail2ban:
  fixed typos, thanks szepeviktor for review
  ENH: use non-UTC date invocation (without -u) and report offset for localzone (%z)

Conflicts:
	ChangeLog
2015-02-02 21:21:44 -05:00
Yaroslav Halchenko 96ae041132 fixed typos, thanks szepeviktor for review 2015-02-02 21:21:37 -05:00
Yaroslav Halchenko fc0ac45f55 Merge pull request #942 from leeclemens/ENH/RemoveTrailingSemicolons
Remove trailing semicolons
2015-02-02 20:56:21 -05:00
Lee Clemens 2d266d96d5 Remove trailing semicolons 2015-02-02 19:03:43 -05:00
Lee Clemens b725db04d8 Add ignorecommands to MANIFEST*'s 2015-02-02 15:03:44 -05:00
Lee Clemens eb17b68641 fix test for invalid IP 2015-02-02 14:03:35 -05:00
Lee Clemens fef031b3cd test ipToName Exception 2015-02-02 14:01:48 -05:00
Lee Clemens 4cfbb840ad move test to more sensible function name 2015-02-02 13:40:56 -05:00
Lee Clemens 0463518d28 Add testcase for DNSUtils.ipToName 2015-02-02 13:14:53 -05:00
Lee Clemens d0986148f0 Merge branch 'yarikoptic-enh/fakegooglebot' into ENH/ApacheFakeGoogleBot 2015-02-02 13:02:19 -05:00
Lee Clemens 841c476045 Merge branch 'enh/fakegooglebot' of https://github.com/yarikoptic/fail2ban into yarikoptic-enh/fakegooglebot
Conflicts:
	config/filter.d/ignorecommands/apache-fakegooglebot
2015-02-02 13:01:23 -05:00
Yaroslav Halchenko 15b65c7ad2 NF: apache-fakegooglebot ignorecommand + DNSUtils.ipToName 2015-02-02 12:19:20 -05:00
Lee Clemens 7e94ba6f0c Remove implementation specific suffix 2015-02-02 11:43:05 -05:00
Lee Clemens 854915920f Remove implementation specific suffix 2015-02-02 11:38:23 -05:00
Lee Clemens 00961d5281 Remove ignorecommand addition from ChangeLog 2015-02-02 11:36:21 -05:00
Lee Clemens 38415d2cf1 Add trailing comma back to list 2015-02-02 11:29:27 -05:00
Lee Clemens af078532ac New jail: apache-fakegooglebot
Detects fake googlebot user agents in apache access log
2015-02-02 00:42:01 -05:00
Viktor Szépe 0430e0dacc Changelog entry for sendmail-geoip-lines 2015-02-01 00:24:40 +01:00
Viktor Szépe 1619ab3145 Added sendmail-geoip-lines.conf 2015-02-01 00:06:56 +01:00
Yaroslav Halchenko cac0848d2c Merge pull request #936 from yarikoptic/enh/ignoreregex
ENH: define ignoreregex for all filters explicitly, to avoid warnings (Closes #934)
2015-01-31 11:53:27 -05:00
Yaroslav Halchenko ec6a30efcf ENH: define ignoreregex for all filters explicitly, to avoid warnings (Closes #934) 2015-01-30 10:38:28 -05:00
František Šumšal c8e82f18b6 Add jail nginx-botsearch
Jail blocks requests for predefined non-existent folders. Based on
apache-botsearch jail.
2015-01-29 17:57:52 +01:00
Orion Poplawski b4776a1ba0 Match dovecot unknown user line 2015-01-29 09:37:37 -07:00
Orion Poplawski ee5c5b34d6 Add ChangeLog and THANKS entry 2015-01-29 09:14:41 -07:00
Orion Poplawski 3bc92610f7 Add dovecot auth failure from EL7 2015-01-29 09:11:59 -07:00
Yaroslav Halchenko c96415da27 added $named and ufw to debian-initd (Debian bug #776572) 2015-01-29 08:32:20 -05:00
Andrew St. Jean 6bdfe756cf Changed default TTL value to 60 seconds. 2015-01-28 22:46:43 -05:00
Lee Clemens f4341999cd simplify/unify log message 2015-01-28 19:43:22 -05:00
Lee Clemens 076b103f97 Conditionally log Ignore IP, and pass in reason (ignoreip, ignorecommand) 2015-01-27 21:06:06 -05:00
Orion Poplawski 79b5a2617f Add filter variable __pam_auth to allow easier changing of pam auth backend 2015-01-27 14:34:27 -07:00
Yaroslav Halchenko 64feb0fd16 Merge pull request #924 from leeclemens/ENH/StatusExtendedInfo
Add extended info to status output using Cymru
2015-01-26 22:55:12 -05:00
Andrew St. Jean 43732acae1 Added a reminder to create an nsupdate.local file to set required options. 2015-01-26 21:48:16 -05:00
Lee Clemens 887fa2a3a0 Update protocol with [FLAVOR] argument to status <JAIL> 2015-01-26 20:11:53 -05:00
Lee Clemens 297a32e6bb Update test since JailThread.action was changed from property to method 2015-01-26 20:02:49 -05:00
Lee Clemens 767fc0d4d4 Merge branch 'ENH/StatusExtendedInfo' of github.com:leeclemens/fail2ban into ENH/StatusExtendedInfo
Conflicts:
	ChangeLog
	fail2ban/server/actions.py
	fail2ban/server/server.py
	fail2ban/server/transmitter.py
	fail2ban/tests/servertestcase.py
2015-01-26 19:50:46 -05:00
Lee Clemens 486214585e Update extended status to accept additional argument, flavor
Default to as-in behavior, or flavor=="basic"
2015-01-26 19:38:06 -05:00
Andrew St. Jean e0f11ae722 Modified the ChangeLog and THANKS files to reflect the addition of action.d/nsupdate.conf. 2015-01-26 11:30:41 -05:00
Yaroslav Halchenko 085d0f72ed ENH: use non-UTC date invocation (without -u) and report offset for localzone (%z) 2015-01-26 09:19:44 -05:00
Yaroslav Halchenko 65980a70fc Merge branch 'enh/recidive-allports' of https://github.com/yarikoptic/fail2ban
* 'enh/recidive-allports' of https://github.com/yarikoptic/fail2ban:
  use iptables-allports for recidive

Conflicts:
	ChangeLog
2015-01-26 09:04:42 -05:00
Yaroslav Halchenko 4f28bc4fb0 Merge pull request #922 from leeclemens/ENH/pypy3TravisSupport
Add pypy3 Travis Support
2015-01-26 09:01:06 -05:00
rumple010 eb76dcd5a0 add nsupdate action
Adds a new action file that uses nsupdate to dynamically update a BIND
zone file with a TXT resource record representing a banned IP address.
Resource record is deleted from the zone when the ban expires.
2015-01-25 23:15:07 -05:00
Lee Clemens dfe4d02f65 Remove version specific package 2015-01-24 12:45:42 -05:00
Lee Clemens 735c51adae fix test of new banManager's instance 2015-01-24 12:45:42 -05:00
Lee Clemens a0debea56a test dnspython nxdomain returned 2015-01-24 12:45:42 -05:00
Lee Clemens 07a47179a7 conditionally import dnspython 2015-01-24 12:45:42 -05:00
Lee Clemens ef3c942808 add dnspython[3] optional dependencies 2015-01-24 12:45:42 -05:00
Lee Clemens 405f363fe8 Conditionally test fail2ban-client status <JAIL> extended when dnspython is installed 2015-01-24 12:45:42 -05:00
Lee Clemens ba69969057 Add pass to empty methods 2015-01-24 12:45:42 -05:00
Lee Clemens 60ac0a1a17 Add extended info to status output using Cyrmu 2015-01-24 12:45:42 -05:00
Lee Clemens 13b2aea48a Remove version specific package 2015-01-24 12:22:34 -05:00
Lee Clemens 03db257c43 fix test of new banManager's instance 2015-01-23 16:18:09 -05:00
Lee Clemens ce0fe8b907 test dnspython nxdomain returned 2015-01-23 16:00:49 -05:00
Lee Clemens 256c871121 conditionally import dnspython 2015-01-23 16:00:33 -05:00
Lee Clemens 8fd9d6a770 add dnspython[3] optional dependencies 2015-01-23 15:43:58 -05:00
Lee Clemens a80ff26e15 Conditionally test fail2ban-client status <JAIL> extended when dnspython is installed 2015-01-23 15:40:00 -05:00
Lee Clemens a8f057eab7 Add pass to empty methods 2015-01-23 15:27:33 -05:00
Lee Clemens 7d0700b6f8 merge ENH/UseTravisRetry 2015-01-23 15:20:56 -05:00
Yaroslav Halchenko cfaa76a355 Merge pull request #923 from leeclemens/ENH/UseTravisRetry
Use travis_retry for commands which use the internet
2015-01-23 15:14:04 -05:00
Lee Clemens 625bcef8a1 Add extended info to status output using Cyrmu 2015-01-23 15:12:04 -05:00
Lee Clemens d01099f347 Use travis_retry for commands which use the internet 2015-01-23 14:43:00 -05:00
Lee Clemens 40eb7a40f7 Add pypy3 Travis Support 2015-01-23 13:54:00 -05:00
Yaroslav Halchenko 17b3df004e Merge pull request #919 from sebres/issue/907-embedded
Issue/907 + embedded
2015-01-21 11:53:25 -05:00
sebres d0b932aaca code review + more test cases (embedded replace in a string) 2015-01-21 09:44:55 +01:00
sebres 6b42878b8c better recognition of embedded-recursive substitution to repeat interpolation 2015-01-20 17:31:17 +01:00
sebres 33e9e2174a recursive/embedded version of issue/907;
test cases merged from remote-tracking branch 'yarikoptic:enh/embedded_tags' into issue/907
infinite busy loop on _escapedTags match in substituteRecursiveTags gh-907
2015-01-20 17:18:25 +01:00
sebres 607af36ad3 workaround for the "Bad file descriptor" issue on Python 2.7, gh-161 : asyncore.loop() using poll
by the way, prevents to write "'build/bdist.linux-x86_64' does not exist -- can't clean it" into stderr;
2015-01-20 14:08:30 +01:00
sebres b04a51246f infinite busy loop on _escapedTags match in substituteRecursiveTags gh-907 2015-01-20 11:32:15 +01:00
Yaroslav Halchenko 9720e0971e Merge pull request #915 from sebres/issue/913
port[s] typo fixed in jail.conf/nginx-http-auth, issue gh-913
2015-01-19 09:10:31 -05:00
sebres 12e3cca3f2 port[s] typo fixed in jail.conf/nginx-http-auth, issue gh-913 2015-01-19 10:28:53 +01:00
Yaroslav Halchenko fdd93d1475 ENH: unittest to catch actions without Init or Definition section and all must have actionban at least 2015-01-08 21:51:52 -05:00
Yaroslav Halchenko 083031524d BF: adding missing Definition section header to firewallcmd-allports 2015-01-08 21:14:50 -05:00
TorontoMedia d7b7f4bc91 Update firewallcmd-allports.conf 2015-01-08 21:06:43 -05:00
Yaroslav Halchenko c7edd9e67f Merge pull request #901 from leeclemens/ENH/PostfixRBL
Create Jail for Postfix based on RBL
2015-01-07 21:45:36 -05:00
Yaroslav Halchenko 995b1d18df Merge pull request #906 from leeclemens/BF/755-strptime
Fix strptime thread safety issue
2015-01-07 20:40:14 -05:00
Lee Clemens 77677e43df Merge branch 'master' of github.com:fail2ban/fail2ban into ENH/PostfixRBL 2015-01-07 20:39:04 -05:00
sebres d5ebe542f9 Merge branch 'master' into 'sebres:ban-time-incr' 2015-01-05 19:14:51 +01:00
Yaroslav Halchenko a8f26cd2b2 Merge pull request #905 from TorontoMedia/master
Firewallcmd-multiport.conf and Firewallcmd-allports.conf
2015-01-04 11:23:21 -05:00
Lee Clemens 4714028c69 Change case and tense for consistency 2015-01-03 16:16:23 -05:00
Lee Clemens bda8dc1926 Merge branch 'master' of github.com:fail2ban/fail2ban into ENH/PostfixRBL 2015-01-03 15:29:42 -05:00
Lee Clemens 2f360ce447 Update Changelog with strptime fix 2015-01-03 15:26:34 -05:00
Lee Clemens 38641e741a Merge branch 'master' of github.com:fail2ban/fail2ban into BF/755-strptime
Conflicts:
	ChangeLog
2015-01-03 15:25:54 -05:00
Lee Clemens 541a747d79 Update Changelog with strptime fix 2015-01-03 15:19:58 -05:00
Lee Clemens b26725f654 Move strptime workaround to fail2ban/__init__.py 2015-01-03 13:45:06 -05:00
Lee Clemens d0bcacd97b Fix strptime thread safety issue
strptime thread safety hack-around - http://bugs.python.org/issue7980
2015-01-02 02:55:40 -05:00
TorontoMedia 74c3d5d96c Updated ChangeLog 2015-01-01 13:26:11 -05:00
TorontoMedia 948eec6425 Upd 2015-01-01 12:56:17 -05:00
TorontoMedia 7eed55266b Created firewallcmd-multiport 2015-01-01 12:46:48 -05:00
TorontoMedia 9f91cb2fd8 Created firewallcmd-allports 2015-01-01 12:44:34 -05:00
TorontoMedia a47001ea0e Updated ChangeLog 2015-01-01 12:41:31 -05:00
TorontoMedia 1dfd9941df Update THANKS 2015-01-01 05:33:20 -05:00
TorontoMedia 50e5fd9ed7 Create firewallcmd-multiport.conf 2015-01-01 05:32:41 -05:00
TorontoMedia 591e444753 Create firewallcmd-allports.conf 2015-01-01 05:32:06 -05:00
TorontoMedia c2bb3253ad Update ChangeLog 2015-01-01 05:27:18 -05:00
Yaroslav Halchenko 8fc32bb33f Merge pull request #899 from leeclemens/ENH/gitignore
Add .idea dir to .gitignore
2014-12-31 18:48:57 -05:00
Yaroslav Halchenko acfa83229b Merge branch 'master' of git://github.com/fail2ban/fail2ban
* 'master' of git://github.com/fail2ban/fail2ban:
  Update year in postfix logs test file
  Add 'Client host rejected error message' regex Not sure if it was reworded (using Postfix 2.6) or a slightly different error, but I only have "Client host rejected: cannot find your hostname"
2014-12-31 01:12:56 -05:00
Yaroslav Halchenko 12dd23004e Install monit configuration 2014-12-30 19:18:27 -05:00
Lee Clemens 0f48cf4284 loosen up regex for spamhaus (spamcop says "Blocked" as part of url) 2014-12-30 19:14:39 -05:00
Lee Clemens fe72a5585c Create Jail for Postfix based on RBL
Use RBL blocks to ban addresses, unique Jail so maxretry can be set to 1 (vs postfix.conf)
2014-12-30 19:06:17 -05:00
Yaroslav Halchenko 37edb075e9 Merge pull request #900 from leeclemens/ENH/PostfixFilterNoQueue
Add 'Client host rejected error message' regex
2014-12-30 18:44:14 -05:00
Yaroslav Halchenko dacd6c4155 move jail.d ssh default customization into debian/files to please lintian 2014-12-30 18:25:00 -05:00
Lee Clemens e6ffa2e4a1 Update year in postfix logs test file 2014-12-30 18:10:19 -05:00
Lee Clemens 2d7429c47c Add 'Client host rejected error message' regex
Not sure if it was reworded (using Postfix 2.6) or a slightly different error, but I only have "Client host rejected: cannot find your hostname"
2014-12-30 18:05:19 -05:00
Lee Clemens 6c34cf2e1e Add .idea dir to .gitignore 2014-12-30 17:52:45 -05:00
Yaroslav Halchenko 3f390f1ea1 just a patch refresh 2014-12-30 16:59:07 -05:00
Yaroslav Halchenko 67e79a1462 changelog and now we will use upstream's init for debian 2014-12-30 16:58:36 -05:00
Yaroslav Halchenko bfadd0100b Merge commit '0.9.1-44-gd65c4f8' into debian
* commit '0.9.1-44-gd65c4f8': (31 commits)
  moved debian's initd file to files/debian-initd from debian branch
  Update ChangeLog
  Monit config
  BF: adjusted for new IP of example.com
  downcase example
  Added an item to "Fixes"
  postfix-sasl failregex case insensitive
  clean all after test setup (removes a build directory in current root of fail2ban)
  exim filter: correct failregex for exim with extended log options
  small fix: no cover for failed case
  testSetupInstallRoot will be always skipped, because of "wrong" location of 'setup.py';
  better and scalable solution for gh-867 (and gh-868), using only name convention like %(known/failregex)s to add custom expressions, so no interface changes in jail.conf are necessary (for example see test-known-interp in test cases);
  Changelog entry for preceding fix
  Separate php-url-fopen logpath by newline
  python 2.6 compatibility: preventing RuntimeError: dictionary changed size during iteration.
  interpolation of config readers extended with `%(known/parameter)s`. (means last known option with name `parameter`).
  test cases extended (now correct)
  BF: failregex declared direct in jail was joined to single line, (specifying of multiple expressions was not possible); feature request (gh-867): new options for jail introduced addfailregex/addignoreregex: extends regex specified in filter (opposite to failregex/ignoreregex that overwrites it);
  Add ignoreregex to avoid warning on start
  Add ignoreregex to avoid warning on start
  ...
2014-12-30 16:46:11 -05:00
Yaroslav Halchenko d65c4f8f5d moved debian's initd file to files/debian-initd from debian branch 2014-12-30 16:45:35 -05:00
Yaroslav Halchenko bcfcefa203 Merge branch 'patch-2' of https://github.com/szepeviktor/fail2ban
* 'patch-2' of https://github.com/szepeviktor/fail2ban:
  downcase example
  Added an item to "Fixes"
  postfix-sasl failregex case insensitive
2014-12-30 16:35:09 -05:00
Yaroslav Halchenko 35766e720d Merge pull request #896 from szepeviktor/patch-3
Monit config
2014-12-30 15:57:14 -05:00
Viktor Szépe 10f68f4946 Update ChangeLog 2014-12-24 15:00:25 +01:00
Viktor Szépe 971c3d93fe Monit config
Copy it to `/etc/monit/monitrc.d/fail2ban`
More info: https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/monit-debian-setup.sh#L113
2014-12-24 14:45:48 +01:00
Yaroslav Halchenko cc89649d04 BF: adjusted for new IP of example.com
Conflicts:
	fail2ban/tests/filtertestcase.py
2014-12-21 21:45:30 -05:00
Viktor Szépe a9b6a3754b downcase example 2014-12-11 21:01:52 +01:00
Viktor Szépe 190f55b06e Added an item to "Fixes" 2014-12-11 01:34:20 +01:00
Viktor Szépe 81b3dbde1d postfix-sasl failregex case insensitive 2014-12-11 00:10:37 +01:00
sebres 27bc2e012d Merge remote-tracking branch 'master' into sebres:ban-time-incr 2014-12-05 17:41:45 +01:00
Yaroslav Halchenko fb2b52af14 Merge pull request #879 from sebres/broken-test-setup_install_root
testSetupInstallRoot will be always skipped, ...
2014-12-05 11:20:31 -05:00
sebres a71a64733a clean all after test setup (removes a build directory in current root of fail2ban) 2014-12-05 16:39:17 +01:00
Yaroslav Halchenko 20d212dcd8 Merge pull request #873 from bes-internal/patch-1
exim filter: added  matching  of possible port after host
2014-12-04 10:21:13 -05:00
bes-internal ccc986b7d8 exim filter: correct failregex for exim with extended log options
incoming_interface, incoming_port, outgoing_port
2014-12-04 13:34:44 +03:00
sebres 7d4f071d4b small fix: no cover for failed case 2014-12-03 15:25:27 +01:00
sebres d62b046704 testSetupInstallRoot will be always skipped, because of "wrong" location of 'setup.py'; 2014-12-03 14:45:46 +01:00
sebres ef7f3230ec added a test case for upgrade database from v2 (additionally to existing v1); 2014-12-03 10:54:32 +01:00
sebres 4dbc77dbbb code review, test case extended; 2014-12-02 11:57:43 +01:00
sebres 697da99f8f code review and few new test cases 2014-12-02 01:01:10 +01:00
sebres 5ca275876b Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr 2014-12-01 23:28:58 +01:00
Yaroslav Halchenko c5b5695eb9 Merge pull request #868 from sebres/addfailregex-gh-867
"known/" prefix to allow reuse specs from prev files for addfailregex/addignoreregex (Close #867)
2014-12-01 09:02:50 -05:00
sebres 5dc1a583b4 Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr
Conflicts:
	fail2ban/server/actions.py
	fail2ban/server/database.py
	fail2ban/tests/databasetestcase.py
	fail2ban/tests/servertestcase.py
2014-12-01 13:57:51 +01:00
sebres 80fb48c5b0 Merge remote-tracking branch 'remotes/upstream/master' into sebres:addfailregex-gh-867 2014-12-01 13:14:42 +01:00
Yaroslav Halchenko a170afcb76 Merge pull request #839 from sebres/fix-none-getattempt-lambda
Fix none getattempt lambda (close #838,  close #848)
2014-11-29 21:33:09 -05:00
sebres effdb450fc better and scalable solution for gh-867 (and gh-868), using only name convention like %(known/failregex)s to add custom expressions, so no interface changes in jail.conf are necessary (for example see test-known-interp in test cases); 2014-11-29 20:33:32 +01:00
Yaroslav Halchenko 9bab6d0009 Changelog entry for preceding fix 2014-11-29 09:52:25 -05:00
Yaroslav Halchenko 4a620aa2ba Merge pull request #869 from opoplawski/logpath
Separate php-url-fopen logpath by newline
2014-11-29 09:50:42 -05:00
Orion Poplawski d8867807f5 Separate php-url-fopen logpath by newline 2014-11-28 22:04:09 -07:00
sebres 00c2ac4b03 python 2.6 compatibility: preventing RuntimeError: dictionary changed size during iteration. 2014-11-28 19:50:52 +01:00
sebres d63b125877 interpolation of config readers extended with %(known/parameter)s.
(means last known option with name `parameter`).
2014-11-28 19:06:17 +01:00
sebres 1439152121 test cases extended (now correct) 2014-11-28 14:52:12 +01:00
sebres cad09d2df3 BF: failregex declared direct in jail was joined to single line, (specifying of multiple expressions was not possible);
feature request (gh-867): new options for jail introduced addfailregex/addignoreregex: extends regex specified in filter (opposite to failregex/ignoreregex that overwrites it);
2014-11-28 03:17:47 +01:00
Yaroslav Halchenko 72370d2574 Merge pull request #858 from g1franc/master
Add ignoreregex to avoid warning on start
2014-11-15 10:22:12 -05:00
ItsAdventureTime 47f331ef28 Fixed the fail2ban init file issue.
Fixed some issues with the DAEMON's path and the SOCKFILE's location.
2014-11-13 16:14:07 +08:00
Guillaume FRANCOIS a6a2dc868b Add ignoreregex to avoid warning on start 2014-11-12 11:05:56 +01:00
Guillaume FRANCOIS 9269664350 Add ignoreregex to avoid warning on start 2014-11-12 10:30:28 +01:00
Yaroslav Halchenko 6c8cfca5d5 Merge pull request #856 from calestyo/debian-do-not-install-other-distros-files
do not install foreign distro/OS config files
2014-11-11 23:43:07 -05:00
Christoph Anton Mitterer 0e92c5b42a do not install foreign distro/OS config files
• Do not install the following configuration files which are not used within the
  Debian package of fail2ban:
  /etc/fail2ban/paths-fedora.conf
  /etc/fail2ban/paths-freebsd.conf
  /etc/fail2ban/paths-osx.conf
  Closes: Debian bug #767123 (https://bugs.debian.org/767123).

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2014-11-12 05:21:58 +01:00
Yaroslav Halchenko b379f5d51b Merge pull request #852 from sebres/patch-1
Bug fix in formatJournalEntry, gh-851
2014-11-07 07:45:27 -05:00
Serg G. Brester 6dfddbcdf6 Bug fix in formatJournalEntry, gh-851
Unhandled exception in fail2ban 0.9.1 #851
2014-11-07 01:21:38 +01:00
Yaroslav Halchenko 2a3790f8e8 use iptables-allports for recidive 2014-11-04 13:24:54 -05:00
Yaroslav Halchenko a44cfba9ae Merge pull request #841 from opoplawski/firewallcmd-multiport
ChangeLog for firewallcmd-new multiport support
2014-10-30 18:32:26 -04:00
Orion Poplawski 21be983620 ChangeLog for firewallcmd-new multiport support 2014-10-30 16:11:34 -06:00
Yaroslav Halchenko 967485c2d0 improving grepping 2014-10-29 23:14:47 -04:00
Yaroslav Halchenko efbf5064a1 Merge pull request #807 from xslidian/patch-1
grep IP at the start of lines
2014-10-29 23:07:10 -04:00
Yaroslav Halchenko 6d345a13f0 Merge pull request #840 from opoplawski/firewallcmd-multiport
Use multiport for firewallcmd-new
2014-10-29 23:03:56 -04:00
Orion Poplawski 01b2673e34 Use multiport for firewallcmd-new 2014-10-29 16:27:37 -06:00
sebres 92ba5ae09c few confusing merge info helper 2014-10-29 22:08:44 +01:00
sebres 46a8899f20 code review 2014-10-29 19:27:45 +01:00
Yaroslav Halchenko 36abb5ed96 BF: fix $ for % in jail.conf. Debian bug #767255 2014-10-29 13:08:51 -04:00
sebres 8dbc04aa06 Test cases fixed:
testFail2BanExceptHook - use local sys.__excepthook__ to check was really executed and prevent write error in stderr.
2014-10-29 13:30:24 +01:00
sebres 518cc92ccc actions: bug fix in lambdas in checkBan, because getBansMerged could return None (purge resp. asynchronous addBan), make the logic all around more stable;
test cases: extended with test to check action together with database functionality (ex.: to verify lambdas in checkBan);
database: getBansMerged should work within lock, using reentrant lock (cause call of getBans inside of getBansMerged);
2014-10-29 12:36:21 +01:00
sebres 595edc8d46 increase code coverage 2014-10-28 21:57:16 +01:00
sebres c1db282fcd Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr 2014-10-28 16:38:26 +01:00
Yaroslav Halchenko 7acddcbe4a Post-release boost to .dev 2014-10-27 23:45:51 -04:00
Yaroslav Halchenko 408bed5464 preliminary patch for backports to wheezy etc (systemd support "disabled")
also removing obsolete patch for lucid -- will just not build for it any longer
2014-10-27 23:15:38 -04:00
Yaroslav Halchenko 4e543da4ba changelog + policy boost 2014-10-27 22:02:23 -04:00
Yaroslav Halchenko b1d7c3f3ff Merge tag '0.9.1' into debian
What aught to be a bugfix release delayed into a featured release 0.9.1

ver. 0.9.1 (2014/10/29) - better, faster, stronger
----------

- Refactoring (IMPORTANT -- Please review your setup and configuration):
   * iptables-common.conf replaced iptables-blocktype.conf
     (iptables-blocktype.local should still be read) and now also
     provides defaults for the chain, port, protocol and name tags

- Fixes:
   * start of file2ban aborted (on slow hosts, systemd considers the server has
     been timed out and kills him), see gh-824
   * UTF-8 fixes in pure-ftp thanks to Johannes Weberhofer. Closes gh-806.
   * systemd backend error on bad utf-8 in python3
   * badips.py action error when logging HTTP error raised with badips request
   * fail2ban-regex failed to work in python3 due to space/tab mix
   * recidive regex samples incorrect log level
   * journalmatch for recidive incorrect PRIORITY
   * loglevel couldn't be changed in fail2ban.conf
   * Handle case when no sqlite library is available for persistent database
   * Only reban once per IP from database on fail2ban restart
   * Nginx filter to support missing server_name. Closes gh-676
   * fail2ban-regex assertion error caused by miscount missed lines with
     multiline regex
   * Fix actions failing to execute for Python 3.4.0. Workaround for
     http://bugs.python.org/issue21207
   * Database now returns persistent bans on restart (bantime < 0)
   * Recursive action tags now fully processed. Fixes issue with bsd-ipfw
     action
   * Fixed TypeError with "ipfailures" and "ipjailfailures" action tags.
     Thanks Serg G. Brester
   * Correct times for non-timezone date times formats during DST
   * Pass a copy of, not original, aInfo into actions to avoid side-effects
   * Per-distribution paths to the exim's main log
   * Ignored IPs are no longer banned when being restored from persistent
     database
   * Manually unbanned IPs are now removed from persistent database, such they
     wont be banned again when Fail2Ban is restarted
   * Pass "bantime" parameter to the actions in default jail's action
     definition(s)
   * filters.d/sieve.conf - fixed typo in _daemon.  Thanks Jisoo Park
   * cyrus-imap -- also catch also failed logins via secured (imaps/pop3s).
     Regression was introduced while strengthening failregex in 0.8.11 (bd175f)
     Debian bug #755173
   * postfix-sasl - added journalmatch.  Thanks Luc Maisonobe
   * postfix* - match with a new daemon string (postfix/submission/smtpd).
     Closes gh-804 .  Thanks Paul Traina
   * apache - added filter for AH01630 client denied by server configuration.

- New features:
   - New filters:
     - monit  Thanks Jason H Martin
     - directadmin  Thanks niorg
     - apache-shellshock  Thanks Eugene Hopkinson (SlowRiot)
   - New actions:
     - symbiosis-blacklist-allports  for Bytemark symbiosis firewall
   - fail2ban-client can fetch the running server version
   - Added Cloudflare API action

- Enhancements
   * Start performance of fail2ban-client (and tests) increased, start time
     and cpu usage rapidly reduced. Introduced a shared storage logic, to
     bypass reading lots of config files (see gh-824).
     Thanks to Joost Molenaar for good catch (reported gh-820).
   * Fail2ban-regex - add print-all-matched option. Closes gh-652
   * Suppress fail2ban-client warnings for non-critical config options
   * Match non "Bye Bye" disconnect messages for sshd locked account regex
   * courier-smtp filter:
     - match lines with user names
     - match lines containing "535 Authentication failed" attempts
   * Add <chain> tag to iptables-ipsets
   * Realign fail2ban log output with white space to improve readability. Does
     not affect SYSLOG output
   * Log unhandled exceptions
   * cyrus-imap: catch "user not found" attempts
   * Add support for Portsentry

* tag '0.9.1': (36 commits)
  ENH: additional versioning changes
  Refreshed manpages
  ENH: fail early in generate-man + provide PYTHONPATH upstairs
  Changes for the 0.9.1 release versioning
  Populated MANIFEST with more entries which were preiously missed or duplicated. Sorted within each "section"
  Add portsentry to changelog
  ConfigReader.touch renamed into protected _create_unshared
  DOC: documentation about available vagrantfile setup
  Added myself into THANKS
  DOC: adjust docs in mytime to place docs into docstrings
  ENH: do use @staticmethod (we are well beyond support of 2.4 now)
  testExecuteTimeout fixed: give a test still 1 second, because system could be too busy
  coverage: no cover (for failed except)
  fix: fail2ban-regex with filter file failed (after merging #824, because test case missing); test case for 'readexplicit' added;
  ENH:  remove obsolete code for python < 2.6 (we support >= 2.6)
  DOC: very minor (tabs/spaces)
  We better check that installation doesn't cause any errors as well
  code review, change log entries added;
  reset share/cache storage (if we use 'reload' in client with interactive mode)
  normalize tabs/spaces in docstrings;
  ...
2014-10-27 21:52:39 -04:00
Yaroslav Halchenko a0115ee458 ENH: additional versioning changes 2014-10-27 21:49:40 -04:00
Yaroslav Halchenko d0a5fe620f Refreshed manpages 2014-10-27 21:47:48 -04:00
Yaroslav Halchenko 564eb3389b ENH: fail early in generate-man + provide PYTHONPATH upstairs 2014-10-27 21:47:07 -04:00
Yaroslav Halchenko 987356d6c0 Changes for the 0.9.1 release versioning 2014-10-27 21:43:17 -04:00
Yaroslav Halchenko 9e8e4dde69 Populated MANIFEST with more entries which were preiously missed or duplicated. Sorted within each "section" 2014-10-27 21:43:11 -04:00
sebres 286ef6aa87 code review 2014-10-26 22:14:57 +01:00
sebres 361c220846 Merge remote-tracking branch 'remotes/upstream/master' into sebres:ban-time-incr;
normalize code to python >= 2.6;
2014-10-25 19:05:53 +02:00
Yaroslav Halchenko fc145eb795 Merge pull request #748 from pacop/master
ENH: Add dateTime format for PortSentry
2014-10-25 12:34:00 -04:00
Yaroslav Halchenko 8a453018a9 Merge pull request #830 from sebres/_tent/cache-config-read-fix1
fix: fail2ban-regex with filter file failed
2014-10-25 12:30:55 -04:00
pacop b60e2bf42f Add portsentry to changelog 2014-10-25 18:17:57 +02:00
pacop e3a037ee3f merge master 2014-10-25 18:15:34 +02:00
sebres 3dac765598 ConfigReader.touch renamed into protected _create_unshared 2014-10-25 17:20:01 +02:00
Yaroslav Halchenko 0b5413ec0b Merge branch 'master' of git://github.com/fail2ban/fail2ban
* 'master' of git://github.com/fail2ban/fail2ban:
2014-10-25 10:38:28 -04:00
Florian Pelgrim 3dabd5fc83 DOC: documentation about available vagrantfile setup
manually picked up from a commit within
https://github.com/fail2ban/fail2ban/pull/786
2014-10-25 10:38:18 -04:00
Florian Pelgrim 6293e44889 Added myself into THANKS 2014-10-25 10:37:28 -04:00
Yaroslav Halchenko b2b5d0b41c Merge pull request #829 from yarikoptic/minimal_python2.6
ENH:  remove obsolete code for python < 2.6 (we support >= 2.6)
2014-10-25 10:32:10 -04:00
Yaroslav Halchenko e1a5decc00 DOC: adjust docs in mytime to place docs into docstrings 2014-10-25 09:34:37 -04:00
Yaroslav Halchenko caa6006a31 ENH: do use @staticmethod (we are well beyond support of 2.4 now) 2014-10-25 09:25:18 -04:00
sebres 3c01dcb01f Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read-fix1' into ban-time-incr 2014-10-24 05:55:25 +02:00
sebres 07d4badfd0 testExecuteTimeout fixed: give a test still 1 second, because system could be too busy 2014-10-24 05:42:58 +02:00
sebres bef0502e6b coverage: no cover (for failed except) 2014-10-24 05:28:35 +02:00
sebres 2b1e645eb4 Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read-fix1' into ban-time-incr 2014-10-24 05:12:18 +02:00
sebres 0b0ea41f87 fix: fail2ban-regex with filter file failed (after merging #824, because test case missing);
test case for 'readexplicit' added;
2014-10-24 04:59:44 +02:00
sebres 293a5066d2 normalizing time config entries: use time abbreviation (str2seconds) for all time options such 'dbpurgeage', 'bantime', 'findtime', ex.: default '1d' instead '86400';
code review and test case extended;
2014-10-24 01:32:04 +02:00
sebres 48cd1262fe Merge 'upstream/master' into sebres:ban-time-incr 2014-10-23 23:34:43 +02:00
Yaroslav Halchenko d4015d6566 ENH: remove obsolete code for python < 2.6 (we support >= 2.6) 2014-10-23 14:51:51 -04:00
Yaroslav Halchenko e2f49b7334 DOC: very minor (tabs/spaces) 2014-10-23 14:44:10 -04:00
Yaroslav Halchenko 78e1a13fad Merge branch '_tent/cache-config-read' of https://github.com/sebres/fail2ban
* '_tent/cache-config-read' of https://github.com/sebres/fail2ban:
  code review, change log entries added;
  reset share/cache storage (if we use 'reload' in client with interactive mode)
  normalize tabs/spaces in docstrings;
  cache-config-read-v2 merged; logging normalized, set log level for loading (read or use shared) file(s) to INFO; prevent to read some files twice by read inside "_getIncludes" and by "read" self (occurred by only one file);
  code review; more stable config sharing, configurator always shares it config readers now;
  code review: use the same code (corresponding test cases - with sharing on and without it);
  rewritten caching resp. sharing of ConfigReader and SafeConfigParserWithIncludes (v.2, first and second level cache, without fingerprinting etc.);
  code review
  ConfigReader/ConfigWrapper renamed as suggested from @yarikoptic; + code clarifying (suggested also);
  Partially merge remote-tracking from 'sebres:cache-config-read-820': test cases extended, configurator.py adapted for test case.
  ENH: keep spitting out logging to the screen in LogCaptureTestCases if HEAVYDEBUG
  test case for check the read of config files will be cached;
  more precise by test
  ConfigWrapper class introduced: sharing of the same ConfigReader object between JailsReader and JailReader (don't read jail config each jail); sharing of the same DefinitionInitConfigReader (ActionReader, FilterReader) between all jails using that; cache of read a config files was optimized; test case extended for all types of config readers;
  config cache optimized - prevent to read the same config file inside different resources multiple times; test case: read jail file only once;
  test case for check the read of config files will be cached;
  caching of read config files, to make start of fail2ban faster, see issue #820
2014-10-23 14:28:33 -04:00
sebres 8f2561e289 Merge remote-tracking branch 'remotes/origin/_tent/cache-config-read' into ban-time-incr 2014-10-20 01:37:36 +02:00
sebres f1d8272693 bug fix (in master): option 'dbpurgeage' was never set (default always) by start of fail2ban, because of invalid sorting of options ('dbfile' should be always set before other database options) / python3 compatibility fix 2014-10-20 01:35:02 +02:00
Yaroslav Halchenko 5ac496d030 We better check that installation doesn't cause any errors as well 2014-10-12 17:28:35 -04:00
Yaroslav Halchenko fbce121967 adjusted changelog revision, apparently I fell into a trap of unannotated tag for 0.9.0 release 2014-10-12 16:45:57 -04:00
Yaroslav Halchenko 6f4e542eff Merge commit '0.9.0-252-g47441d1' into debian-releases/experimental
* commit '0.9.0-252-g47441d1':
  BF: made tests util digest.py friendly to python3
2014-10-12 16:45:30 -04:00
Yaroslav Halchenko 47441d1383 Merge remote-tracking branch 'origin/master'
* origin/master:
  RF: moving logwatch setup/sample logs under files/logwatch
  ENH: print rebans stats even if no "Failures" are logged, and reduce indentation in output
  ENH: untabified and reindented entire script for sane formatting (no functional changes)
  BF: logwatch -- fixing up regex for 'already banned'
  Sample logfiles to test logwatch services script
  Adjusting fail2ban logwatch script to match lines from 0.9 as well
2014-10-12 16:44:24 -04:00
Yaroslav Halchenko 86a5f42f73 BF: made tests util digest.py friendly to python3 2014-10-12 16:40:29 -04:00
Yaroslav Halchenko a33207bf87 changelog 2014-10-12 10:31:48 -04:00
Yaroslav Halchenko eb6cc726ff Merge branch 'debian-release/experimental' of https://github.com/schaal/fail2ban into debian-releases/experimental
* 'debian-release/experimental' of https://github.com/schaal/fail2ban:
  Switch debian packaging to use python3
2014-10-12 10:26:48 -04:00
Yaroslav Halchenko cb662e2368 Merge commit '0.9.0a2-814-g98dc084' into debian-releases/experimental
* commit '0.9.0a2-814-g98dc084':
  tests: define CONFIG_DIR in utils.
  forgot to add test case to last commit
  adding test case, changelog and thanks entries for apache shellshock filter
  adding jail conf for shellshock filter
  adding filter to detect Shellshock attack attempts against bash scripts through apache.  See http://seclists.org/oss-sec/2014/q3/650
  Add apache filter for AH01630 client denied by server configuration
  RF: moving logwatch setup/sample logs under files/logwatch
  DOC: Changelog and THANKS for  previous changes
  RF: remove those two additional failregexes for the postfix
  ENH: add empty ignoreregex to avoid a warning (Close #805)
  Update test cases and also suport smtps per request.
  Add support for postfix/submission/smtpd matching.
  ENH: print rebans stats even if no "Failures" are logged, and reduce indentation in output
  ENH: untabified and reindented entire script for sane formatting (no functional changes)
  BF: logwatch -- fixing up regex for 'already banned'
  Sample logfiles to test logwatch services script
  Adjusting fail2ban logwatch script to match lines from 0.9 as well
2014-10-12 10:26:36 -04:00
Yaroslav Halchenko 98dc0844ce Merge pull request #782 from yarikoptic/bf/logwatch
logwatch file (original 1.5 version + fixes for change of logs in 0.9)
2014-10-10 22:15:57 -04:00
sebres 7d3e6e9935 code review, change log entries added; 2014-10-10 20:06:58 +02:00
sebres 73a06d55a8 reset share/cache storage (if we use 'reload' in client with interactive mode) 2014-10-10 18:50:24 +02:00
sebres 7f5d4aa7a6 normalize tabs/spaces in docstrings; 2014-10-10 16:59:40 +02:00
sebres 95bdcdecaa cache-config-read-v2 merged;
logging normalized, set log level for loading (read or use shared) file(s) to INFO;
prevent to read some files twice by read inside "_getIncludes" and by "read" self (occurred by only one file);
2014-10-10 16:49:08 +02:00
sebres 02a46d0901 code review;
more stable config sharing, configurator always shares it config readers now;
2014-10-10 12:05:49 +02:00
sebres e0eb4f2358 code review: use the same code (corresponding test cases - with sharing on and without it); 2014-10-10 02:47:42 +02:00
sebres c35b4b24d2 rewritten caching resp. sharing of ConfigReader and SafeConfigParserWithIncludes (v.2, first and second level cache, without fingerprinting etc.); 2014-10-10 02:10:13 +02:00
sebres 37952ab75f code review 2014-10-09 19:51:53 +02:00
sebres f67053c2ec ConfigReader/ConfigWrapper renamed as suggested from @yarikoptic;
+ code clarifying (suggested also);
2014-10-09 19:01:49 +02:00
sebres f6723a12ff Merge branch 'cache-config-read-820' into _tent/cache-config-read 2014-10-09 18:01:31 +02:00
sebres b62ce14ccd Partially merge remote-tracking from 'sebres:cache-config-read-820':
test cases extended, configurator.py adapted for test case.
2014-10-09 18:00:45 +02:00
Yaroslav Halchenko 0c5f11079c ENH: keep spitting out logging to the screen in LogCaptureTestCases if HEAVYDEBUG 2014-10-09 10:47:00 -04:00
sebres f31607ded1 test case for check the read of config files will be cached;
Conflicts:
	fail2ban/tests/clientreadertestcase.py -- removed not needed
        time in imports
2014-10-09 10:30:17 -04:00
sebres 1ba48f8627 Merge remote-tracking branch 'remotes/origin/cache-config-read-820' into ban-time-incr 2014-10-09 15:41:52 +02:00
sebres 51cae63bf0 more precise by test 2014-10-09 15:39:58 +02:00
sebres ec77338e0c Merge remote-tracking branch 'sebres:cache-config-read-820' into ban-time-incr 2014-10-09 15:13:22 +02:00
sebres 4244c87802 ConfigWrapper class introduced: sharing of the same ConfigReader object between JailsReader and JailReader (don't read jail config each jail);
sharing of the same DefinitionInitConfigReader (ActionReader, FilterReader) between all jails using that;
cache of read a config files was optimized;
test case extended for all types of config readers;
2014-10-09 14:51:08 +02:00
sebres 20e6989c73 Merge 'upstream/master' into ban-time-incr:
Merge remote-tracking branch 'sebres:cache-config-read-820' into ban-time-incr:
config cache optimized - prevent to read the same config file inside different resources multiple times;
test case: read jail file only once;
+ optimized merge: use OrderedDict.update instead of merge in cycle;
2014-10-08 16:37:07 +02:00
sebres 2a54e61238 config cache optimized - prevent to read the same config file inside different resources multiple times;
test case: read jail file only once;
2014-10-08 15:44:32 +02:00
sebres af4b48e841 test case for check the read of config files will be cached; 2014-10-07 14:37:40 +02:00
sebres 704357467a test case for check the read of config files will be cached; 2014-10-07 14:30:51 +02:00
pacop ce4f2d1c88 added filter for PortSentry with jail and samples 2014-10-04 15:08:12 +02:00
pacop 37acc6b832 ENH: Add dateTime format for PortSentry
Added dateTime format for PortSentry with EPOCH format
2014-10-04 14:55:22 +02:00
Daniel Schaal 97e01985a8 Merge remote-tracking branch 'origin/master' into debian-release/experimental 2014-10-03 17:56:12 +02:00
Daniel Schaal 3f9859a127 Switch debian packaging to use python3 2014-10-03 17:44:49 +02:00
sebres d00af327c5 caching of read config files, to make start of fail2ban faster, see issue #820 2014-10-03 02:11:55 +02:00
sebres f70656cdd7 caching of read config files, to make start of fail2ban faster, see issue #820 2014-10-02 22:29:09 +02:00
Yaroslav Halchenko 05fcb1f104 Merge pull request #813 from schaal/tests-configdir-env-variable
tests: Add function to utils to calculate CONFIG_DIR
2014-10-01 14:19:26 -04:00
Daniel Schaal 270ea363d3 tests: define CONFIG_DIR in utils. 2014-10-01 19:50:03 +02:00
Yaroslav Halchenko b912d61ccb Merge pull request #818 from slowriot/master
adding filter to detect Shellshock attack attempts with Apache
2014-09-29 09:32:21 -04:00
SlowRiot 5d526bbeb1 forgot to add test case to last commit 2014-09-29 00:49:22 +01:00
SlowRiot 7b5dc9f24f adding test case, changelog and thanks entries for apache shellshock filter 2014-09-26 18:48:56 +01:00
SlowRiot fc5f729f01 adding jail conf for shellshock filter 2014-09-26 16:37:50 +01:00
SlowRiot 4f636eb0e3 adding filter to detect Shellshock attack attempts against bash scripts through apache. See http://seclists.org/oss-sec/2014/q3/650 2014-09-26 16:25:07 +01:00
sebres e6127a278e The tricky bug fixed - last position of log file will be never retrieved (#795):
addJail (executed before addLog) early uses a "INSERT OR REPLACE" statement to update "enabled" to 1 (and add jail the first time used at once), but this syntax in sqlite always deletes an entry (cause of constraint) and inserts it again, so because of CASCADE all log entries with this jail will be also deleted from logs table.
2014-09-25 18:29:10 +02:00
sebres 7688db2628 observer: logging optimized, some log messages switched to debug level (because long time stable) 2014-09-24 15:22:48 +02:00
sebres 145a9fb891 filter, datedetector, datetemplate: performance optimizing of combination datedetector.matchTime/getTime2, because early getTime search a template and call template.matchTime again (so the date parsing was really executed twice, now just once);
debug logging optimized;
added info line log "Start Fail2ban ..." after changed logging target;
2014-09-24 13:21:37 +02:00
sebres 2b38d46fb5 actions: bug fix in lambdas in checkBan, because getBansMerged could return None (purge resp. asynchronous addBan), make the logic all around more stable;
test cases: extended with test to check action together with database functionality (ex.: to verify lambdas in checkBan);
database: getBansMerged should work within lock, using reentrant lock (cause call of getBans inside of getBansMerged);
2014-09-23 19:57:55 +02:00
sebres 6c2937affc python3/pypy compatibility fix + removing obsolete code 2014-09-16 18:12:21 +02:00
sebres 96de888ac7 python3/pypy compatibility fix 2014-09-16 17:51:57 +02:00
sebres 0dce32405f python3 compatibility fix 2014-09-16 17:27:21 +02:00
sebres c1637e97b2 now polling backend only: prevent completely read of big files first time (after start of service), initial seek to start time using half-interval search algorithm (see issue #795):
disabled for gamin and pyinotify backends;
2014-09-16 17:06:49 +02:00
sebres 930678cc0e Merge remote-tracking branch 'remotes/upstream/master' into ban-time-incr 2014-09-16 13:53:15 +02:00
sebres 53a30a2d42 prevent completely read of big files first time (after start of service), initial seek to start time using half-interval search algorithm (see issue #795) 2014-09-16 13:50:32 +02:00
Yaroslav Halchenko bfaf33b6ba Merge pull request #812 from nickweeds/master
Issue #810: Update apache-auth.conf filter to match AH01630: client denied by server configuration
2014-09-14 21:01:50 -04:00
Nick Weeds 2c158fe168 Add apache filter for AH01630 client denied by server configuration 2014-09-14 21:54:05 +01:00
Yaroslav Halchenko caa851e5c8 RF: moving logwatch setup/sample logs under files/logwatch 2014-09-14 09:48:14 -04:00
Yaroslav Halchenko 8f521b8551 DOC: Changelog and THANKS for previous changes 2014-09-13 10:27:37 -04:00
Yaroslav Halchenko 0e1f8f7f39 RF: remove those two additional failregexes for the postfix
see comment
https://github.com/fail2ban/fail2ban/pull/804\#discussion_r17512426
2014-09-13 10:25:27 -04:00
Yaroslav Halchenko 96c20c8379 Merge pull request #804 from pleasantone/master
Add support for postfix/submission/smtpd matching.
2014-09-13 10:24:06 -04:00
Yaroslav Halchenko c58c4de9bc ENH: add empty ignoreregex to avoid a warning (Close #805) 2014-09-13 10:18:37 -04:00
Yaroslav Halchenko 8b2f0678a7 Merge commit '0.9.0a2-792-g1864f75' into debian-releases/experimental
* commit '0.9.0a2-792-g1864f75': (113 commits)
  Credits and notes from #806
  fixed encoding
  fixed encoding
  ENH: Ignore errors while unbaning in symbiosis firewall
  ENH: just a bit more descriptive exception ;-)
  ENH/BF(TST): making permissions restrictive is not sufficient -- really remove file to test
  changelog entry for postfix-sasl fix
  added systemd configuration for postfix-sasl.conf
  1.5 version of Fail2ban logwatch file
  minor typo
  Fxi jail.conf to use more syslog macros
  ENH: symbiosis-blacklist-allports action
  Fix typos.
  changelog and thanks for the preceding fix
  Added entry for Cloudflare action
  ChangeLog Added and entry about Cloudflare action
  Changed to Cloudflare JSON API
  Fix sieve filter to use correct option
  changelog entries for already merged and upcoming merge
  Update courier-smtp.conf
  ...
2014-09-12 14:14:24 -04:00
Dean Lee ba44ff312b grep IP at the start of lines
I'm not sure if this regex works best, so I'm patching this single file as a sample.

Don't forget to update `mail-whois-lines.conf` after this patch got merged.

For the following logs, `grep '[^0-9]199.48.161.87[^0-9]'` will output nothing, while `grep '\([^0-9]\|^\)199.48.161.87[^0-9]'` works:
<pre>199.48.161.87 - - [09/Sep/2014:13:38:54 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:38:56 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:38:58 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:00 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:05 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:05 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:13 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:21 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:32 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:34 +0800] "POST /wp-login.php HTTP/1.1" 403 4674 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:34 +0800] "POST /wp-login.php HTTP/1.1" 403 168 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:34 +0800] "POST /wp-login.php HTTP/1.1" 403 168 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:35 +0800] "POST /wp-login.php HTTP/1.1" 403 168 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:35 +0800] "POST /wp-login.php HTTP/1.1" 403 168 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com
199.48.161.87 - - [09/Sep/2014:13:39:35 +0800] "POST /wp-login.php HTTP/1.1" 403 168 "-" "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0" - hitsjapan.com</pre>
2014-09-09 14:55:34 +08:00
Paul Traina 249e169d8e Update test cases and also suport smtps per request. 2014-09-08 11:53:51 -07:00
Paul Traina 544cfaff2c Add support for postfix/submission/smtpd matching. 2014-09-06 10:23:38 -07:00
sebres 62c755c1d5 Merge remote-tracking branch 'upstream/master' into ban-time-incr
Conflicts resolved:
	fail2ban/server/database.py
	fail2ban/tests/servertestcase.py
delBan modified (if manually unban):
	delete from "bips" also (bad ips)
	delete all tickets of this ip, also if currently not banned
2014-08-15 11:39:55 +02:00
Yaroslav Halchenko b1c04f5fa2 ENH: print rebans stats even if no "Failures" are logged, and reduce indentation in output 2014-08-13 23:37:17 -04:00
Yaroslav Halchenko decea64cf9 ENH: untabified and reindented entire script for sane formatting (no functional changes) 2014-08-13 23:28:03 -04:00
Yaroslav Halchenko 8b62353ab0 BF: logwatch -- fixing up regex for 'already banned' 2014-08-13 23:24:38 -04:00
Yaroslav Halchenko 3bd36ba40a Sample logfiles to test logwatch services script 2014-08-13 23:15:31 -04:00
Yaroslav Halchenko b0f26fa391 Adjusting fail2ban logwatch script to match lines from 0.9 as well
File itself includes additional log information about changes
2014-08-11 12:45:50 -04:00
sebres 6d2b596bb4 observer inherits from JailThread + test cases for bad run; 2014-07-08 10:56:19 +02:00
sebres e70406d5a1 @commitandrollback decorator added; missing logging module reference added; 2014-07-07 10:28:46 +02:00
sebres 00b7205a3c Merge remote-tracking branch 'remotes/upstream/master', fix test cases (see bellow)
Conflicts resolved:
	ChangeLog
	fail2ban/server/filter.py
	fail2ban/server/jail.py
	fail2ban/tests/actionstestcase.py
Test cases fixed:
	testBanActionsAInfo - fail ticket with current time (otherwise ticket will be ignored - ban time too old)
	testFail2BanExceptHook - use local sys.__excepthook__ to check was really executed and prevent write error in stderr.
2014-06-24 14:02:24 +02:00
sebres de0beeff9f new test cases added (increase coverage);
prepared to merge with upstream/master;
2014-06-24 12:39:53 +02:00
sebres 819e4eb540 relict of obsolete code removed; 2014-06-19 18:06:07 +02:00
sebres ccf2521a6d Merge branch 'master' of https://github.com/fail2ban/fail2ban into ban-time-incr;
Conflicts in ChangeLog resolved;
obsolete imports removed;
2014-06-19 17:40:00 +02:00
sebres 6ecd7ddddf testExecuteTimeout fixed: give a test still 1 second, because system could be too busy 2014-06-10 13:45:29 +02:00
sebres a82cc3bcbf prevent to early exit from main loop (tast case bug by multi-threaded execution / wait for completion);
idle state fixed (if observer really sleeps only);
2014-06-10 13:24:13 +02:00
sebres 00fdf5ce0a test cases extended;
code review
2014-06-10 12:31:55 +02:00
sebres bb6655e696 small fix and clarifying code and log messages 2014-06-10 10:24:55 +02:00
sebres bb0a181056 testcases extended and observer optimized to run test cases faster;
code review
2014-06-07 04:37:06 +02:00
sebres e7bd8ed619 not used import removed 2014-06-06 19:52:42 +02:00
sebres 70080b112a Merge branch 'master' of https://github.com/fail2ban/fail2ban into ban-time-incr 2014-06-06 19:46:38 +02:00
sebres 681bc2ef07 observer functionality introduced (asynchronous events in separate service thread);
ban time increment feature nearly completely moved into observer;
purge database will be called hourly in observer;
bug fixing and code review;
2014-06-06 18:44:59 +02:00
sebres 02055ba4eb ignore already known tickets (from filter after restart);
bug fixing and optimizing;
2014-06-05 14:09:43 +02:00
sebres 8fd083a1ea Merge remote-tracking branch 'remotes/kwirk/sebres-strptime-bug' into ban-time-incr 2014-05-15 17:12:11 +02:00
sebres addfea6614 static method forgotten; 2014-05-15 15:16:53 +02:00
sebres ec3ed0e4ae introduced string to seconds (str2seconds) for configuration entries with time;
todo: expands it for all time config entries;
2014-05-14 16:01:35 +02:00
sebres f492aa7ac9 remove affected check, to delete jails always (pass testPurge) 2014-05-14 12:32:30 +02:00
sebres 99c9cbf470 code review, manually ban uses by addFailure the count "maxRetry" directly;
log ticket time (found in line)
2014-05-14 12:17:28 +02:00
sebres d22ab320e2 "magic" formula for auto increasing of retry count for known (bad) ip, corresponding banCount of it
(one try will count than 2, 3, 5, 9 ...)
2014-05-14 11:21:31 +02:00
sebres 0121e09907 default formula faster and more readable, comparable with "multipliers", like 2**N, default factor for both solutions is 1 now 2014-05-07 13:28:04 +02:00
sebres 7d17fb5c6c python >= 3.x, local variable 'lastBanTime' reference bug fixed 2014-05-06 20:55:41 +02:00
sebres a4837da899 Merge branch 'ban-time-incr' of https://github.com/sebres/fail2ban into ban-time-incr 2014-05-06 20:32:23 +02:00
sebres 3a75c8a752 ban time incr: 2st test case added (code optimized for test cases), to test both stand-alone:
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 20:30:12 +02:00
sebres 6c8327e39f indentation level fix 2014-05-06 20:24:49 +02:00
sebres 14167ed778 ban time incr: 2st test case added (code optimized for test cases), to test both stand-alone:
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 20:14:23 +02:00
sebres 237706e39f ban time incr: 1st test case added, to test it stand-alone:
python ./bin/fail2ban-testcases -l debug 'BanTimeIncr'
2014-05-06 17:57:11 +02:00
sebres c48e404e63 option "multipliers" added, how proposed from @yarikoptic;
the calculate formula is rewritten to lambda / compiled solution (up to 10 million times per seconds);
code review;
2014-05-06 16:07:16 +02:00
sebres ccacfc1047 code review 2014-05-05 15:17:22 +02:00
sebres ccf07c4b21 - some bug fixed to pass all test cases;
- database_v1.db/bans/jail-name bug fixed - cause of different jail name in jails and bans, in test case (by updateDb): FOREIGN KEY constraint failed:
  $ sqlite3 fail2ban/tests/files/database_v1.db
  sqlite> select distinct jail from bans;
  DummyJail #16244880 with 0 tickets
  sqlite> select distinct name from jails;
  DummyJail #29162448 with 0 tickets
  sqlite> update bans set jail = (select distinct name from jails);
2014-05-05 14:47:50 +02:00
sebres 6f7c9b7d0f introduced new feature "ban time exponential increasing":
"bantimeextra.enabled" in jail.conf allows to use database for searching of previously banned ip's to increase a default ban time using special formula,
   by default, each next ban it will be original banTime * 1, 2, 4, 8, 16, 32...
see "jail.conf" for some other options of "bantimeextra";
additional we can configure a little randomization of ban time, to prevent "clever" botnets calculate exact time IP can be unbanned.
WARNING: by first start the server upgrades sqlite database (table "bans" will recreated with another schema);
2014-05-05 12:38:54 +02:00
Yaroslav Halchenko 87703c4cfe Merge remote-tracking branch 'origin/master' into debian-releases/experimental
* origin/master:
  Clean up setup.py
  ENH: adding pruned with previous merge trailing \s* in nginx filter
  nginx-http-auth: match when "referrer" is present
  DOC: Update ChangeLog
  DOC: Fix jail.conf(5) man page which had duplicate {fail,ignore}regex
  Correct grammar
  DOC: add thanks for last commit
  DOC: nginx-http-auth filter
  nginx-http-auth filter: match server_name = ""
  ENH: Suppress configuration warnings if non-critical options are not set
  Update comments in shorewall.conf for new settings
  DOC: Improve error logging when specific backend set and fails
  BF: Fix getting jail name from exceptions in beautifier for Python 3+
  DOC: sphinx documentation
  BF: On jail restart reinstatement of bans, fetch one ticket per IP
  Fix 2 more typos that codespell didn't catch
  Add documentation link to systemd service file
2014-04-12 11:32:02 -04:00
Yaroslav Halchenko c516e8a010 run only tests not requiring network access 2014-03-25 11:17:34 -04:00
Yaroslav Halchenko de72ec0d39 BF: glitch 2014-03-25 10:04:11 -04:00
Yaroslav Halchenko 35a03c0f86 Adjusted changelog/news, do not ignore test failures, install more examples 2014-03-25 08:55:20 -04:00
Yaroslav Halchenko 33564948cc pruned not needed any longer remove-syslog.target-reference.patch 2014-03-25 00:45:29 -04:00
Yaroslav Halchenko 90648029d2 updated changelog 2014-03-25 00:44:00 -04:00
Yaroslav Halchenko b132bd8137 Merge commit '0.9.0-48-gabcab00' into debian-releases/experimental
* commit '0.9.0-48-gabcab00':
  Fix a few typos
  BF: Ignored IPs no longer being banned from database on restart
  ENH: Add iptables and firewalld to "After" for systemd service file.
  DOC: Add database settings for fail2ban.conf to jail.conf(5) man page
  TST: Skip badips.py test is no network option set
  TST: Skip SYSLOG log target test if '/dev/log' not present
  BF: fail2ban.conf reader expected "int" type for `loglevel`
  DOC: Update ChangeLog fixes
  BF: Handle case when no sqlite library is available for the database
2014-03-25 00:43:11 -04:00
Yaroslav Halchenko 6dae59a50c for experimental build straight from git debian-releases/experimental branch 2014-03-20 21:43:36 -04:00
Yaroslav Halchenko 97bd9b96e8 minor tune up to the changelog 2014-03-20 21:42:19 -04:00
Yaroslav Halchenko 7a027df1f3 Merge branch 'debian' into debian-releases/experimental
* debian:
  BF: forgot to define sender in jail.conf
2014-03-20 21:20:58 -04:00
Yaroslav Halchenko df08b2ff18 BF: forgot to define sender in jail.conf 2014-03-19 11:43:38 -04:00
Yaroslav Halchenko ae9b13be20 Changelog version and minor tune up to NEWS 2014-03-19 10:50:21 -04:00
Yaroslav Halchenko af854eec4d Merge commit '0.9.0-654-gc8694d8' (packaging tune ups for 0.9) into debian-releases/experimental
* commit '0.9.0-654-gc8694d8':
  Add news entry for 0.9.0
  use upstream jail.conf, paths are now defined in paths-debian.conf
  enable systemd integration
  remove /var/lib/fail2ban/fail2ban.sqlite3 when purging
  move renamed conffiles in maintscripts
  refresh patch deb_manpages_reportbug
  remove changeset_d4f6ca4f8531f332bcb7ce3a89102f60afaaa08e.diff, applied upstream
  Update debian packaging to dh compat 9

Conflicts:
	debian/jail.conf -- removed also in this branch
	debian/postinst  -- took changes for courier renames + adjusted version to 0.9.0-1~
	debian/postrm
	debian/preinst
2014-03-19 10:44:23 -04:00
Yaroslav Halchenko a133d79380 Merge commit '0.9.0-37-gdeb5924' into debian-releases/experimental
* commit '0.9.0-37-gdeb5924': (449 commits)
  Fix typo in comment
  DOC: note to have release tagged by a signed/annotated tag
  DOC: ChangeLog for gh-652
  Add a --print-all-matched option.
  DOC: Add DEVELOP documentation on use of pyflakes
  TST: Unused import in test_smtp
  DOC: Document recent changes
  DOC: Document recent fixes
  DOC: syntax
  DOC: new ChangeLog header
  TST: Fix test failing due to wrapping of long subject lines v2
  TST: Fix test failing due to wrapping of log subject lines
  BF: fail2ban-regex mix of tabs and spaces
  Changelog entry
  BF(PY2.4,2.5):  provide bin() function (introduced in 2.6)
  BF: python 2.4 and 2.5 compatibility -- no "except ... as ..." yet
  BF: Remove unused imports and variables.
  BF: badips.py action methods not static due to use of self._logSys
  BF: FilterSystemd.formatJournalEntry is a classmethod, not staticmethod
  BF: Remove "/var/run/fail2ban" from setup.py
  ...
2014-03-19 10:40:17 -04:00
Yaroslav Halchenko 5d95fcb718 two more forgotten renames (sasl, lighttpd-fastcgi) 2014-03-19 10:35:53 -04:00
Yaroslav Halchenko 1d23a4dc4f debian/post{inst,rm},preinst: - [thanks to Daniel Schaal]: take care about renaming firewall-cmd-direct-new.conf to firewallcmd-new.conf which happened
in 0.8.11-29-g56b6bf7
2014-03-19 10:26:07 -04:00
Yaroslav Halchenko 7376bb4321 Beefing up debian/jail.conf 2014-03-18 23:25:21 -04:00
Daniel Schaal c8694d8adf Add news entry for 0.9.0 2014-03-16 16:53:05 +01:00
Daniel Schaal cc4ea850fe use upstream jail.conf, paths are now defined in paths-debian.conf 2014-03-16 16:39:43 +01:00
Daniel Schaal 82c1ed3979 enable systemd integration 2014-03-16 16:39:43 +01:00
Daniel Schaal af088eefce remove /var/lib/fail2ban/fail2ban.sqlite3 when purging 2014-03-16 16:39:43 +01:00
Daniel Schaal e2b9cb01f5 move renamed conffiles in maintscripts 2014-03-16 16:39:28 +01:00
Yaroslav Halchenko f86ec8020f new changelog and dropping absorbed changesets* 2014-03-16 10:30:26 -04:00
Yaroslav Halchenko f04bae1366 Merge tag '0.8.13' into debian
* tag '0.8.13': (48 commits)
  DOC: DEVELOP release note changes
  PKG: version release
  PKG: include nagios filter/log
  DOC/ENH: update man pages for release
  ENH: pull asterisk filter change to support syslog from 0.9 branch
  Sanity-check print-all-* vs print-no-* options.
  Add --print-no-{missed,ignored} and restore -all.
  Only remember log lines we need to print later.
  Fix the --print-all-{missed,ignored} options.
  ENH: sendmail-reject for all smtp ports.
  ENH: more sendmail-reject filter items thanks to fab23
  BF: move to right location
  ENH: rename sendmail-spam to sendmail-reject
  BF: email address as arg1 in sendmail filters
  ENH: wider regex for RBL and sendmail-spam
  DOC: Add reference to action argument values which contain ","
  BF: add jail.conf definitions for sendmail* filters
  ENH: add filter for sendmail-{auth,spam}. Closes gh-20
  ENH: Allow 255.255.255.0 style mask for ignoreip
  BF: Fix complain action for multiple recipients and misplaced ";"
  ...
2014-03-16 10:26:22 -04:00
Daniel Schaal 05dc81d880 refresh patch deb_manpages_reportbug 2014-03-16 06:11:53 +01:00
Daniel Schaal ba5a3fdf4a remove changeset_d4f6ca4f8531f332bcb7ce3a89102f60afaaa08e.diff, applied upstream 2014-03-16 06:11:53 +01:00
Daniel Schaal 051f090313 Update debian packaging to dh compat 9 2014-03-16 06:11:49 +01:00
Daniel Schaal e2caa2b220 Merge tag '0.9.0' into debian 2014-03-15 12:46:02 +01:00
Yaroslav Halchenko 02effb1b0c closes for #739364 (apache-common) 2014-02-17 21:34:28 -05:00
Yaroslav Halchenko 34c3264f2c initial changelog entry + use flushlogs in logrotate 2014-02-07 01:00:42 -05:00
Yaroslav Halchenko 493c441bcb Merge tag '0.8.12' into debian
* tag '0.8.12': (177 commits)
  DOC: version and release date to 0.8.12 on 2014-01-22
  DOC/ENH: update man pages for release
  DOC: ChangeLog dateing and normalisation
  ENH: continue with rest of fail2ban config even if errors. Closes gh-585
  DOC: ChangeLog. Note incompatible changes and group new filters and actions under New Features
  BF: complete MANIFEST
  DOC: note in man page about "last message repeated" syslog compression. Closes Debian bug #620364
  DOC: credits for action.d/badips
  BF: dovecot filters, session characters and order of session/tls in log messages
  BF Dovecot auth failures
  Matching any Exim authentication name
  Update exim
  ENH: add improper command pipelining postfix filter
  Support ACL-events without AccountID. Typically happens when a registration from an unknown domain is performed.
  BF: Add ejabberd-auth to jail.conf
  ENH: ejabberd filter
  TST: for tag substition, multiple on same line
  DOC: spelling + GPL2+ for license
  DOC: fixing formatting in the section names of the manpage - \fB to return into bold
  DOC: some typos, fixes from Vincent Lefevre
  ...
2014-02-07 00:35:23 -05:00
Yaroslav Halchenko 90642725fa /etc/default/fail2ban -- minor typo. Thanks Vincent Lefevre for report (the rest will be reflected in the next upstream release) (Closes: #734421) 2014-01-06 23:40:49 -05:00
Yaroslav Halchenko d583637c50 changeset_ac061155f093464fb6cd2329d3d513b15c68e256.diff absorbed upstream 2013-11-17 17:32:25 -05:00
Yaroslav Halchenko 30fe2ce7ba changelog entry for previous cherry picked patch 2013-11-17 17:29:56 -05:00
Yaroslav Halchenko 0c24daeb10 added patch changeset_d4f6ca4f8531f332bcb7ce3a89102f60afaaa08e.diff to "cherry-pick" d4f6ca4f85 (ENH: adding custom date format for proftpd when logging in its own log file (default on Debian) -- includes milliseconds) 2013-11-17 17:27:50 -05:00
Yaroslav Halchenko 19a472928d More of changelog entries to close bugs addressed in this release 2013-11-16 22:58:15 -05:00
Yaroslav Halchenko 4dba65f685 debian/NEWS - information for change of default iptables action to REJECT now (Closes: #711463) 2013-11-16 22:30:31 -05:00
Yaroslav Halchenko 2d068572bc debian/jail.conf - dropbear jail: use dropbear filter (instead of ssh) and monitor auth.log instead of non-existing /var/log/dropbear (Closes: #620760) 2013-11-16 21:35:04 -05:00
Yaroslav Halchenko 7d8dc0f322 fresh changelog 2013-11-16 21:30:15 -05:00
Yaroslav Halchenko b2f5a79eeb Merge tag '0.8.11' into debian
* tag '0.8.11':
  DOC: finalise 0.8.11 release
  BF/ENH: DoS resistant roundcube-auth with test cases and more variation in IMAP error given
  BF: exim filter to be DoS resistant
  ENH: DoS resistant dropbear filter
  BF/ENH: asterisk connection ID is a hex not decimal number. Add "Rejecting unknown SIP connection from <HOST>" regex thanks to Jonathan Lanning
  ENH: apache-2.4 message IDs for filter apache-noscript
  TST: change source URL
  ENH: apache-overflow filter to have HTTP-2.4 message IDs and test samples
  ENH: apache-overflows - more detail on "request failed: URI too long (longer than %d)" with test case
  TST: end of json in sshd sample log
  TST: fix space in sshd sample log
  TST: test case that shows injection
  DOC: more on filter regexes - DEVELOP
  DOC: filter regex debugging
  BF: anchor introduced nginx-http-auth at the end
2013-11-16 21:19:48 -05:00
Yaroslav Halchenko 8f54c1990a provide Closes statements for Debian bugs 2013-11-10 12:17:13 -08:00
Yaroslav Halchenko a4ab39ea82 minor jail.conf tune ups. More needed to adopt the jails/filter added upstrean 2013-11-10 00:24:24 -08:00
Yaroslav Halchenko 93f30fe4f6 added patch changeset_ac061155f093464fb6cd2329d3d513b15c68e256.diff to "cherry-pick" ac061155f0 (BF: anchor introduced nginx-http-auth at the end) 2013-11-08 17:30:35 -08:00
Yaroslav Halchenko 521f8062bc Changelog entry/new version 2013-11-08 17:29:55 -08:00
Yaroslav Halchenko 128c4c978d Merge commit '0.8.11.pre1-29-gccd2657' into debian
* commit '0.8.11.pre1-29-gccd2657': (363 commits)
  DOC: minor typos in ChangeLog
  DOC: adding DEV Notes for for non-greedy matchin within sshd.conf
  BF: disallow exploiting of non-greedy .* in previous fix by providing too long rhost -- do not impose length limits for user-provided input
  BF: fixing injection for OpenSSH 6.3 -- making .* before <HOST> non-greedy
  Changelog for prior changes (gen_buildbots)
  ENH: condense asterisk regexs for speed
  BF: missed action in nginx-http-auth
  ENH: add filter.d/nginx-http-auth. Partially forfills #405
  ENH: regenerated config/filter.d/apache-badbots.conf
  NF: gen_badbots script to (re)generate/update config/filter.d/apache-badbots.conf
  DOC: keeping Changelog release-phrases uniform, simplified intro, unified
  DOC: Untabifying and reindenting a bit ChangeLog
  DOC: few more links for DEVELOP
  BF: fix dovecot filter for newer failure message. Closes Debian bug #709324
  BF: fix to filter.d/wuftp to support pam authentication - Debian bug #665925
  Add Fedora git repo of fail2ban package to DEVELOP
  firewalld-0.3.8 release that support --remove-rules out so documenting this.
  BF: remove duplication definition secion in webmin-auth
  DOC: alter release notes a bit more and versions in README.md
  BF/DOC: fix hopefully final MANIFEST and release instructions
  ...
2013-11-08 17:25:40 -08:00
Yaroslav Halchenko 965c07cb26 debian/watch - restrict version matching only to numbers and period (to exclude alpha releases of 0.9 series) 2013-07-08 10:08:35 -04:00
Yaroslav Halchenko 8960b5734a debian/jail.conf - added "submission" (port 587) to all SMTP-related jails (Closes: #714632). Thanks Tony den Haan for the report 2013-07-01 14:38:39 -04:00
Yaroslav Halchenko 278b49f52d debian/jail.conf: pure-ftpd jail should monitor syslog not auth.log.
Thanks Laurent Léonard for the report
2013-06-21 10:48:32 -04:00
Yaroslav Halchenko 01d637e9c0 status calls would dump all output to /dev/null 2013-06-19 22:19:40 -04:00
Yaroslav Halchenko b89e6ca770 BF: debian/fail2ban.init - fixed handling of the return code from do_start/do_stop 2013-06-19 21:56:35 -04:00
Yaroslav Halchenko 39699896aa initial changelog for 0.8.10, urgency high 2013-06-12 13:31:53 -04:00
Yaroslav Halchenko 3ed3c3af3d Merge tag '0.8.10' into debian
Release 0.8.10 -- wanna-be-secure, addresses possible DoS with apache- filters

* tag '0.8.10': (25 commits)
  DOC: add information on where to report vulnerabilities + pointer to HOWTO_Seek_Help
  Changes for 0.8.10 release (changelog, version, etc)
  BF: anchor apache- filters.  Close #248
  DOC: credits for gh-244
  Filter Asterisk: Add sample log entry to testcase.
  Filter Asterisk: Add AUTH_UNKNOWN_DOMAIN error to list
  ENH: purge a few more .*
  DOC: credits
  DOC: how to do filter enhancements
  TST: normalize logs to use example.com and 1.2.3.4 as IP
  ENH/BF: constrain regex. Fix ACL error regex
  ENH: port optional
  Changelog for previous PR
  DOC: Changelog entry fro preceeding merge from Terence
  TST: Fix fail2ban.conf reader test for unreliable dictionary order
  failregex when roundcube log driver is set to 'syslog'
  fixed failregex line for roundcube 0.9+
  TST: test all stock jails to have actions and correctly specifying blocktype
  CFG: assure actions for all the jails
  BF: blocktype must be defined within [Init] -- adding [Init] section.  Close #232
  ...
2013-06-12 13:25:15 -04:00
Yaroslav Halchenko 8811f4c5a8 Just ignore build-time tests failures for now -- still TODO 2013-05-13 12:00:10 -04:00
Yaroslav Halchenko b4b7fa6c60 patch deb_temp_disable_inaccessiblefile_test to allow build with fakeroot 2013-05-13 11:45:52 -04:00
Yaroslav Halchenko 6e6b1f1355 update lucid-dsc-patch patch 2013-05-13 11:37:06 -04:00
Yaroslav Halchenko 5b431f18dd boost policy compliance to 3.9.4 2013-05-13 11:34:08 -04:00
Yaroslav Halchenko 2e3eb926a5 ENH: run unittests at build time 2013-05-13 11:33:36 -04:00
Yaroslav Halchenko e3d068fcf8 BF: create directory for bash_completion.d 2013-05-13 11:27:55 -04:00
Yaroslav Halchenko 39bc2e34f1 Merge tag '0.8.9' into debian
Release 0.8.9

* tag '0.8.9':
  BF: add missing files to MANIFEST (I think we shoult not rely on sdist anyways -- 'git tag' tarballs are more thorough ;) )
2013-05-13 11:24:26 -04:00
Yaroslav Halchenko 30adad2029 added new sample jails definitions for ssh-route, ssh-iptables-ipset{4,6}, roundcube-auth, sogo-auth, mysqld-auth 2013-05-13 11:18:23 -04:00
Yaroslav Halchenko 4361f4c869 provides bash_completion.d/fail2ban 2013-05-13 11:06:52 -04:00
Yaroslav Halchenko 8332f6a3af refreshed manpage patches 2013-05-13 11:04:09 -04:00
Yaroslav Halchenko 414a1f0a84 update changelog entry 2013-05-13 11:03:51 -04:00
Yaroslav Halchenko a0b20c642c Merge tag '0.8.9' into debian
Releasing 0.8.9

* tag '0.8.9': (46 commits)
  All the (version) updates for the release of 0.8.9
  BF: (travis) relax the test for needed to be presented installed directories -- allow new
  BF: (travis) if tests ran under coverage -- there is a traceback parts to report (thus > would be present)
  ENH: also print the failing traceback line in case of failure
  ENH: include explicit list of new files which should not be there upon "install --root"
  ENH: now we know that logging handlers closing was still buggy in 2.6.2
  ENH: issue a warning if jail name is longer than 19 symbols (Close #222)
  DOC: inline commends with ';' are in effect only if ';' follows as space
  BF: Fix for filterpoll incorrectly checking for jailless state
  ENH: strengthen detection of working pyinotify
  ENH: use the same python executable for setup.py test
  ENH: actually tune up TraceBack to determine "unittest" portions of the stack across all python  releases
  TST: Some primarily smoke tests for tests utils
  TST: cover few more lines in fail2banreader.py
  ENH: basic test for setup.py itself (when applicable, should greatly improve coverage ;) )
  ENH: consistent operation of formatExceptionInfo + unittest for it
  ENH: point to the status of master branch on travis
  ENH: close open file in a test
  Previous coverage was 56% (without disregarding any pragma)
  ENH: close files in _test_move_into_file
  ...
2013-05-13 11:02:40 -04:00
Yaroslav Halchenko 7b24a7a599 README is .md now 2013-05-07 12:44:11 -04:00
Yaroslav Halchenko f2d75f612a updated changelog and suggest system-log-daemon 2013-05-07 12:41:28 -04:00
Yaroslav Halchenko d59c41197e Merge commit '0.8.8-276-g5e1d8b0' into debian
* commit '0.8.8-276-g5e1d8b0': (103 commits)
  ENH: logs/sshd -- have ":" after [daemon] (other uses are uncommon)
  ENH: logs/sshd -- use example.com as the resolved hostname in sample log lines
  ENH: filter.d/sshd.conf -- allow for trailing "via IP" in logs
  ENH: Removed unused log line
  ENH: logrotate file
  ENH: some form of logrotate based on what distros are doing
  DOC: macports distribution of fail2ban
  TST: test case for <br> tags in action
  DOC: credits for BSD ssh filter changes
  EHN: enhance sshd filter for bsd.
  DOC: purge of svn tags
  Slight tune up of changelog entry (treeish change due to squashing)
  fixed test date thx to steven
  tight control of the filter for ASSP
  as yaroslav wishes
  as daniel desires
  changed from DateASSPlike class to DateStrptime
  fixed little things
  added new date format support for ASSP SMTP Proxy
  Forgotten Changelog entry for "is None" changes
  ...
2013-05-07 12:33:13 -04:00
Yaroslav Halchenko b94dede5d5 adjusted changelog 2013-03-27 12:03:13 -04:00
Yaroslav Halchenko 76cdacf43a Merge commit '0.8.8-147-g4b11f07' into debian
* commit '0.8.8-147-g4b11f07':
  DOC: minor fix ups of manpages. fixes #159
  non-static (get|set)BaseDir for Configurator. fixes #160
2013-03-27 12:02:35 -04:00
Yaroslav Halchenko d9826d2a2d install .5 manpages as well 2013-03-27 11:28:25 -04:00
Yaroslav Halchenko 9b18768192 Refresh the manpages patch 2013-03-27 11:26:46 -04:00
Yaroslav Halchenko 1f78630865 Minimalistic changelog entry for a snapshot build 2013-03-27 11:22:58 -04:00
Yaroslav Halchenko 6c4aeaedc5 Merge commit '0.8.8-145-g72b0647' into debian
* commit '0.8.8-145-g72b0647': (114 commits)
  ENH: Slight tune ups for fresh SOGo filter + comment into the sample log file
  ENH: postfix filter -- react also on (450 4.7.1) with empty from/to. fixes #126
  TST: basic testing of reading the shipped jail.conf (forcing all jails to be enabled)
  ENH: allow to force enable all jails (for testing), do not crash for jails without actions (just warn)
  ENH: minor -- add default value into the warning if option had none provided
  ENH: _copy_lines_between_files -- read all needed, and only then write/flush at once
  ENH: move pyinotify callback debug message into callback + delay string interpolations
  ENH: adding ability to incorporate tracebacks into log lines while running tests
  ENH: FailManager -- improve log message to report total # of detected failures as well
  BF: allow to wait longer for FilterPoll in test_move_file
  ENH: elaborated debug log message about already detected failures
  BF: Remove custom __str__ for MonitorFailures and just adjust __name__ of the generated class
  DOC: Added suggested by @beilber description of .d/ + added I formatting to all filenames
  ENH: increase timeout to 20 sec from 10 sec in assert_correct_last_attempt
  BF: fixing up for handling of TAI64N timestamps and adding some unittest for prev commit (not effective much though)
  An example of failed logins against sogo
  Update sogo-auth.conf
  Added Daniel and Steven to THANKS
  My improvements to manpages
  PKG: change email that I want in RPMs
  ...
2013-03-27 11:19:46 -04:00
Yaroslav Halchenko b951ad78c4 debian/jail.conf: added findtime and documentation on those basic options from jail.conf 2013-02-18 18:51:15 -05:00
Yaroslav Halchenko 3754a48b24 Added lucid-dsc-patch to use pycentral on systems without dh_python2 2012-12-06 12:53:20 -05:00
Yaroslav Halchenko 1187253b6e Changelog entry for 0.8.8-1 2012-12-05 22:54:29 -05:00
Yaroslav Halchenko e484ef0a26 Merge tag '0.8.8' into debian
Primarily a bugfix release 0.8.8

* tag '0.8.8': (31 commits)
  Getting ready for 0.8.8 release (changelog, version boost)
  BF: guarantee that IP is stored as a base, non-unicode str (Closes gh-91)
  ENH: BF (forgotten import) for prev commit + removed duplicate Author, adjusted __ fields for that in fail2ban-* scripts
  ENH: until we make it proper module -- adjust sys.path only if system-wide run
  ENH: fail2ban-testcases-all -- pass cmdline options to fail2ban-testcases
  ENH: To help with gh-87 added hints into the log on some failure return codes (e.g. 0x7f00 for this one)
  ENH: trying to go native travis-ci python way to take advantage of virtualenv's with older pythons
  BF: typo
  BF: added a little shell script to excercise tests against all available Python versions
  ENH: travis -- try to run tests against all available python versions
  NF: rudimentary .travis.yml for travis-ci.org service
  BF: do not enable pyinotify backend if pyinotify is too old (Closes gh-80)
  DOC: forgotten --help entry for " unban "
  ENH: downgrade "already banned" from WARN to INFO level (Closes gh-79)
  minor: added a note on now "negative" log entries on "POSSIBLE BREAK-IN ATTEMPT"
  DOC: minor "fixes" in DEVELOP
  Added in while loop to process the Fail Manager after the requested banned IP was added to its queue.  This solves the issue of needing to touch the log file that is being monitored to get the IP to be banned accordingly.  Added in import of FailManagerEmpty exception class.
  ENH: refactored previous commit to make it more Pythonic (With prev commit closes gh-86, gh-81)
  Added in command option to unban and IP, just like using 'banip'.  Command looks like: fail2ban-client set <jail name> unbanip <ip>
  BF: in code we should use MyTime wrapper instead of time module directly
  ...
2012-12-05 22:53:04 -05:00
Yaroslav Halchenko 2a83cf2814 new changelog entry 2012-07-31 21:49:10 -04:00
Yaroslav Halchenko 020ac1b2e9 Merge tag '0.8.7.1' into debian
Minor bugfix release 0.8.7.1

* tag '0.8.7.1':
  Changelog for the fix -- will rerelease 0.8.7.1
  BF: removed sneaked a commented out sys.path.insert
2012-07-31 21:48:59 -04:00
Yaroslav Halchenko b41a249161 recommend python-pyinotify and only suggest python-gamin 2012-07-31 18:02:24 -04:00
Yaroslav Halchenko 197edfc271 debian/control,rules: switch to use dh_python2, boost policy compliance to 3.9.3 2012-07-31 17:33:13 -04:00
Yaroslav Halchenko d969aef8f8 BF: specify full action for recidive jail since it needs allport action 2012-07-31 17:02:34 -04:00
Yaroslav Halchenko 235267b7ac debian/source: switch to 3.0 (quilt) format 2012-07-31 16:54:09 -04:00
Yaroslav Halchenko 9429655045 use unprefixed upstream release tags 2012-07-31 16:52:44 -04:00
Yaroslav Halchenko 475558056e Merged changelog with unreleased 0.8.6-4 to avoid possible confusions 2012-07-31 16:52:00 -04:00
Yaroslav Halchenko 29f108dbb1 Close also #653074 since fixed in 5cac32e038 2012-07-31 16:50:35 -04:00
Yaroslav Halchenko 86ae7d2f5e debian/fail2ban.init: Should-(start|stop): iptables-persistent (Closes: #598109), ferm (Closes: #604843) 2012-07-31 16:21:03 -04:00
Yaroslav Halchenko 59e95b053e debian/jail.conf: adopted few jails from "upstreams" jail.conf: asterisk, recidive, lighttpd, php-url-open 2012-07-31 16:16:55 -04:00
Yaroslav Halchenko 1163450227 added usedns option into debian/jail.conf 2012-07-31 16:08:00 -04:00
Yaroslav Halchenko c4acaf8bd0 Refreshed the patch 2012-07-31 16:06:01 -04:00
Yaroslav Halchenko d8d950dcc6 ENH: adopted description about backends from upstream's jail.conf 2012-07-31 16:02:31 -04:00
Yaroslav Halchenko 14d609941b monitor syslog not auth.log for wuftpd 2012-07-31 15:59:44 -04:00
Yaroslav Halchenko 23e979a20e Adjusted changelog to reflect changes pulled with the merge 2012-07-31 15:58:15 -04:00
Yaroslav Halchenko 1fd9b6934e Merge tag '0.8.7' into debian -- additional fixes after reviewing more of Debian bug reports
Re-tagging 0.8.7 with hope to do that last time ;)

* tag '0.8.7':
  ENH: match possibly present "pam_unix(sshd:auth):" portion for sshd (Closes: #648020)
  ENH: add wu-ftpd failregex for use against syslog (Closes: #514239)
  BF: anchor chain name in actioncheck's for iptables actions (Closes: #672228)
  BF: inline comments must use ; not # -- recidive jail
2012-07-31 15:56:49 -04:00
Yaroslav Halchenko d0c5da97a4 Initiated debian changelog entry for 0.8.7-1 2012-07-31 14:04:25 -04:00
Yaroslav Halchenko 16d3ec579f Merge tag '0.8.7' into debian
Releasing 0.8.7

* tag '0.8.7':
  Boosted version to 0.8.7 + few more comments
  perspective changelog for 0.8.7
  DOC: minor (untabify, utf8) for ChangeLog
2012-07-31 12:34:17 -04:00
Yaroslav Halchenko 25077092e9 adjusted revision 2012-07-20 09:56:36 -04:00
Yaroslav Halchenko 954254008b Merge commit '0.8.6-100-gdca5634' into debian-devel -- inotify backend should work
* commit '0.8.6-100-gdca5634':
  RF: reordered tests + enabled gamin now that its fix is pending in Debian
  ENH+BF: filtergamin -- to be more inline with current design of filterinotify
  ENH: 1 more sleep_4_poll to guarantee difference in time stamp
  ENH: few more delays for cases relying on time stamps
2012-07-20 09:55:37 -04:00
Yaroslav Halchenko b8a8720a49 updated changelog 2012-07-19 17:30:25 -04:00
Yaroslav Halchenko cbce65574b Merge commit '0.8.6-95-gc0c1232' into debian-devel
* commit '0.8.6-95-gc0c1232':
  ENH: tests much more robust now across pythons 2.4 -- 2.7
  BF+RF: pyinotify refreshes watcher upon CREATE, unified/simplified *(add|del)LogPath among *Filters
  Ask users to report bugs to github's issues
  Replace "|" with "_" in ipmasq-ZZZzzz|fail2ban.rul (Closes gh-66)
2012-07-19 17:29:54 -04:00
Yaroslav Halchenko f6137c4def Adjusting the patch new path to report bugs 2012-07-19 14:50:51 -04:00
Yaroslav Halchenko 7dbbc61319 adjusted revision 2012-07-19 14:06:44 -04:00
Yaroslav Halchenko 09dd317b20 Merge commit '0.8.6-90-g08564bd' into debian-devel
* commit '0.8.6-90-g08564bd':
  ENH: fail2ban-testcases -- custom logging format to ease debugging, non-0 exit code in case of failure
  ENH: Filter's testcases -- rename, del + list again --- a bit unstable, might still fail from time to time
  BF: pyinotify -- monitor the parent directory for IN_CREATE + process freshly added file (Closes gh-44)
  ENH: first working unittest for checking polling and inotify backends
  RF/BF: just use pyinotify.ThreadedNotifier thread in filterpyinotify
  RF: filter.py -- single readline in a loop
  ENH: FilterPoll -- adjusted some msgs + allowed to operate without jail (for testing)
  Minor additional comment to DEVELOP
  ENH: extended test LogfileMonitor
  ENH: add more verbosity levels to be controlled while running unittests
  Added few tests of FileFilter.  yet to place them into a Jail-ed execution test
  DOC: distilling some of server "design" into DEVELOP notes for common good
  ENH: minor, just  trailing spaces/tabs + reformated a string
  ENH: added a basic test for FilterPoll for detection of modifications
  clarified that the are existing test cases and the 'coming soon' is about creating new ones.
  Added beginnings of documentation for developers
  BF: usedns=no was not working at all
  RF: filtertestcase.py to put common testing into a helping subroutine
  ENH: be able to control verbosity from cmdline for fail2ban-testcases
2012-07-19 14:06:14 -04:00
Yaroslav Halchenko ad6d9760f9 Adjusted url to "local DOS" issue now described in the manual 2012-07-14 11:12:54 -04:00
Yaroslav Halchenko ffd12554e4 changelog entry for 0.8.6~+git69-gb4099da-1 2012-06-06 23:41:10 -04:00
Yaroslav Halchenko 59baf83110 Merge commit '0.8.6-69-gb4099da' into debian-devel
* commit '0.8.6-69-gb4099da': (57 commits)
  DOC: Adjusted header for config/*.conf to mention .local and way to comment
  Fixed addBannedIP to add enough failures to trigger a ban, rather than just one failure.
  Fix Gentoo initd script (drop extra_commands)
  ENH: catch failed ssh logins due to being listed in DenyUsers. Close gh-47 (Closes: #669063)
  DOC: comment in jail.conf for the need of multiple jails for asterisk
  Add the INCLUDE section to use __pid_re feature
  Disable asterisk jail by default
  Change jail for asterisk, add support for SIP and SIP-TLS on TCP and UDP ports
  Change NOTICE by NOTICE%(__pid_re)s
  Added a warning for the recidive jail
  BF: fail2ban-regex -- adding forgotten char for -v
  Remove custom bantime
  Add sample log file for asterisk
  Add $ at the end of the failregex
  ENH: fail2ban-regex -- quieter by default and added --verbose mode
  ENH: minor, just pythonized some parts of fail2ban-regex summary
  ENH: rudimentary __repr__ for Filter and Jail + moved usedns into set method
  BF: allow trailing whitespace in few missing it regexes for sshd.conf
  BF+ENH: added %m-%d-%Y pattern + do not add %Y for Feb 29 fix if already present in the pattern
  minor comment into TODO
  ...
2012-06-06 23:39:22 -04:00
Yaroslav Halchenko 6ad4276a4e DOC: note about way to add comments + pruned not needed authorship line and obsolete $Revision$ 2012-06-04 22:46:59 -04:00
Yaroslav Halchenko 826f53f92d adjusted changelog 2012-02-10 08:20:10 -05:00
Yaroslav Halchenko 7154b3aefd Since we are exiting with non-0 -- all msgs should be failures 2012-02-09 13:03:53 -05:00
Yaroslav Halchenko f0da12e58b Merge pull request #36 from glennaaldering/patch-3
Provide informative exit codes upon exit of status.
Debian policy is not specifying any and status command is optional, but LSB  http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html  does provide the desired ones
2012-02-09 09:48:33 -08:00
Glenn Aaldering 5cac32e038 Making sure that the status command gives the correct exit code when fail2ban is not running. 2012-02-09 18:33:14 +01:00
Yaroslav Halchenko b25dddff31 Added dovecot section to Debian's jail.conf. Thanks to Laurent Léonard (Closes: #655182) 2012-01-08 21:47:18 -05:00
Yaroslav Halchenko 088aa67381 DOC: finalizing changelog 2012-01-07 19:46:42 -05:00
Yaroslav Halchenko 84e30ff73a DOC: a bit extended and reordered run-rootless.txt 2012-01-07 19:43:15 -05:00
Yaroslav Halchenko 1be14b8470 FIX: added blank build-{arch,indep} to pacify lintian 2012-01-07 18:56:07 -05:00
Yaroslav Halchenko 5701ecb681 FIX: reversed Vcs- fields 2012-01-07 18:54:34 -05:00
Yaroslav Halchenko 2828ad4968 FIX: we are using debian not debian-release branch now 2012-01-07 18:53:13 -05:00
Yaroslav Halchenko 055c3e9323 changelog for xt changes 2012-01-07 15:33:20 -05:00
Yaroslav Halchenko 5c2abe60a1 Added pure-ftpd section to Debian's jail.conf. Thanks to Laurent Léonard (Closes: #654412) 2012-01-05 23:01:11 -05:00
Zbigniew Jędrzejewski-Szmek 5a82e41285 Merge branch 'xt_recent-echo' into debian 2012-01-06 00:55:04 +01:00
Zbigniew Jędrzejewski-Szmek bc82a68481 DOC: add documentation for xt_recent-echo without root 2012-01-06 00:55:04 +01:00
Zbigniew Jędrzejewski-Szmek de502cf2e4 NF: run as different user (disabled by default) 2012-01-06 00:36:50 +01:00
Yaroslav Halchenko aa4f5cf2b7 BF: adjusted vcs- fields to point to github upstream repo 2011-11-29 09:00:29 -05:00
Yaroslav Halchenko e5ea44b999 Adjusted debian/watch to fetch tarballs from github 2011-11-28 23:01:32 -05:00
Yaroslav Halchenko a27bff08e5 [1efe1bc] Fresh upstream release (Closes: #648324) + boost policy to 3.9.2 2011-11-28 22:54:36 -05:00
Yaroslav Halchenko 2fd8be18e5 Merge commit '0.8.6' into debian
* commit '0.8.6':
  Changelog and version changes for 0.8.6
  Revert "ENH: server.py -- addLogPath with tail=True"
  DOC: updated contact information to direct to github and mailing list
  ENH: added custom timeformat with '.' as separator. Close gh-1
  BF: stop all communications before stopping the jails (Close gh-7)
  ENH: added logging while stopping the jails
  Add Date: header for sendmail*.conf actions
  BF: gentoo-initd assure /var/run dir + remove stale sock file
  ENH: fix of syntax for compatibility with Python 2.4
  ENH: stay compatible with python < 2.5 (use md5 if hashlib is N/A)
  BF: use hashlib instead of deprecated md5
  ENH: Remove obsolete code from gentoo init script. Bug gentoo#367819.
2011-11-28 22:47:27 -05:00
Yaroslav Halchenko 9faeecc67c Merge branch 'master' into debian-release
* master:
  moving log samples under testcases/files
2011-11-18 11:59:21 -05:00
Yaroslav Halchenko 40fbb55044 Merge branch 'master' (early part) into debian-release
* 'master' (early part):
  Adding log samples accumulated in Debian branch
  BF: removing minor bashism in ipmasq example file (closes: #530078). Thanks Raphael Geissert
  Added ipmasq rule file to restart fail2ban when iptables are wiped out (closes: #461417). Thanks Guido Bozzetto
  added rudimentary .gitignore
  BF: be able to detect time for VNC recording only 2 letters of year (closes: #537610)
2011-11-18 11:59:08 -05:00
Yaroslav Halchenko 9b96a01d3e adjusting email for Cyril to be cyril.jaquier@fail2ban.org 2011-11-18 11:49:34 -05:00
Yaroslav Halchenko 42e6653486 RF: moving manpages tune ups into debian patch
original commit 3389184f41
2011-11-18 11:43:33 -05:00
Yaroslav Halchenko e28688a3d3 Adding files which were not present in sdist
and removed PKG-INFO
2011-11-18 10:47:47 -05:00
Yaroslav Halchenko cd38985e61 Merge branch 'master' into debian-release
* master: (27 commits)
  ENH: server.py -- addLogPath with tail=True
  ENH: set/getFile for ticket.py -- found in source distribution of 0.8.4
  NF: adding unittests for previous commit
  ENH: removed expansion for few Date and Revision SVN keywords
  ENH: sshd.conf -- allow user names to have spaces and trailing spaces in the line
  Removed duplicate entry for DataCha0s/2\.0 in badbots (closes: #519557)
  BF: return declaration of TABLE back (thanks to michaelberg79)
  Update server/datetemplate.py
  format output of matches data.
  ENH: minor unittest to see if tickets carry correct 'matches'
  ENH: introduced usa of Ticket.__matches throughout
  ENH: added 'matches' to the Ticket(s) and deprecated "custom" constructors for derived *Tickets
  ENH: modelines for emacs and vim to assure consistent indentation scheme (tabs)
  ENH: failmanager -- additional debug message about # of known failures
  ENH: rudimentary __str__ for the ticket
  ENH: more human-accessible printout of the dates if any comparison fails
  ENH: few debug messages and use MyTime.localtime instead of straight time.time
  ENH: Added localtime() to MyTime
  BF: set TZ to CEST while unittesting so dates matching would work
  ENH: added a .pylintrc to help with consistent appearance and catch obvious problems
  ...

Conflicts:
	MANIFEST  -- wasn't present before due to base on source distribution
	server/ticket.py  -- strange conflict -- should be benign
2011-11-18 10:43:13 -05:00
Yaroslav Halchenko 8f3d54882a manually removed all expansion for SVN keywords to match with master 2011-11-18 10:10:45 -05:00
Yaroslav Halchenko 2b27d83625 changelog for 0.8.5-2 2011-09-23 22:12:27 -04:00
Yaroslav Halchenko 9c4b041821 BF: Lock server's executeCmd to prevent racing among iptables calls (Closes: #554162)
Many kudos go to Michael Saavedra for the solution and the patch.
2011-09-23 22:05:29 -04:00
Yaroslav Halchenko a41a8e3dc7 adjusted changelog 2011-07-28 23:22:33 -04:00
Yaroslav Halchenko 72109ef12c Merge branch 'debian' into debian-release
* debian:
  Added a note on diverting logrotate configuration for custom logtarget=SYSLOG (Closes: #631917)
2011-07-28 23:20:39 -04:00
Yaroslav Halchenko 60f459e3c4 Added a note on diverting logrotate configuration for custom logtarget=SYSLOG (Closes: #631917) 2011-07-28 23:20:23 -04:00
Yaroslav Halchenko 584539a2c4 changelog for 0.8.5-1 2011-07-28 23:08:16 -04:00
Yaroslav Halchenko d7dd84be01 Merge branch 'upstream' into debian-release
* upstream:
  for 0.8.5 release -- changelog + version
  BF: use addfailregex instead of failregex while processing per-jail "failregex" parameter (Closes: #635830) (LP: #635036)
  BF: use os.path.join to generate full path - fixes includes in configs given local filename
  very minor -- uniform indentation in example
  BF: use standard/reserved example.com instead of mail.com
  ENH: Adding author for dovecot filter and prunning unneeded space in the regexp
2011-07-28 23:08:08 -04:00
Yaroslav Halchenko 2ab8e35652 Merge branch 'debian' into debian-release
* debian:
  Set backend to auto and recommends python-gamin (Closes: #524425)
2011-07-28 23:08:03 -04:00
Yaroslav Halchenko 6c07999157 Merge commit 'remotes/upstream-repo/tags/FAIL2BAN-0_8_5^' into upstream
* commit 'remotes/upstream-repo/tags/FAIL2BAN-0_8_5^':
  for 0.8.5 release -- changelog + version
  BF: use addfailregex instead of failregex while processing per-jail "failregex" parameter (Closes: #635830) (LP: #635036)
  BF: use os.path.join to generate full path - fixes includes in configs given local filename
  very minor -- uniform indentation in example
  BF: use standard/reserved example.com instead of mail.com
  ENH: Adding author for dovecot filter and prunning unneeded space in the regexp

Conflicts:
	common/version.py -- my added copyright
2011-07-28 23:07:09 -04:00
Yaroslav Halchenko 9e3c29659d Set backend to auto and recommends python-gamin (Closes: #524425) 2011-07-28 22:56:33 -04:00
Yaroslav Halchenko 846029d154 untabify the most recent changelog 2011-03-23 17:34:32 -04:00
Yaroslav Halchenko 559c76700d Merge branch 'debian' into debian-release
* debian:
  Added dropbear jail and made formatting of jails consistent (and untabified)
  ENH: Moving gbp.conf under debian/
2011-03-23 17:22:26 -04:00
Yaroslav Halchenko a7632c0d2a Added dropbear jail and made formatting of jails consistent (and untabified) 2011-03-23 17:22:21 -04:00
Yaroslav Halchenko 1d76a032ee ENH: Moving gbp.conf under debian/ 2011-03-23 17:19:54 -04:00
Yaroslav Halchenko 66934d4ed6 changelog entry for 0.8.4+svn20110323-1 2011-03-23 17:19:14 -04:00
Yaroslav Halchenko ba09fae1ac Merge branch 'debian' into debian-release
* debian: (21 commits)
  debian/jail.conf: got 'chain' parameter to be specified for iptables actions (Closes: #515599)
  debian/jail.conf: closing " for protocol specification
  BF: proftpd filter -- if login failed -- count regardless of the reason for failure
  BF: Allow for trailing spaces in proftpd logs
  BF: escaping () in pure-ftpd filter. Thanks Teodor
  BF: allow space in the trailing of failregex for sasl.conf: see http://bugs.debian.org/573314
  ENH: add <chain> to action.d/iptables*. Thanks Matthijs Kooijman: see http://bugs.debian.org/515599
  NF: Adding found on a drive filter.d/dovecot.conf
  ENH: make filter.d/apache-overflows.conf catch more: see http://bugs.debian.org/574182
  ENH: dropbear filter: see http://bugs.debian.org/546913
  BF: Use /var/run/fail2ban instead of /tmp for temp files in actions: see http://bugs.debian.org/544232
  ENH: adjusted description for sasl jail (Closes: #615952)
  ENH: slight rewordings of the long description (Closes: #588176)
  debian/copyright: updated copyright years
  Boosted policy compliance version to 3.9.1 (no changes seems to be due)
  spellcheck jail.conf. Thanks Christoph Anton Mitterer
  spellcheck debian/jail.conf (Closes: #598206). Thanks Christoph Anton Mitterer
  debian: default ignoreip to ignore entire loopback zone (/8): see http://bugs.debian.org/598200
  default ignoreip to ignore entire loopback zone (/8): see http://bugs.debian.org/598200
  Tai64N stores time in GMT, we need to convert to local time before returning
  ...
2011-03-23 17:04:21 -04:00
Yaroslav Halchenko 086176c4df debian/jail.conf: got 'chain' parameter to be specified for iptables actions (Closes: #515599)
+ trailing whitespaces were removed

Thanks to Christoph Anton Mitterer for the original bugreport raising the
concern and Matthijs Kooijman for giving 'chains parameter' idea
2011-03-23 16:59:39 -04:00
Yaroslav Halchenko 350c5f676b debian/jail.conf: closing " for protocol specification
not sure how it did not have any negative impact before :-/
2011-03-23 16:56:57 -04:00
Yaroslav Halchenko 898fab7758 Merge commit 'upstream/0.8.4+svn20110323' into debian
* commit 'upstream/0.8.4+svn20110323': (37 commits)
  BF: proftpd filter -- if login failed -- count regardless of the reason for failure
  BF: Allow for trailing spaces in proftpd logs
  BF: escaping () in pure-ftpd filter. Thanks Teodor
  BF: allow space in the trailing of failregex for sasl.conf: see http://bugs.debian.org/573314
  ENH: add <chain> to action.d/iptables*. Thanks Matthijs Kooijman: see http://bugs.debian.org/515599
  NF: Adding found on a drive filter.d/dovecot.conf
  ENH: make filter.d/apache-overflows.conf catch more: see http://bugs.debian.org/574182
  ENH: dropbear filter: see http://bugs.debian.org/546913
  BF: Use /var/run/fail2ban instead of /tmp for temp files in actions: see http://bugs.debian.org/544232
  spellcheck jail.conf. Thanks Christoph Anton Mitterer
  default ignoreip to ignore entire loopback zone (/8): see http://bugs.debian.org/598200
  Tai64N stores time in GMT, we need to convert to local time before returning
  debug entry for lines ignored due to falling below findtime (v2)
  disabling entirely named-refused-udp jail with a big fat warning
  added time module. bug reported in buanzo's blog at http://blogs.buanzo.com.ar/2009/04/fail2ban-patch-ban-ip-address-manually.html
  - Patch to make log file descriptors cloexec to stop leaking file descriptors on fork/exec. Thanks to Jonathan Underwood. https://bugzilla.redhat.com/show_bug.cgi?id=230191#c24
  - Changed to SVN version.
  - Release 0.8.4.
  - Oups... Forgot the ChangeLog...
  - Check the inode number for rotation in addition to checking the first line of the file. Thanks to Jonathan Kamens. - Red Hat Bugzilla - Bug 503852 - SF.net Bug #2800279.
  ...
2011-03-23 16:53:51 -04:00
Yaroslav Halchenko 93d1583bb9 Merge branch 'upstream-0.8' into upstream
* upstream-0.8:
  BF: proftpd filter -- if login failed -- count regardless of the reason for failure
  BF: Allow for trailing spaces in proftpd logs
  BF: escaping () in pure-ftpd filter. Thanks Teodor
  BF: allow space in the trailing of failregex for sasl.conf: see http://bugs.debian.org/573314
  ENH: add <chain> to action.d/iptables*. Thanks Matthijs Kooijman: see http://bugs.debian.org/515599
  NF: Adding found on a drive filter.d/dovecot.conf
  ENH: make filter.d/apache-overflows.conf catch more: see http://bugs.debian.org/574182
  ENH: dropbear filter: see http://bugs.debian.org/546913
  BF: Use /var/run/fail2ban instead of /tmp for temp files in actions: see http://bugs.debian.org/544232
2011-03-23 16:51:16 -04:00
Yaroslav Halchenko a6bc0e517f ENH: adjusted description for sasl jail (Closes: #615952) 2011-03-23 16:09:00 -04:00
Yaroslav Halchenko 97ac5bd205 ENH: slight rewordings of the long description (Closes: #588176) 2011-03-23 16:00:01 -04:00
Yaroslav Halchenko cfd6cf7b1b debian/copyright: updated copyright years 2011-03-23 15:55:43 -04:00
Yaroslav Halchenko eb5bcdad81 Boosted policy compliance version to 3.9.1 (no changes seems to be due) 2011-03-23 15:55:01 -04:00
Yaroslav Halchenko 4c288cd156 1 more example log line for sasl filter 2011-03-23 15:48:31 -04:00
Yaroslav Halchenko d3ca26d4b1 adding sample log files for apache-overflows and dovecot 2011-03-23 15:08:19 -04:00
Yaroslav Halchenko 2394a465fa Merge branch 'upstream-0.8' into upstream
* upstream-0.8:
  spellcheck jail.conf. Thanks Christoph Anton Mitterer
  default ignoreip to ignore entire loopback zone (/8): see http://bugs.debian.org/598200
  Tai64N stores time in GMT, we need to convert to local time before returning
  debug entry for lines ignored due to falling below findtime (v2)
  disabling entirely named-refused-udp jail with a big fat warning
  added time module. bug reported in buanzo's blog at http://blogs.buanzo.com.ar/2009/04/fail2ban-patch-ban-ip-address-manually.html
2011-03-23 13:36:22 -04:00
Yaroslav Halchenko aede895096 Forgotten Merge commit 'upstream/0.8.4' into debian
Should have been done long before -- debian/ branch tracks source
releases of fail2ban, and there was 0.8.4 which was at once merged into
debian-release (debian branch + patches/fixes) but not into debian

* commit 'upstream/0.8.4':
  Imported Upstream version 0.8.4
  - Use 80 columns.
  - Fixed maxretry/findtime rate. Many thanks to Christos Psonis. Tracker #2019714.
  - Made the named-refused regex a bit less restrictive in order to match logs with "view". Thanks to Stephen Gildea.
  - Use timetuple instead of utctimetuple for ISO 8601. Maybe not a 100% correct fix but seems to work. Tracker #2500276.
  - Changed <HOST> template to be more restrictive. Debian bug #514163.
  - Added cyrus-imap and sieve filters. Thanks to Jan Wagner. Debian bug #513953.
  - Pull a commit from Yaroslav git repo. BF: addressing added bang to ssh log (closes: #512193).
  - Added missing semi-colon in the bind9 example. Thanks to Yaroslav Halchenko.
  - Added NetBSD ipfilter (ipf command) action. Thanks to Ed Ravin. Tracker #2484115.
  - Improved SASL filter. Thanks to Loic Pefferkorn. Tracker #2310410.
  - Added CPanel date format. Thanks to David Collins. Tracker #1967610.
  - Added nagios script. Thanks to Sebastian Mueller.
  - Removed print.
  - Removed begin-line anchor for "standard" timestamp. Fixed Debian bug #500824.
  - Remove socket file on startup is fail2ban crashed. Thanks to Detlef Reichelt.
2011-03-23 13:20:40 -04:00
Yaroslav Halchenko db6aadfc39 spellcheck debian/jail.conf (Closes: #598206). Thanks Christoph Anton Mitterer 2010-09-27 09:16:34 -04:00
Yaroslav Halchenko 35e43cf650 debian: default ignoreip to ignore entire loopback zone (/8): see http://bugs.debian.org/598200 2010-09-27 09:11:47 -04:00
Yaroslav Halchenko 95a28f3c65 Merge branch 'debian' into debian-release
* debian:
  adding misc:Depends as advised by lintian
  Adding news about named-refused-udp
  thanks lintian -- tuning up version for elderly NEWS entry
2010-06-28 22:13:37 -04:00
Yaroslav Halchenko baf8cc7eb5 adding misc:Depends as advised by lintian 2010-06-28 22:13:27 -04:00
Yaroslav Halchenko ecb29697e2 Adding news about named-refused-udp 2010-06-28 22:13:15 -04:00
Yaroslav Halchenko 52f37cc159 thanks lintian -- tuning up version for elderly NEWS entry 2010-06-28 22:10:22 -04:00
Yaroslav Halchenko f7bb5e2df4 changelog entry for 0.8.4-3 2010-06-28 21:50:37 -04:00
Yaroslav Halchenko 20c0d92e89 Merge branch 'debian' into debian-release
* debian:
  Replacing word of caution with big fat warning and commenting out named-refused-udp completely (Closes: #583364)
  Adding arno-iptables-firewall (no deprecation of ipmasq per Joey Hess mentioning, which still could be used on lenny systems)
2010-06-28 21:45:56 -04:00
Yaroslav Halchenko 833f60a38a Replacing word of caution with big fat warning and commenting out named-refused-udp completely (Closes: #583364) 2010-06-28 21:45:47 -04:00
Yaroslav Halchenko d9b8625629 Merge branch 'upstream-0.8' into debian-release
* upstream-0.8:
  disabling entirely named-refused-udp jail with a big fat warning
  added time module. bug reported in buanzo's blog at http://blogs.buanzo.com.ar/2009/04/fail2ban-patch-ban-ip-address-manually.html
2010-06-28 21:42:06 -04:00
Yaroslav Halchenko d1b9e71173 Adding arno-iptables-firewall (no deprecation of ipmasq per Joey Hess mentioning, which still could be used on lenny systems) 2010-05-26 17:58:20 -04:00
Yaroslav Halchenko eb08f17cb2 changelog entry for -2 2010-02-25 00:20:08 -05:00
Yaroslav Halchenko 47fae42a3b Merge branch 'upstream' into debian-release
* upstream:
  - Patch to make log file descriptors cloexec to stop leaking file descriptors on
  - Changed to SVN version.
2010-02-25 00:17:02 -05:00
Yaroslav Halchenko 26c3416793 Merge branch 'debian' into debian-release
* debian:
  BF: --install-layout=deb for setup.py +  python (>= 2.5.4-1~) to fix install with python2.6 (closes: #571213)
2010-02-25 00:16:59 -05:00
Yaroslav Halchenko 3f898d7c05 BF: --install-layout=deb for setup.py + python (>= 2.5.4-1~) to fix install with python2.6 (closes: #571213) 2010-02-25 00:03:22 -05:00
Yaroslav Halchenko 1b8a52fa48 Merge remote branch 'upstream-repo/FAIL2BAN-0_8' into upstream
* upstream-repo/FAIL2BAN-0_8:
  - Patch to make log file descriptors cloexec to stop leaking file descriptors on
  - Changed to SVN version.
2010-02-24 23:56:21 -05:00
Yaroslav Halchenko d0f32768d6 releasing 0.8.4-1 into Debian 2009-09-11 01:49:04 -04:00
Yaroslav Halchenko d410555435 Merge branch 'debian' into debian-release
* debian:
  NF: .gbp.conf with instructions for git-buildpackage
2009-09-11 01:10:25 -04:00
Yaroslav Halchenko d2d283d18c NF: .gbp.conf with instructions for git-buildpackage 2009-09-11 01:10:15 -04:00
Yaroslav Halchenko 187d6c96a9 changelog entry 2009-09-11 00:53:53 -04:00
Yaroslav Halchenko e783caaee1 Merge branch 'up/fixes' into build
* up/fixes:
  BF: proftpd filter -- if login failed -- count regardless of the reason for failure
  BF: Allow for trailing spaces in proftpd logs (closes: #507986)
  BF: be able to detect time for VNC recording only 2 letters of year (closes: #537610)
  BF: escaping (). Thanks Teodor (Closes: #544744)

Conflicts:
	config/filter.d/proftpd.conf
2009-09-10 18:03:51 -04:00
Yaroslav Halchenko 3b7e6b6cbc Merge branches 'debian' and 'up/log_examples' into build
* debian:
  actually boosting policy
  BF: use "set logtartet" instead of "reload" while logrotate. Thanks J.M.Roth (Closes: #537773)
  BF: adjusted README.Debian - multiport is default (closes: #545971)

* up/log_examples:
  added proftpd examples from wiki
  NF: few examples for pure-ftpd
2009-09-10 18:03:32 -04:00
Yaroslav Halchenko 513d4bc2e9 Merge branch 'upstream' into build
* upstream: (21 commits)
  Imported Upstream version 0.8.4
  - Release 0.8.4.
  - Oups... Forgot the ChangeLog...
  - Check the inode number for rotation in addition to checking the first line of the file. Thanks to Jonathan Kamens.
  - Fixed typo. Thanks to Dudi Goldenberg.
  added traceback to asyncserver.py's import.
  Added item about logging subsystem shutdown being moved, to Changelog.
  moved logging shutdown out of quit(), into end of start() in server.py
  Disabled jail lighttpd-fastcgi by default.
  - Added entry for "Ban IP" command.
  added "Ban IP" command to fail2ban branch 0.8
  - Added two new filters: lighttpd-fastcgi and php-url-fopen.
  - Moved last entries in the config/ part.
  added two new filter files (PHP url_fopen, lighttpd fastcgi alerts), updated MANIFEST and jail.conf accordingly
  - Added svn:keywords property.
  - Added helper module in common.
  added 'unexpected communication error' fix to ChangeLog. Added formatExceptionInfo to server/asyncserver.py
  added missing import sys to asyncserver.py
  more readable code for python version comparison
  added python version detection to asyncore.loop(use_poll=True|False)
  ...
2009-09-10 18:02:00 -04:00
Yaroslav Halchenko f5c69d8958 Merge commit '0_8_4' into upstream
* commit '0_8_4':
  - Release 0.8.4.
  - Oups... Forgot the ChangeLog...
  - Check the inode number for rotation in addition to checking the first line of the file. Thanks to Jonathan Kamens.
  - Fixed typo. Thanks to Dudi Goldenberg.
  added traceback to asyncserver.py's import.
  Added item about logging subsystem shutdown being moved, to Changelog.
  moved logging shutdown out of quit(), into end of start() in server.py
  Disabled jail lighttpd-fastcgi by default.
  - Added entry for "Ban IP" command.
  added "Ban IP" command to fail2ban branch 0.8
  - Added two new filters: lighttpd-fastcgi and php-url-fopen.
  - Moved last entries in the config/ part.
  added two new filter files (PHP url_fopen, lighttpd fastcgi alerts), updated MANIFEST and jail.conf accordingly
  - Added svn:keywords property.
  - Added helper module in common.
  added 'unexpected communication error' fix to ChangeLog. Added formatExceptionInfo to server/asyncserver.py
  added missing import sys to asyncserver.py
  more readable code for python version comparison
  added python version detection to asyncore.loop(use_poll=True|False)
  Fix for python 2.6 / 3.0 incompatibility
2009-09-10 17:56:16 -04:00
Yaroslav Halchenko c13c64d28b Imported Upstream version 0.8.4 2009-09-10 15:08:14 -04:00
Yaroslav Halchenko 5ed0f7f90a BF: proftpd filter -- if login failed -- count regardless of the reason for failure 2009-09-10 12:04:42 -04:00
Yaroslav Halchenko b81cfae700 added proftpd examples from wiki 2009-09-10 12:02:02 -04:00
Yaroslav Halchenko 7721695f44 BF: Allow for trailing spaces in proftpd logs (closes: #507986) 2009-09-10 11:58:12 -04:00
Yaroslav Halchenko efb1f57f62 actually boosting policy 2009-09-10 11:22:48 -04:00
Yaroslav Halchenko 3389184f41 BF: be able to detect time for VNC recording only 2 letters of year (closes: #537610) 2009-09-10 11:15:38 -04:00
Yaroslav Halchenko 472a7b31ce BF: use "set logtartet" instead of "reload" while logrotate. Thanks J.M.Roth (Closes: #537773) 2009-09-10 11:05:56 -04:00
Yaroslav Halchenko 2d4b82c670 BF: escaping (). Thanks Teodor (Closes: #544744) 2009-09-10 10:50:31 -04:00
Yaroslav Halchenko bae3183f9b NF: few examples for pure-ftpd 2009-09-10 10:35:05 -04:00
Yaroslav Halchenko 3dd16eeddf BF: adjusted README.Debian - multiport is default (closes: #545971) 2009-09-10 09:09:01 -04:00
Yaroslav Halchenko 779d377ac5 Merge branch 'debian' into build
* debian:
  actually removing fail2ban installed /var/run/fail2ban while building package
2009-07-09 01:48:49 -04:00
Yaroslav Halchenko d2695899a0 actually removing fail2ban installed /var/run/fail2ban while building package 2009-07-09 01:48:43 -04:00
Yaroslav Halchenko f6861cd5ee Changelog entries 2009-07-09 01:42:48 -04:00
Yaroslav Halchenko fee38e2fc0 Merge branch 'debian' into build
* debian:
  BF: thanks lintian -- removing stale /var/run/fail2ban from dirs -- should be created by init script
  Thanks lintian for catching a misspell in README.Debian
  boosted debhelper compatibility to 5
2009-07-09 01:38:05 -04:00
Yaroslav Halchenko 01a5faf131 BF: thanks lintian -- removing stale /var/run/fail2ban from dirs -- should be created by init script 2009-07-09 01:37:58 -04:00
Yaroslav Halchenko 8de0f450e9 Thanks lintian for catching a misspell in README.Debian 2009-07-09 01:36:46 -04:00
Yaroslav Halchenko 53066981af boosted debhelper compatibility to 5 2009-07-09 01:36:03 -04:00
Yaroslav Halchenko 59223c3513 Very lengthy debian/changelog entry 2009-07-09 01:15:47 -04:00
Yaroslav Halchenko 5f6a30fe9e Merge branches 'up/fixes', 'up/log_examples', 'debian' and 'up/ipmasq' into build
* up/fixes:
  Removed duplicate entry for DataCha0s/2\.0 in badbots (closes: #519557)
  BF: Allow for trailing spaces in proftpd logs (closes: #507986)

* up/log_examples:
  added sasl example log file

* debian:
  Added a comment into Debian-shipped jail.conf about sasl logpath -- it might preferable to monitor warn.log in case of postfix

* up/ipmasq:
  BF: removing minor bashism in ipmasq example file (closes: #530078). Thanks Raphael Geissert
2009-07-09 00:58:46 -04:00
Yaroslav Halchenko 9eefb6927f Removed duplicate entry for DataCha0s/2\.0 in badbots (closes: #519557) 2009-07-09 00:58:29 -04:00
Yaroslav Halchenko a687363fff Merge branch 'upstream' into build
* upstream:
  - Use 80 columns.
  - Fixed maxretry/findtime rate. Many thanks to Christos Psonis. Tracker #2019714.
  - Made the named-refused regex a bit less restrictive in order to match logs with "view". Thanks to Stephen Gildea.
  - Use timetuple instead of utctimetuple for ISO 8601. Maybe not a 100% correct fix but seems to work. Tracker #2500276.
  - Changed <HOST> template to be more restrictive. Debian bug #514163.
  - Added cyrus-imap and sieve filters. Thanks to Jan Wagner. Debian bug #513953.
  - Pull a commit from Yaroslav git repo. BF: addressing added bang to ssh log (closes: #512193).
  - Added missing semi-colon in the bind9 example. Thanks to Yaroslav Halchenko.
  - Added NetBSD ipfilter (ipf command) action. Thanks to Ed Ravin. Tracker #2484115.
  - Improved SASL filter. Thanks to Loic Pefferkorn. Tracker #2310410.
  - Added CPanel date format. Thanks to David Collins. Tracker #1967610.
  - Added nagios script. Thanks to Sebastian Mueller.
  - Removed print.
  - Removed begin-line anchor for "standard" timestamp. Fixed Debian bug #500824.
  - Remove socket file on startup is fail2ban crashed. Thanks to Detlef Reichelt.

Conflicts:

	config/filter.d/sshd.conf
	server/filter.py
2009-07-09 00:55:57 -04:00
Yaroslav Halchenko fec4e7d286 Merge commit 'upstream-repo/FAIL2BAN-0_8' into upstream
* commit 'upstream-repo/FAIL2BAN-0_8':
  - Use 80 columns.
  - Fixed maxretry/findtime rate. Many thanks to Christos Psonis. Tracker #2019714.
  - Made the named-refused regex a bit less restrictive in order to match logs with "view". Thanks to Stephen Gildea.
  - Use timetuple instead of utctimetuple for ISO 8601. Maybe not a 100% correct fix but seems to work. Tracker #2500276.
  - Changed <HOST> template to be more restrictive. Debian bug #514163.
  - Added cyrus-imap and sieve filters. Thanks to Jan Wagner. Debian bug #513953.
  - Pull a commit from Yaroslav git repo. BF: addressing added bang to ssh log (closes: #512193).
  - Added missing semi-colon in the bind9 example. Thanks to Yaroslav Halchenko.
  - Added NetBSD ipfilter (ipf command) action. Thanks to Ed Ravin. Tracker #2484115.
  - Improved SASL filter. Thanks to Loic Pefferkorn. Tracker #2310410.
  - Added CPanel date format. Thanks to David Collins. Tracker #1967610.
  - Added nagios script. Thanks to Sebastian Mueller.
  - Removed print.
  - Removed begin-line anchor for "standard" timestamp. Fixed Debian bug #500824.
  - Remove socket file on startup is fail2ban crashed. Thanks to Detlef Reichelt.

Conflicts:

	MANIFEST
	TODO
2009-07-09 00:53:42 -04:00
Yaroslav Halchenko 6197fb178c Added a comment into Debian-shipped jail.conf about sasl logpath -- it might preferable to monitor warn.log in case of postfix 2009-07-09 00:48:05 -04:00
Yaroslav Halchenko 213954466f BF: removing minor bashism in ipmasq example file (closes: #530078). Thanks Raphael Geissert 2009-07-09 00:40:38 -04:00
Yaroslav Halchenko e3e0f8986e added sasl example log file 2009-07-09 00:32:00 -04:00
Yaroslav Halchenko 483292900c BF: Allow for trailing spaces in proftpd logs (closes: #507986) 2009-07-09 00:22:02 -04:00
Yaroslav Halchenko 3114418b1e Merge branch 'debian' into build
* debian:
  Boosted policy to 3.8.2 -- no changed are due
  fixed Vcs-git field
2009-07-09 00:05:13 -04:00
Yaroslav Halchenko 034f07ada6 Boosted policy to 3.8.2 -- no changed are due 2009-07-09 00:05:03 -04:00
Yaroslav Halchenko 8d07aa603e fixed Vcs-git field 2009-07-09 00:00:26 -04:00
Yaroslav Halchenko d47bfd73d6 added changelog entry about BF 2009-02-05 09:54:22 -05:00
Yaroslav Halchenko 2a94e90363 Merge branch 'up/fix_searchIP_v2' into build
* up/fix_searchIP_v2:
  NF: adding unittests for previous commit
  BF: anchoring regex for IP with " *$" at the end + adjust regexp for <HOST>
2009-02-05 09:51:36 -05:00
Yaroslav Halchenko 441318eba9 NF: adding unittests for previous commit 2009-02-05 09:49:45 -05:00
Yaroslav Halchenko b54290affb BF: anchoring regex for IP with " *$" at the end + adjust regexp for <HOST>
to forbid matching IPs encoded in the hostname (like
1.2.3.4.xxx.yyyyy.zzz) prior doing actual DNS lookup.

It is quite important and actually security hazard: DoS is easy to
perform...

Since now we don't do \S matching in <HOST> regexp, in the development
branches we should also allow for unicode characters by adding 're.U' to HOST's
regexp
2009-02-05 09:42:50 -05:00
Yaroslav Halchenko e5ca2a97b1 BF: added missing semicolon in a logging template for bind within jail.conf (thanks to anonymous on www.debian-administration.org) 2009-02-02 23:03:48 -05:00
Yaroslav Halchenko 5810109405 Merge branch 'up/fixes' into build
* up/fixes:
  BF: added missing semicolon in a logging template for bind within jail.conf
2009-02-02 23:02:41 -05:00
Yaroslav Halchenko 84f3a0c413 Merge branch 'debian' into build
* debian:
  BF: added missing semicolon in a logging template for bind within jail.conf
2009-02-02 23:02:35 -05:00
Yaroslav Halchenko 5fe12cc756 BF: added missing semicolon in a logging template for bind within jail.conf 2009-02-02 23:01:17 -05:00
Yaroslav Halchenko 2db0b346b2 BF: added missing semicolon in a logging template for bind within jail.conf 2009-02-02 22:59:06 -05:00
Yaroslav Halchenko 65159d1498 updated changelog 2009-01-18 11:58:31 -05:00
Yaroslav Halchenko 17165182c9 Merge branch 'debian' into build
* debian:
  adjusted description of bantime/findtime in README.Debian (closes: #507771)
2009-01-18 11:57:12 -05:00
Yaroslav Halchenko de98375553 adjusted description of bantime/findtime in README.Debian (closes: #507771) 2009-01-18 11:56:20 -05:00
Yaroslav Halchenko 01db469fb3 Merge branch 'up/fixes' into build
* up/fixes:
  BF: removing starting anchor from standard time pattern (closes: #500824).

Conflicts:

	server/datedetector.py
2009-01-18 11:44:27 -05:00
Yaroslav Halchenko b54b7def46 BF: removing starting anchor from standard time pattern (closes: #500824). 2009-01-18 11:43:48 -05:00
Yaroslav Halchenko 463564d590 New changelog entry to describe the merge of upstream
* added example for BREAK-IN in ssh
* Syncing current debian revision to FAIL2BAN-0_8@717 of upstream,
  since it includes fixes to some forwarded bugs. Total list of
  functional changes
  - Added actions to report abuse to ISP, DShield and myNetWatchman.
    Thanks to Russell Odom.
  - Added apache-nohome.conf. Thanks to Yaroslav Halchenko.
  - Added new time format. No idea from where it comes...
  - Added new regex. Thanks to Tobias Offermann.
  - Try to match the regex even if the line does not contain a valid
  date/time. Described in Debian #491253. Thanks to Yaroslav
  Halchenko.
  - Removed "timeregex" and "timepattern" stuff that is not needed
  anymore.
  - Added date template for Day-Month-Year Hour:Minute:Second
    (closes: #491253)
  - Added date pattern for Hour:Minute:Second. Thanks to Andreas
    Itzchak Rehberg.
  - Use current day and month instead of Jan 1st if both are not
    available in the log. Thanks to Andreas Itzchak Rehberg.
  - Improved pattern. Thanks to Yaroslav Halchenko.
  - Merged patches from Debian package. Thanks to Yaroslav Halchenko.
2009-01-18 11:42:13 -05:00
Yaroslav Halchenko 479fb6e201 Merge branch 'up/log_examples' into build
* up/log_examples:
  added example for BREAK-IN in ssh
2009-01-18 11:28:02 -05:00
Yaroslav Halchenko 47341e0358 Merge branch 'debian' into build
* debian:
  - Added actions to report abuse to ISP, DShield and myNetWatchman. Thanks to Russell Odom.
  - Added svn:keywords property.
  - Added apache-nohome.conf. Thanks to Yaroslav Halchenko.
  - Added new time format. No idea from where it comes...
  - Added new regex. Thanks to Tobias Offermann.
  - Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko.
  - Removed "timeregex" and "timepattern" stuff that is not needed anymore.
  - Added date template for Day-Month-Year Hour:Minute:Second.
  - Added date pattern for Hour:Minute:Second. Thanks to Andreas Itzchak Rehberg.
  - Use current day and month instead of Jan 1st if both are not available in the log. Thanks to Andreas Itzchak Rehberg.
  - Improved pattern. Thanks to Yaroslav Halchenko.
  - Merged patches from Debian package. Thanks to Yaroslav Halchenko.
  - Changed to SVN version.

Conflicts:

	config/filter.d/sshd.conf
2009-01-18 11:26:13 -05:00
Yaroslav Halchenko 342c40c7b0 Merge branch 'upstream' into debian
* upstream:
  - Added actions to report abuse to ISP, DShield and myNetWatchman. Thanks to Russell Odom.
  - Added svn:keywords property.
  - Added apache-nohome.conf. Thanks to Yaroslav Halchenko.
  - Added new time format. No idea from where it comes...
  - Added new regex. Thanks to Tobias Offermann.
  - Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko.
  - Removed "timeregex" and "timepattern" stuff that is not needed anymore.
  - Added date template for Day-Month-Year Hour:Minute:Second.
  - Added date pattern for Hour:Minute:Second. Thanks to Andreas Itzchak Rehberg.
  - Use current day and month instead of Jan 1st if both are not available in the log. Thanks to Andreas Itzchak Rehberg.
  - Improved pattern. Thanks to Yaroslav Halchenko.
  - Merged patches from Debian package. Thanks to Yaroslav Halchenko.
  - Changed to SVN version.
2009-01-18 11:24:35 -05:00
Yaroslav Halchenko 3ecce6a188 Merge commit 'remotes/upstream-repo/FAIL2BAN-0_8' into upstream
* commit 'remotes/upstream-repo/FAIL2BAN-0_8':
  - Added actions to report abuse to ISP, DShield and myNetWatchman. Thanks to Russell Odom.
  - Added svn:keywords property.
  - Added apache-nohome.conf. Thanks to Yaroslav Halchenko.
  - Added new time format. No idea from where it comes...
  - Added new regex. Thanks to Tobias Offermann.
  - Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko.
  - Removed "timeregex" and "timepattern" stuff that is not needed anymore.
  - Added date template for Day-Month-Year Hour:Minute:Second.
  - Added date pattern for Hour:Minute:Second. Thanks to Andreas Itzchak Rehberg.
  - Use current day and month instead of Jan 1st if both are not available in the log. Thanks to Andreas Itzchak Rehberg.
  - Improved pattern. Thanks to Yaroslav Halchenko.
  - Merged patches from Debian package. Thanks to Yaroslav Halchenko.
  - Changed to SVN version.

Conflicts:

	MANIFEST
2009-01-18 11:23:47 -05:00
Yaroslav Halchenko 196d4c31d8 BF: addressing added bang to ssh log (closes: #512193). Thanks Silvestre Zabala. 2009-01-18 10:41:13 -05:00
Yaroslav Halchenko 0a1326d12d Merge branch 'up/sshd_fixes' into build
* up/sshd_fixes:
  BF: addressing added bang to ssh log (closes: #512193)
2009-01-18 10:25:46 -05:00
Yaroslav Halchenko 2d8bdb6c85 added example for BREAK-IN in ssh 2009-01-18 10:25:00 -05:00
Yaroslav Halchenko b623bef3ff BF: addressing added bang to ssh log (closes: #512193) 2009-01-18 10:18:21 -05:00
Yaroslav Halchenko f868269362 releasing 0.8.3-2 2008-08-06 15:49:34 -04:00
Yaroslav Halchenko f54b7bf214 Merge branch 'up/apache_noscript_fix' into build
* up/apache_noscript_fix:
  BF: script not found could be in 2 shapes depending on inclusion of the name of the scipt
2008-08-06 15:46:38 -04:00
Yaroslav Halchenko e8fd1fe941 BF: script not found could be in 2 shapes depending on inclusion of the name of the scipt 2008-08-06 15:46:00 -04:00
Yaroslav Halchenko 3f577f7fbf BF in apache-noscript.conf - regexp matched in referer (Closes: #492319). Thanks Bernd Zeimetz. 2008-07-25 13:35:19 -04:00
Yaroslav Halchenko ddd56a1577 Merge branch 'up/apache_noscript_fix' into build
* up/apache_noscript_fix:
  BF: url is from nonspace characters. that avoids matching in referer which might be in the trailer
2008-07-25 13:33:41 -04:00
Yaroslav Halchenko 79c0d26b55 BF: url is from nonspace characters. that avoids matching in referer which might be in the trailer 2008-07-25 13:31:46 -04:00
Yaroslav Halchenko 79442fcc7b adjusted changelog due to merges 2008-07-21 10:40:22 -04:00
Yaroslav Halchenko 6bdc15ed70 Merge branch 'up/sshd_fixes' into build
* up/sshd_fixes:
  BF: Specify explicitely facilities in "Failed .. for". Thanks Dean Gaudet. (closes: #481760)
  Added failregex for "User not known" in sshd.conf. thanks Alexander Gerasiov (closes: #479966)
2008-07-21 10:37:23 -04:00
Yaroslav Halchenko 53581eed66 BF: Specify explicitely facilities in "Failed .. for". Thanks Dean Gaudet. (closes: #481760) 2008-07-21 10:37:01 -04:00
Yaroslav Halchenko 569c24fe5a Added failregex for "User not known" in sshd.conf. thanks Alexander Gerasiov (closes: #479966) 2008-07-21 10:34:02 -04:00
Yaroslav Halchenko 8cd185ebbb adjusted changelog for 0.8.3-1 2008-07-21 10:29:24 -04:00
Yaroslav Halchenko 122ef9f306 Merge branch 'debian' into build
* debian:
  Boosted policy compliance to 3.8.0 (no changes needed)
2008-07-21 10:25:51 -04:00
Yaroslav Halchenko 8ab68346b1 Boosted policy compliance to 3.8.0 (no changes needed) 2008-07-21 10:25:32 -04:00
Yaroslav Halchenko bf9e991b4a Merge branch 'debian' into build
* debian: (23 commits)
  Imported Upstream version 0.8.3
  - Prepared for 0.8.3.
  Adjusted vcs paths
  - Prepared for 0.8.3
  - Send file if the number of lines is greater or equal and not only equal to the limit.
  - Use poll instead of select in asyncore.loop. This should solve the "Unknown error 514". Thanks to Michael Geiger and Klaus Lehmann.
  - Added missing ignoreregex to filters. Thanks to Klaus Lehmann.
  - Added and changed some logging level and messages.
  - Added svn:keywords.
  - Added ISO 8601 date/time format.
  - Better (correct) fix for ignoreregex in jail.[conf|local].
  - Fixed ignoreregex processing in fail2ban-client. Thanks to René Berber.
  - Added "Day/Month/Year Hour:Minute:Second" date template. Thanks to Dennis Winter.
  - Added svn:keywords.
  - Added gssftpd filter. Thanks to Kevin Zembower.
  - Changed some log level.
  - Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
  - Fixed PID file while started in daemon mode. Thanks to Christian Jobic who submitted a similar patch.
  - Fixed socket path in redhat and suse init script. Thanks to Jim Wight.
  - Create /var/run/fail2ban during install.
  ...

Conflicts:

	ChangeLog
	config/filter.d/gssftpd.conf
	config/filter.d/pam-generic.conf
	debian/changelog
2008-07-21 10:22:06 -04:00
Yaroslav Halchenko 9eb96ab812 Merge branch 'upstream' into debian
* upstream: (22 commits)
  Imported Upstream version 0.8.3
  - Prepared for 0.8.3.
  - Prepared for 0.8.3
  - Send file if the number of lines is greater or equal and not only equal to the limit.
  - Use poll instead of select in asyncore.loop. This should solve the "Unknown error 514". Thanks to Michael Geiger and Klaus Lehmann.
  - Added missing ignoreregex to filters. Thanks to Klaus Lehmann.
  - Added and changed some logging level and messages.
  - Added svn:keywords.
  - Added ISO 8601 date/time format.
  - Better (correct) fix for ignoreregex in jail.[conf|local].
  - Fixed ignoreregex processing in fail2ban-client. Thanks to René Berber.
  - Added "Day/Month/Year Hour:Minute:Second" date template. Thanks to Dennis Winter.
  - Added svn:keywords.
  - Added gssftpd filter. Thanks to Kevin Zembower.
  - Changed some log level.
  - Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
  - Fixed PID file while started in daemon mode. Thanks to Christian Jobic who submitted a similar patch.
  - Fixed socket path in redhat and suse init script. Thanks to Jim Wight.
  - Create /var/run/fail2ban during install.
  - Added "pam-generic" filter and more configuration fixes. Thanks to Yaroslav Halchenko.
  ...
2008-07-21 10:16:49 -04:00
Yaroslav Halchenko 3f62835d63 Merge commit '0_8_3' into upstream
* commit '0_8_3': (21 commits)
  - Prepared for 0.8.3.
  - Prepared for 0.8.3
  - Send file if the number of lines is greater or equal and not only equal to the limit.
  - Use poll instead of select in asyncore.loop. This should solve the "Unknown error 514". Thanks to Michael Geiger and Klaus Lehmann.
  - Added missing ignoreregex to filters. Thanks to Klaus Lehmann.
  - Added and changed some logging level and messages.
  - Added svn:keywords.
  - Added ISO 8601 date/time format.
  - Better (correct) fix for ignoreregex in jail.[conf|local].
  - Fixed ignoreregex processing in fail2ban-client. Thanks to René Berber.
  - Added "Day/Month/Year Hour:Minute:Second" date template. Thanks to Dennis Winter.
  - Added svn:keywords.
  - Added gssftpd filter. Thanks to Kevin Zembower.
  - Changed some log level.
  - Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
  - Fixed PID file while started in daemon mode. Thanks to Christian Jobic who submitted a similar patch.
  - Fixed socket path in redhat and suse init script. Thanks to Jim Wight.
  - Create /var/run/fail2ban during install.
  - Added "pam-generic" filter and more configuration fixes. Thanks to Yaroslav Halchenko.
  - Process failtickets as long as failmanager is not empty.
  ...
2008-07-21 10:16:03 -04:00
Yaroslav Halchenko 68e22af143 Imported Upstream version 0.8.3 2008-07-21 10:13:13 -04:00
Yaroslav Halchenko a779bfc655 Adjusted vcs paths 2008-07-17 11:21:51 -04:00
Yaroslav Halchenko a355adcbb2 Changelog entries for 0.8.2-3 2008-05-06 11:10:39 -04:00
Yaroslav Halchenko db62370cea Merge branch 'debian' into build
* debian:
  BF: Assure that /var/run/fail2ban exists upon start (LP: #222804, #223706)
2008-05-06 10:45:11 -04:00
Yaroslav Halchenko 32281ed1aa BF: Assure that /var/run/fail2ban exists upon start (LP: #222804, #223706) 2008-05-06 10:43:57 -04:00
Yaroslav Halchenko 48c8159de9 - Process failtickets as long as failmanager is not empty.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@676 a942ae1a-1317-0410-a47c-b1dcaea8d605

Conflicts:

	ChangeLog
2008-05-06 10:41:00 -04:00
Yaroslav Halchenko dc3fd2ccb1 - Added "Day/Month/Year Hour:Minute:Second" date template. Thanks to Dennis Winter.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@685 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-05-06 10:39:53 -04:00
Yaroslav Halchenko e52fa4d14d - Added gssftpd filter. Thanks to Kevin Zembower.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@683 a942ae1a-1317-0410-a47c-b1dcaea8d605

Conflicts:

	MANIFEST
2008-05-06 10:39:32 -04:00
Yaroslav Halchenko 678e7f6d76 - Changed some log level.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@682 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-05-06 10:38:02 -04:00
Yaroslav Halchenko 74ba982151 - Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@681 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-05-06 10:37:34 -04:00
Yaroslav Halchenko dc9919aed0 - Fixed PID file while started in daemon mode. Thanks to Christian Jobic who submitted a similar patch.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@680 a942ae1a-1317-0410-a47c-b1dcaea8d605

Conflicts:

	ChangeLog
2008-05-06 10:37:14 -04:00
Yaroslav Halchenko 9db84ab727 releasing 0.8.2-2 2008-04-07 10:27:03 -04:00
Yaroslav Halchenko 154c46cdac Merge branch 'debian' into build
* debian:
  BF: Recommends whois, which is used in some actions (LP: #213227)
2008-04-07 10:25:37 -04:00
Yaroslav Halchenko 8207f166e1 BF: Recommends whois, which is used in some actions (LP: #213227) 2008-04-07 10:24:09 -04:00
Yaroslav Halchenko 98fb72441d BF: now proftpd log msgs include ip mask, failregex adjusted to absorb it as well 2008-03-10 12:52:32 -04:00
Yaroslav Halchenko 66c0610809 Merge branch 'debian' into build
* debian:
  added dirs file to create /var/run/fail2ban
2008-03-05 23:54:56 -05:00
Yaroslav Halchenko ef9148cff4 added dirs file to create /var/run/fail2ban 2008-03-05 23:54:30 -05:00
Yaroslav Halchenko db3567e37f Merge branch 'debian' into build
* debian:
  CHANGELOG -> ChangeLog in rules
2008-03-05 23:32:54 -05:00
Yaroslav Halchenko 36f90e4622 CHANGELOG -> ChangeLog in rules 2008-03-05 23:32:42 -05:00
Yaroslav Halchenko 9122f3aab0 Releasing 0.8.2-1 2008-03-05 23:31:20 -05:00
Yaroslav Halchenko 21a7928c64 Merge branch 'debian' into build
* debian:
  2 new jails: xinetd-fail, apache-overflows added to jails.conf
  minor: adjusted comment for named jails to come closer to upstream
  BF: apache-* jails -- authentication failures are recorded in *error.log files, thus paths were adjusted
2008-03-05 23:30:41 -05:00
Yaroslav Halchenko eede41f62b Changelog entries for 0.8.2-1 2008-03-05 23:30:31 -05:00
Yaroslav Halchenko a88fd271c4 2 new jails: xinetd-fail, apache-overflows added to jails.conf 2008-03-05 23:29:36 -05:00
Yaroslav Halchenko 5d6d07508d minor: adjusted comment for named jails to come closer to upstream 2008-03-05 23:18:04 -05:00
Yaroslav Halchenko 15ce210cd0 BF: apache-* jails -- authentication failures are recorded in *error.log files, thus paths were adjusted 2008-03-05 23:14:22 -05:00
Yaroslav Halchenko e60969830a Revert "From 0.9 branch: Replaced ssocket.py with asyncore/asynchat implementation. Correct fix for bug #1769616"
This reverts commit 84b70995260bbb5a24976fd814c8f16125339c27.

Conflicts:

	server/server.py
2008-03-05 22:43:28 -05:00
Yaroslav Halchenko 9ab6db30c7 Merge branch 'debian' into build
* debian: (56 commits)
  Imported upstream version 0.8.2
  debian/watch: switched to git-import-orig
  - Tag for 0.8.2
  - Updated for 0.8.2
  - Updated e-mail
  - Changed homepage and e-mail
  - Updated copyright.
  - readline is now optional in fail2ban-client (not needed in fail2ban-server).
  - Added svn:keywords
  - Fixed Debian bug #461426
  - Fixed Debian bug #462060
  - Fixed Debian bug #468477
  - Fixed Debian bug #456567
  - Added revision.
  - Added "reload <JAIL>"
  - Replaced "reject" with "drop" in shorwall action. Fix #1854875
  - Replaced "echo" with "printf" in actions. Fix #1839673
  - Catch Exception instead of AttributeError.
  - Absorbed some Debian patches. Thanks to Yaroslav Halchenko.
  - Updated.
  ...

Conflicts:

	config/fail2ban.conf
	config/filter.d/proftpd.conf
	config/filter.d/sshd.conf
	man/fail2ban-client.1
	man/fail2ban-server.1
	server/datestrptime.py
	server/server.py
2008-03-05 22:30:10 -05:00
Yaroslav Halchenko e574f0190e Merge branch 'upstream' into debian
* upstream: (55 commits)
  Imported upstream version 0.8.2
  - Tag for 0.8.2
  - Updated for 0.8.2
  - Updated e-mail
  - Changed homepage and e-mail
  - Updated copyright.
  - readline is now optional in fail2ban-client (not needed in fail2ban-server).
  - Added svn:keywords
  - Fixed Debian bug #461426
  - Fixed Debian bug #462060
  - Fixed Debian bug #468477
  - Fixed Debian bug #456567
  - Added revision.
  - Added "reload <JAIL>"
  - Replaced "reject" with "drop" in shorwall action. Fix #1854875
  - Replaced "echo" with "printf" in actions. Fix #1839673
  - Catch Exception instead of AttributeError.
  - Absorbed some Debian patches. Thanks to Yaroslav Halchenko.
  - Updated.
  - Fixed fail2ban-regex. It support "includes" in configuration files.
  ...
2008-03-05 22:22:05 -05:00
Yaroslav Halchenko 4404ceb9c3 Pseudo-Merge commit '0_8_2' into upstream
* commit '0_8_2': (54 commits)

  - Updated e-mail
  - Changed homepage and e-mail
  - Updated copyright.
  - readline is now optional in fail2ban-client (not needed in fail2ban-server).
  - Added svn:keywords
  - Fixed Debian bug #461426
  - Fixed Debian bug #462060
  - Fixed Debian bug #468477
  - Fixed Debian bug #456567
  - Added revision.
  - Added "reload <JAIL>"
  - Replaced "reject" with "drop" in shorwall action. Fix #1854875
  - Replaced "echo" with "printf" in actions. Fix #1839673
  - Catch Exception instead of AttributeError.
  - Absorbed some Debian patches. Thanks to Yaroslav Halchenko.
  - Updated.
  - Fixed fail2ban-regex. It support "includes" in configuration files.
  - "reload <jail>" reloads a single jail and the parameters in fail2ban.conf.
  ...
2008-03-05 20:29:53 -05:00
Yaroslav Halchenko c38fe3a8e3 Imported upstream version 0.8.2 2008-03-05 20:19:06 -05:00
Yaroslav Halchenko 940d7fa430 debian/watch: switched to git-import-orig 2008-03-05 20:18:50 -05:00
Cyril Jaquier 932a746c04 - Tag for 0.8.2
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/tags/FAIL2BAN-0_8_2@674 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-03-05 23:22:44 +00:00
Yaroslav Halchenko e43ea8e1b3 releasing -5 2008-02-28 19:52:37 -05:00
Yaroslav Halchenko be3bc2bc00 manually "cherry picked" f6639981: Fixed "Feb 29" bug. Thanks to James Andrewartha who pointed this out. Thanks to Yaroslav Halchenko for the fix. 2008-02-28 19:50:08 -05:00
Yaroslav Halchenko 0392274daf added 0.8.1-4 changelog entry. 2008-02-09 22:09:50 -05:00
Yaroslav Halchenko b8d97d0983 Merge branches 'debian', 'deb/specifics', 'up/0.9-0.8', 'up/apache_noscript_extend', 'up/ipmasq', 'up/log_examples', 'up/mail_whois_lines', 'up/named_refused_fixed', 'up/pam_generic', 'up/proftpd_fix+extend', 'up/sshd_refused_connect' and 'up/vsftpd_optional_user' into build
* debian:
  Confirms to policy 3.7.3 (no changes)
  Bye Bye dpatch: now everything is handled in git branches
  removing patches from dpatch system since they are in branches now
  added a  comment to README.Debian and to the list of examples for ipmasq example file
  Fixed == bashism (Closes: #464647). Thanks Raphael Geisser

* deb/specifics:
  slight tune ups in upstream sources destined only for debian are kept in this branch

* up/0.9-0.8:

* up/apache_noscript_extend:
  Extended apache-noscript filter with more file extensions and to react to "script not found or unable to stat" log message (closes: #456565). Thanks Tim Connors

* up/ipmasq:
  Added ipmasq rule file to restart fail2ban when iptables are wiped out (closes: #461417). Thanks Guido Bozzetto

* up/log_examples:
  up/log_examples: moved vsftpd log from up/vsftpd_optional_user
  added examples of log lines (for named-refused, pam-generic, sshd) under files/logs for easy testing

* up/mail_whois_lines:
  mail-whois-lines: moved fix for proper names from dpatch

* up/named_refused_fixed:
  named_refused: moved fix for proper config+filters from dpatch

* up/pam_generic:
  added pam-generic from dpatch

* up/proftpd_fix+extend:
  Fix/extension of proftpd failrexes (Closes: #461412). Thanks Guido Bozzetto

* up/sshd_refused_connect:

* up/vsftpd_optional_user:
  up/vsftpd_optional_user: moving examples into up/examples branch
  BF: vsftp anchoring
2008-02-09 22:02:21 -05:00
Yaroslav Halchenko 9907401483 up/log_examples: moved vsftpd log from up/vsftpd_optional_user 2008-02-08 10:54:46 -05:00
Yaroslav Halchenko 5c5c07fed6 up/vsftpd_optional_user: moving examples into up/examples branch 2008-02-08 10:54:07 -05:00
Yaroslav Halchenko 1da878481f mail-whois-lines: moved fix for proper names from dpatch 2008-02-08 01:33:46 -05:00
Yaroslav Halchenko fc3a57b6c1 Confirms to policy 3.7.3 (no changes) 2008-02-08 01:23:34 -05:00
Yaroslav Halchenko 4b2bd7e776 Bye Bye dpatch: now everything is handled in git branches 2008-02-08 00:52:04 -05:00
Yaroslav Halchenko a832ede291 removing patches from dpatch system since they are in branches now 2008-02-08 00:46:00 -05:00
Yaroslav Halchenko 5f30cb0898 slight tune ups in upstream sources destined only for debian are kept in this branch 2008-02-08 00:40:57 -05:00
Yaroslav Halchenko a9ee3c0b47 named_refused: moved fix for proper config+filters from dpatch 2008-02-08 00:38:02 -05:00
Yaroslav Halchenko 86072e3d55 added pam-generic from dpatch 2008-02-08 00:30:47 -05:00
Yaroslav Halchenko a2090e7283 added examples of log lines (for named-refused, pam-generic, sshd) under files/logs for easy testing 2008-02-08 00:28:31 -05:00
Yaroslav Halchenko 996da9a3f0 added a comment to README.Debian and to the list of examples for ipmasq example file 2008-02-07 23:43:21 -05:00
Yaroslav Halchenko 0da36545d3 Fixed == bashism (Closes: #464647). Thanks Raphael Geisser 2008-02-07 23:43:21 -05:00
Yaroslav Halchenko 2d8df22cf1 Extended apache-noscript filter with more file extensions and to react to "script not found or unable to stat" log message (closes: #456565). Thanks Tim Connors 2008-02-07 23:37:34 -05:00
Yaroslav Halchenko af81bac456 Added ipmasq rule file to restart fail2ban when iptables are wiped out (closes: #461417). Thanks Guido Bozzetto 2008-02-07 23:24:18 -05:00
Yaroslav Halchenko af29b27693 Fix/extension of proftpd failrexes (Closes: #461412). Thanks Guido Bozzetto 2008-02-07 23:00:07 -05:00
Yaroslav Halchenko 33a6a98fea BF: vsftp anchoring
it needed also optional user=, as well as optional (pam_unix) and removed 1 space

also added .examples file for testing
2008-01-04 12:02:23 -05:00
Yaroslav Halchenko 24d8b44c2a * Moved iptables into recommends since fail2ban can work without iptables
using some other action (e.g hosts.deny)
2007-11-23 12:50:39 -05:00
Yaroslav Halchenko fa21222c63 * Moved iptables into recommends since fail2ban can work without iptables
using some other action (e.g hosts.deny)
2007-11-23 12:49:15 -05:00
Yaroslav Halchenko ee25282f34 releasing 0.8.1-3 2007-11-23 11:43:41 -05:00
Yaroslav Halchenko 6b913aafa2 Merge branch 'debian' into build: Vcs fields
Conflicts:

	debian/changelog
2007-11-23 11:10:35 -05:00
Yaroslav Halchenko f8b17f3859 * Added Vcs- fields, moved Homepage into source header's field 2007-11-23 11:09:34 -05:00
Yaroslav Halchenko 4b95233acb Merge branches 'debian' and 'up/sshd_refused_connect' into build: NF: refused connect sshd failregex 2007-11-23 09:02:58 -05:00
Yaroslav Halchenko 46cfc2bbd6 added example for "refused connect" 2007-11-23 09:00:08 -05:00
Yaroslav Halchenko 1f4571ac88 NF: ban tcpwrappers 'refused connect' reported IPs 2007-11-23 08:57:33 -05:00
Yaroslav Halchenko d82257b2f2 Merge branch 'debian' into build: BF: no sftp in ssh jails 2007-11-22 14:34:59 -05:00
Yaroslav Halchenko 1cedd8e02b BF: removed sftp from ssh jails 2007-11-22 14:32:17 -05:00
Yaroslav Halchenko ff7b1897eb Merge branch 'up/0.9-0.8' into build 2007-11-11 01:50:21 -05:00
Yaroslav Halchenko 54e45cb649 needed to add server.communication to list of packages to be installed 2007-11-11 01:49:55 -05:00
Yaroslav Halchenko 4aa9bca7ca Merge branch 'up/0.9-0.8' into build and provided debian/changelog 2007-11-11 01:21:44 -05:00
Yaroslav Halchenko 606a8b3428 From 0.9 branch: Replaced ssocket.py with asyncore/asynchat implementation. Correct fix for bug #1769616 2007-11-11 01:11:04 -05:00
Yaroslav Halchenko 2553e2717a * Added force-start action to init script, so it could be forced
to start if previous run crashed and left a socket file. Must to be
  used with caution.
2007-10-18 22:03:37 -04:00
Yaroslav Halchenko 8d9aca4e20 * Fixed named-refused filter. 2007-10-16 17:02:35 -04:00
Yaroslav Halchenko 99dbe90ad2 releasing 2007-10-16 17:02:35 -04:00
Yaroslav Halchenko 413ec5317e first pre-release version of 0.8.1 2007-10-16 17:02:35 -04:00
Yaroslav Halchenko 0012f9ff92 * (NOT RELEASED YET) New upstream release.
Patches absorbed upstream:
    00_daemon_pids.dpatch
    00_iptables_allports.dpatch
    00_vsftp_filter_spaces.dpatch
    00_resolve_all_names.dpatch
    00_HOST_ignoreregex.dpatch
   Patches which needed some tune-up:
    00_ssh_strong_re.dpatch
    00_mail-whois-lines.dpatch
    00_named_refused.dpatch
2007-10-16 17:02:35 -04:00
Yaroslav Halchenko e10a8616b4 fetched fresh upstream 0.8.1 2007-10-16 17:02:35 -04:00
Yaroslav Halchenko 922b5035ea actually we never released pre-release 2007-10-16 17:02:35 -04:00
Yaroslav Halchenko 7b40dd33d5 Merge commit 'upstream/0.8.1' into tmp/join 2007-10-16 17:02:34 -04:00
Yaroslav Halchenko bce05a1285 Upgraded to fresh upstream 0.8.1 2007-10-16 17:01:23 -04:00
Yaroslav Halchenko 8323a8cac8 Upgraded to fresh upstream 0.8.0 2007-10-16 17:01:22 -04:00
Yaroslav Halchenko b6e07f1f3a Upgraded to fresh upstream 0.7.9 2007-10-16 17:01:22 -04:00
Yaroslav Halchenko d77f67bb89 Upgraded to fresh upstream 0.7.8 2007-10-16 17:01:22 -04:00
Yaroslav Halchenko 018484d985 Upgraded to fresh upstream 0.7.7 2007-10-16 17:01:21 -04:00
Yaroslav Halchenko 93125ae6ac Upgraded to fresh upstream 0.7.6 2007-10-16 17:01:21 -04:00
Yaroslav Halchenko 325366066e Upgraded to fresh upstream 0.7.5 2007-10-16 17:01:20 -04:00
Yaroslav Halchenko a82e3dc1e7 Upgraded to fresh upstream 0.7.4 2007-10-16 17:01:20 -04:00
Yaroslav Halchenko 0ca7bffd7b Upgraded to fresh upstream 0.6.1 2007-10-16 17:01:20 -04:00
Yaroslav Halchenko ad466ecb3c Upgraded to fresh upstream 0.6.0 2007-10-16 17:01:19 -04:00
Yaroslav Halchenko 7f0a3df4a4 Upgraded to fresh upstream 0.5.4 2007-10-16 17:01:19 -04:00
Yaroslav Halchenko bb2cc0b966 Upgraded to fresh upstream 0.5.3 2007-10-16 17:01:19 -04:00
Yaroslav Halchenko 9ad46bb82f Upgraded to fresh upstream 0.5.2 2007-10-16 17:01:18 -04:00
Yaroslav Halchenko 85b75c77fb * Resolve all "names" which became a part of <HOST>. Previousely only fqdn's
were resolved
2007-08-13 21:13:59 +00:00
Yaroslav Halchenko c5202ce696 * Added optional spaces at the end of failregex for vsftpd. 2007-08-06 01:39:30 +00:00
Yaroslav Halchenko 58ae2a5a75 * Added new time template matching named log entries 2007-07-30 02:31:35 +00:00
Yaroslav Halchenko 95d17ee318 * Adjusted failregex for sshd filter:
- anchored properly at the end of line, and source code has .examples
    files to perform testing of the rules.
  - added new explicit rule for users not in the AllowUsers lists
2007-07-29 17:20:23 +00:00
Yaroslav Halchenko 3aef16b773 * jail.conf has specification of protocol (default to tcp) to be provided to
banaction
2007-07-25 03:47:32 +00:00
Yaroslav Halchenko 990bd15dd5 specified default protocol (tcp) and specified udp for jail for named 2007-07-25 03:46:41 +00:00
Yaroslav Halchenko ac7e1696d4 fixed named filter to account for optional (cache) 2007-07-24 20:04:20 +00:00
Yaroslav Halchenko 14d3ffc6de * Added a filter for named to catch refused/denied queries 2007-07-24 18:10:05 +00:00
Yaroslav Halchenko 2a3d710cad adjusted pam_generic patch in example to catch ftp 2007-07-24 17:25:38 +00:00
Yaroslav Halchenko d63bea24f5 tuned pam_generic to catch some weird log lines 2007-07-21 02:29:45 +00:00
Yaroslav Halchenko a843d0da04 tuned pam_generic to catch some weird log lines 2007-07-21 02:27:30 +00:00
Yaroslav Halchenko f58421eabf * Use /var/run to keep socket file (closes: #425746) 2007-07-05 17:12:17 +00:00
Yaroslav Halchenko a9ecd98ffe Added port param in jail since otherwise -- crashes 2007-06-25 17:08:49 +00:00
Yaroslav Halchenko 2e55bc57c7 * Added a filter pam_generic to catch any login errors.
* Added iptables-allports.
2007-06-25 16:51:05 +00:00
Yaroslav Halchenko bc0806d459 * Moved <HOST> expansion into regex.py (closes: #429263). Thanks James
Andrewartha.
* Added optional regexp entry for process PID in some entries (closes:
  #426050). Thanks Roderick Schertler.
2007-06-21 01:47:02 +00:00
Yaroslav Halchenko cc5ec4dcde releasing 2007-05-16 18:14:13 +00:00
Yaroslav Halchenko e55dfeaf3a untabified last entry 2007-05-15 14:37:09 +00:00
Yaroslav Halchenko cc1ed23b40 * Applied changes submitted by Bernd Zeimetz (thanks Bernd):
- Removed obsolete Build-Depends-Indep on help2man, python-dev
	- Explicit removal of *.pyc files compiled during build
	- Invoke 'python setup.py clean' in clean target, which required also
	  to move python into Build-Depends
* Minor clean up of debian/rules
2007-05-15 14:26:28 +00:00
Yaroslav Halchenko be824f4e00 adjusted to be prerelease of the package 2007-05-10 15:35:43 +00:00
Yaroslav Halchenko c58a100259 * Manually changing the order of debhelper inserted scripts in prerm
(Closes: #422655)
* Removed obsolete hack to have /bin/env invocation of python for
  fail2ban-* scripts
2007-05-10 15:34:09 +00:00
Yaroslav Halchenko e9397ea375 * New stable upstream release 2007-05-05 16:35:58 +00:00
Yaroslav Halchenko 10718c1036 initial upgrade to 0.8.0 2007-05-05 16:17:50 +00:00
Yaroslav Halchenko ab18d77f6a pre 0.8.0 release -- I decided to do not do mergeWithUpstream and rather carry full source 2007-05-05 16:14:31 +00:00
Yaroslav Halchenko d15f9d0206 * New upstream release
* Updated copyright to include current year
* Removed patches absorbed upstream
2007-04-20 01:44:43 +00:00
Yaroslav Halchenko 5dcec130f6 adjusted changelog -- releasing finally 2007-03-26 21:53:30 +00:00
Yaroslav Halchenko 7c30a3097b * Applied post-release upstream changes to resolve issues with
- Close opened handlers to log file
 - Fixed "reload" bug
2007-03-26 21:47:10 +00:00
Yaroslav Halchenko dc21820c80 adjusted paths in patches 2007-03-24 22:40:42 +00:00
Yaroslav Halchenko d345865621 * New upstream release
* Applied post-release changes to resolve issues with gamin and not closed
  on reload log file
2007-03-24 22:27:09 +00:00
Yaroslav Halchenko ee3f91176c * New upstream release (included most of the debian-provided patches -- new
filters and actions)
* Refreshed and made verbatim homepage in description
2007-02-09 03:22:15 +00:00
Yaroslav Halchenko a4c15ea883 * NOT RELEASED YET
* Made homepage in description verbatim
2007-02-07 15:25:11 +00:00
Yaroslav Halchenko 936fee7c40 * Use /usr/bin/python interpreter instead of wrapped call to python by
/usr/bin/env
2007-01-19 16:08:10 +00:00
Yaroslav Halchenko 30eb0566bd making it using /usr/bin/python directly 2007-01-19 15:56:21 +00:00
Yaroslav Halchenko f92e887994 minor more changes 2007-01-19 15:53:21 +00:00
Yaroslav Halchenko 878fa0dedd * Synchronized action.d/iptables-* rules from upstream SVN (closes:
#407561)
* Minor: options renames in the comments to be in sync with upstream
2007-01-19 15:51:11 +00:00
Yaroslav Halchenko e3102eb28a had to rename filter for courierauth 2007-01-18 15:52:48 +00:00
Yaroslav Halchenko 7a1dd9e98c * iptables-multiport is default action to take since Debian kernel arrives
with multiport module. That is to address the fact that most services
  listen on multiple port (for encrypted and non-encrypted connections)
* Added [courierauth] jail (First 2 items are to partially address #407404
2007-01-18 15:41:49 +00:00
Yaroslav Halchenko 85d8604209 removed empty lines 2007-01-04 20:34:41 +00:00
Yaroslav Halchenko 36b1833e31 * Adjusted default log file for postfix to be /var/log/mail.log
(Closes: #404921)
2007-01-04 20:25:45 +00:00
Yaroslav Halchenko acfebf3475 adjusted multiport section as promised in changelog 2007-01-04 20:19:58 +00:00
Yaroslav Halchenko e570f14a5d releasing 2007-01-04 19:48:58 +00:00
Yaroslav Halchenko f01c74581d fixed action_ shortcuts
adjusted initd script to be verbose on start if socketfile exists
2007-01-04 19:47:00 +00:00
Yaroslav Halchenko 7fa686a7f2 * New upstream release, which incorporates fixes introduced in 3~pre
non-released versions (which were suggested to the users to overcome
  problems reported in bug reports). In particular attention should be paid
  to upstream changelog entries

  - Several "failregex" and "ignoreregex" are now accepted.
    Creation of rules should be easier now.
  
    This is an alternative solution to 'multiple <HOST>' entries fix,
    which is not applied to this shipped version - pay cautios if upgrading
    from 0.7.5-3~pre?
 
  - Allow comma in action options. The value of the option must
    be escaped with " or '. 
    That allowed to implement requested ability to ban multiple ports
    at once (See 373592). README.Debian and jail.conf adjusted to reflect
    possible use of iptables-mport
  - Now Fail2ban goes in /usr/share/fail2ban instead of
    /usr/lib/fail2ban. This is more compliant with FHS.
    Patch 00_share_insteadof_lib no longer applied
* Refactored installed by debian package jail.conf:
  - Added option banaction which is to incorporate banning agent
    (usually some flavor of iptables rule), which can then be easily
    overriden globally or per section
  
  - Multiple actions are defined as action_* to serve as shortcuts
2007-01-04 18:08:09 +00:00
Yaroslav Halchenko e8ce484c05 reworked init script a bit: waiting on stop and ping instead of status 2007-01-04 17:03:35 +00:00
Yaroslav Halchenko a81dd8b103 boosted version 2007-01-03 16:09:43 +00:00
Yaroslav Halchenko 97ab74de5f * Not applying patch any more for rigid python2.4 - it is default now in
sid/etch
2007-01-03 16:09:01 +00:00
Yaroslav Halchenko 4d5ec804f5 * Added filter ssh-ddos to fight DDOS attacks. Must be used with caution if
there is a possibility of clients accessing through unreliable connection 
  (Closes: #404487)
2006-12-28 07:28:53 +00:00
Yaroslav Halchenko 832a8a4346 * Moved call to dh_pycentral before dh_installinit
* Removed unnecessary call of dh_shlibdeps
2006-12-22 18:56:51 +00:00
Yaroslav Halchenko ebc5c6106f HOSTisized vsftpd regex 2006-12-22 18:39:57 +00:00
Yaroslav Halchenko caf85bf265 * Made fail2ban-server tollerate multiple <HOST> entries in failregex 2006-12-22 18:36:01 +00:00
Yaroslav Halchenko ae96eaa40c made failregex universal for both PAM and native vsftpd logging 2006-12-22 04:54:14 +00:00
Yaroslav Halchenko 2e992c2353 * Fail2ban now bans vsftpd logins (corrected logfile path and failregex)
(Closes: #404060)
2006-12-21 16:54:39 +00:00
Yaroslav Halchenko 14a2a45dbc releasing 2006-12-10 23:56:17 +00:00
Yaroslav Halchenko 762d1a188a * NEWS.Debian confusions - the latest NEWS entry and postinst message were
rephrased (Closes: #402350)
* Added mail-whois-lines action, which emails log lines containing abuser
  IP. Those lines are often required for proper abuse reports sent to the
  Internet providers.  Forwarding of such received emails to the email
  addresses of abuse departments present in the output of whois is a
  tentative solution for semi-automatic abuse reporting (Closes: #358810)
2006-12-10 23:40:04 +00:00
Yaroslav Halchenko bbb9e6f094 * NEWS.Debian confusions - the latest NEWS entry and postinst message
were rephrased (Closes: #402350)
2006-12-09 23:27:39 +00:00
Yaroslav Halchenko ae58ed091a * Removed obsolete patches left from 0.6
* Adjusted wsftpd patch to use <HOST> tag to be in line with the other
  filter definitions
2006-12-08 02:28:07 +00:00
Yaroslav Halchenko 1755dc2b0a updated the patch to the most recent release 2006-12-08 02:12:22 +00:00
Yaroslav Halchenko 7eac83b12d fresh upstream release 2006-12-08 01:21:42 +00:00
Yaroslav Halchenko 6d3c52a965 slightly corrected description for interpolations/parameters 2006-12-07 23:10:30 +00:00
Yaroslav Halchenko c46b9e0dca * README.Debian describes a bit issue of interpolations vs parameters passed
from jail.{conf,local} into an action or a filter definition (closes:
  #398739)
* Removed Uploaded field from control since I am a DD now. Big thanks to
  Barak Pearlmutter for being the sponsor of my packages for few
  years.
2006-12-07 13:20:51 +00:00
Yaroslav Halchenko 3a738497f8 * Added Suggests on mailx and relevant comments in README.Debian about
invoking mail actions (closes: #396668)
* Removed obsolete entries in TODO and README
* README.Debian describes a bit issue of interpolations vs parameters
  passed from jail.{conf,local} into an action or a filter definition
  (closes: #398739)
* Initial version of postfix filter (closes: #377711)
2006-12-07 04:07:59 +00:00
Yaroslav Halchenko ff491e48fa * Added debian/backports to contain patches necessary for backporting. It
gets used by pbuilder-ssh to create package for backports.org
2006-12-04 13:56:56 +00:00
Yaroslav Halchenko e46346d371 fixed name spoiled by on vaio 2006-11-12 02:20:32 +00:00
Yaroslav Halchenko 953f6c75b9 ready to buzz Barak 2006-11-12 02:18:47 +00:00
Yaroslav Halchenko b9b30341d4 * Cleaned up debian/rules a bit 2006-11-12 02:11:34 +00:00
Yaroslav Halchenko f8a3605c97 * "Clean" target removes generated .pyc files now (Closes: #398146) 2006-11-12 02:02:23 +00:00
Yaroslav Halchenko 97abba906f forgot to boost version 2006-11-11 00:11:59 +00:00
Yaroslav Halchenko 24ada3c63e * Only block new connects by using a new action iptables-new instead of
iptables (Closes: #350746)
* Updated README.Debian to reflect transition over to 0.7 branch and to
  comment on 350746
2006-11-11 00:10:10 +00:00
Yaroslav Halchenko 5cc9bc9ce6 made ~ version to accumulate more fixes before duploading 2006-11-10 15:56:58 +00:00
Yaroslav Halchenko 6a9ed3501a * Reincarnated logrotate configuration (Closes: #397878)
* no logrotation anymore? (Closes: #397878)
2006-11-10 15:54:34 +00:00
Yaroslav Halchenko f92a885d43 copied logrotate from 0.6 branch 2006-11-10 14:59:19 +00:00
Yaroslav Halchenko f4015e0c3c forgotten fi 2006-11-06 14:49:40 +00:00
Yaroslav Halchenko 28dad3752c * Warning NEWS entry for 0.7.1 was not shown during installation on test
boxes, thus postinst was adjusted accordingly to inform the user about the
  changes in the configuration files since 0.6.
2006-11-06 14:47:59 +00:00
Yaroslav Halchenko 6e1ec60318 put release to unstable 2006-11-06 14:29:56 +00:00
Yaroslav Halchenko b457f61e74 * Added reload/force-reload actions to init script
* Adjusted jail.conf a bit
2006-11-06 14:23:58 +00:00
Yaroslav Halchenko 2e568c08d6 new upstream 2006-11-02 02:04:57 +00:00
Yaroslav Halchenko 4bbea5b41b * Corrected init.d script to properly perform restart due to server delay to
react to client command to stop. Handling of status was adjusted as well
* Added apache-noscript to jail.conf
* Default action does not send emails to be inline with previous (0.6.x)
  behavior
2006-10-30 03:32:29 +00:00
Yaroslav Halchenko 668ef068cf * Fresh upstream: fixed a bug with not handling error producing
actioncheck call
2006-10-23 21:05:32 +00:00
Yaroslav Halchenko 1e4d6dd059 * debian/{rules,control} adjusted to conform all points in recent python
policy changes
* install under /usr/share instead of /usr/lib
2006-10-23 05:07:52 +00:00
Yaroslav Halchenko 6a2aaa4db7 * Adjusted rule to install man pages -- only .1 files since there are also
h2m sources
2006-10-23 04:49:52 +00:00
Yaroslav Halchenko 37d2abc8ea * Currrent snapshot of trunk
* Removed outdated (applied in 0.7.4 or specific for 0.6.?) patches
  from debian/patches
2006-10-23 04:45:34 +00:00
Yaroslav Halchenko 923d2214d9 added wuftpd to both 0.6 and 0.7 2006-10-18 05:15:53 +00:00
Yaroslav Halchenko 4ea2d8c370 few changelog entries 2006-10-02 19:28:23 +00:00
Yaroslav Halchenko 9851383362 fixed status command. now rely on presence of socket to be a bit more verbose 2006-10-02 19:27:30 +00:00
Yaroslav Halchenko a45fadd183 News about the 0.7 release and adjusted init script so it fails to start if not root 2006-10-02 19:03:58 +00:00
Yaroslav Halchenko 8d3b4630f3 changed section names - removed -iptables. adjusted description 2006-09-29 13:22:23 +00:00
Yaroslav Halchenko 571c3d8c92 added suggests to python-gamin 2006-09-29 04:27:46 +00:00
Yaroslav Halchenko cd46343d11 added few sections (patches + adjusted jail.conf shipped with Debian) 2006-09-29 04:21:16 +00:00
Yaroslav Halchenko 641cd14a40 preliminary packaging of 0.7.3 which gets closer to be used widely, i.e.
could be uploaded to experimental
2006-09-29 04:05:50 +00:00
Yaroslav Halchenko 0ae3032ac8 properly assigned to experimental 2006-09-06 13:35:13 +00:00
Yaroslav Halchenko 4ba8572d7f adjusted the bantime to be 10min not 10sec 2006-09-05 15:26:37 +00:00
Yaroslav Halchenko dae225330c added debian specific patches for the new upstream 2006-09-05 15:16:03 +00:00
Yaroslav Halchenko a4899fabf8 Initial minimalistic but working packaging of fail2ban 0.7.1 2006-09-05 06:10:29 +00:00
Yaroslav Halchenko a2717f7c25 getting ready to dpatch-clean upgrade to the most recent upstream 0.7.1 2006-09-05 04:18:02 +00:00
Yaroslav Halchenko d125070fa4 now changes in this file are managed via dpatch 2006-08-15 22:13:44 +00:00
Yaroslav Halchenko 1c455a29a9 now changes in this file are managed via dpatch 2006-08-15 22:12:48 +00:00
Yaroslav Halchenko 6e050675a8 adjusted manpage for fail2ban.conf 2006-08-15 21:35:37 +00:00
Yaroslav Halchenko f85af540cf updated timestamp 2006-07-07 00:20:22 +00:00
Yaroslav Halchenko 7fbc1b16a0 adjusted to comply with recent changed of debian python policy 2006-07-06 21:30:53 +00:00
Yaroslav Halchenko ed6a45f1a6 added verbosity patch from one of my branches. fixed stupid indents 2006-07-04 03:40:14 +00:00
Yaroslav Halchenko 1f3e33e384 added verbosity patch from one of my branches 2006-07-04 03:36:39 +00:00
Yaroslav Halchenko f7064d36c5 fixed empty ip and somewhat fixed locale issue 2006-07-04 03:03:45 +00:00
Yaroslav Halchenko 4309a11968 rm options adjusted, README.Debian to fix 373592 2006-06-14 16:22:43 +00:00
Yaroslav Halchenko 7b93d4ded5 section for saslauthd 2006-05-30 14:19:08 +00:00
Yaroslav Halchenko 2f930dfa76 now apache2 bug gets closed 2006-05-28 03:32:24 +00:00
Yaroslav Halchenko fc9b8a887f added proftpd section, adjusted vsftpd patch to dont interfer. boosted debian revision 2006-05-28 03:13:56 +00:00
Yaroslav Halchenko 1fbcf9a9a5 removed bashism from init.d script 2006-05-22 19:38:51 +00:00
Yaroslav Halchenko 537399dbc9 placed binary-arch target back to comply with the policy 2006-05-16 20:46:27 +00:00
Yaroslav Halchenko ac9362ae5b fixed binary-indep binary-arch separation 2006-05-16 20:28:31 +00:00
Yaroslav Halchenko e801352c78 removed compilation of *.pyc 2006-05-16 20:11:05 +00:00
Yaroslav Halchenko 302c1b1c4b debhelper and dpatch belong to Build-Depends now 2006-05-16 20:08:32 +00:00
Yaroslav Halchenko 87ed38b378 debhelper and dpatch belong to Build-Depends now 2006-05-16 20:07:37 +00:00
Yaroslav Halchenko 9af3da8b57 small clean up 2006-05-16 19:59:38 +00:00
Yaroslav Halchenko 589fb2a217 migrated to using dpatch. fixed vsftpd regexp 2006-05-10 18:01:06 +00:00
Yaroslav Halchenko 0c9aef1b0a added lsb-base in depends for init.d script 2006-04-28 04:42:55 +00:00
Yaroslav Halchenko b4e4bcbce8 merged with proposed init.d script from Aaron
tiny fix - syslog
2006-04-28 04:19:19 +00:00
Yaroslav Halchenko 4fa38338d7 merged with proposed init.d script from Aaron 2006-04-28 04:13:23 +00:00
Yaroslav Halchenko c35d7d7bb5 merged with proposed init.d script from Aaron 2006-04-28 04:11:48 +00:00
Yaroslav Halchenko a3badc1fff small adjustments in copyright and watch 2006-04-25 19:58:36 +00:00
Yaroslav Halchenko 8123a4886a modified maxreinits 2006-03-27 17:56:38 +00:00
Yaroslav Halchenko 5425d6b96a fixed copyright file 2006-03-27 04:40:56 +00:00
Yaroslav Halchenko 73074157ac proper version for Barak 2006-03-20 00:41:27 +00:00
Yaroslav Halchenko 49bf5a991b added fwchain 2006-03-19 23:45:52 +00:00
Yaroslav Halchenko e95c62e68e added debug parameter back 2006-03-19 05:35:38 +00:00
Yaroslav Halchenko f771a9be28 added examples 2006-03-19 05:32:10 +00:00
Yaroslav Halchenko 435f870b13 minor modifications: examples, proper conf file copying 2006-03-19 05:27:42 +00:00
Yaroslav Halchenko 4fa0eba064 merged with upstream release 0.6.1 2006-03-19 05:20:44 +00:00
Yaroslav Halchenko 49e8d86983 finalized at -8 revision -- now will upgrade to 0.6.1 upstream 2006-03-17 00:38:23 +00:00
Yaroslav Halchenko bfcdf41276 tiny fix to avoid duplicate code 2006-03-13 06:14:27 +00:00
Yaroslav Halchenko 193a98c97a rearranging, cleaning up2 2006-03-11 06:02:46 +00:00
Yaroslav Halchenko 7693ede193 rearranging, cleaning up 2006-03-11 06:02:22 +00:00
Yaroslav Halchenko 899c6d54df fixed a typo in failregex for SSH 2006-03-09 20:23:46 +00:00
Yaroslav Halchenko 0321fd4689 added postrm script to clean up the log files 2006-03-05 19:51:01 +00:00
Yaroslav Halchenko b3dd9fd5ab For capitalized nasty log entries of sshd 2006-03-03 21:37:05 +00:00
Yaroslav Halchenko 046f219eaf adjusted 2006-03-03 21:14:34 +00:00
Yaroslav Halchenko f8eaf92733 added Uploaders field with Barak 2006-02-27 01:12:55 +00:00
Yaroslav Halchenko f22d4912c2 Fixed Apache section to point at error.log 2006-02-26 01:04:17 +00:00
Yaroslav Halchenko 5ca08578af ready for Barak"s upload 2006-02-18 01:43:00 +00:00
Yaroslav Halchenko 73f0ed8976 changed ownership of all existing logs 2006-02-16 16:23:05 +00:00
Yaroslav Halchenko 165354d87c spell 2006-02-16 16:19:58 +00:00
Yaroslav Halchenko b00161f7ec fixed #352053 2006-02-16 15:53:38 +00:00
Yaroslav Halchenko 438e4edfd8 moved dh_python into binary-indep, added another regex for attacks 2006-02-16 15:43:35 +00:00
Yaroslav Halchenko d8c1587130 added NEWS 2006-02-10 18:08:22 +00:00
Yaroslav Halchenko eb4047f85c fixed timeregex for apache 2006-02-10 18:08:01 +00:00
Yaroslav Halchenko 38fa465cae less failures required for Attacks 2006-01-25 15:32:50 +00:00
Yaroslav Halchenko 9cf01b2dac relaxed regex for awstat.pl a bit 2006-01-25 15:12:44 +00:00
Yaroslav Halchenko 27b0bdfd22 added awstats.pl capturer 2006-01-25 14:58:52 +00:00
Yaroslav Halchenko 55d7440fe1 decided to use "interpolations" in the config file to make it more readable 2006-01-15 20:18:39 +00:00
Yaroslav Halchenko a0dfb0f9e6 minor - removed default private networks from safe list 2006-01-15 20:07:07 +00:00
Yaroslav Halchenko 7d9c08bc22 fix for bug #343821: path is not appended but inserted first 2005-12-19 15:50:01 +00:00
Yaroslav Halchenko 687c2775ad removed slipped through fingers double block 2005-11-21 02:58:10 +00:00
Yaroslav Halchenko 1d6d67f95f minor notes 2005-11-21 02:50:08 +00:00
Yaroslav Halchenko 542939e7c7 minor adjustment 2005-11-21 01:48:57 +00:00
Yaroslav Halchenko bd3d510f96 merged with upstream 0.6.0 2005-11-21 01:43:13 +00:00
Yaroslav Halchenko 3e2a09cdf7 fixes race condition bug #339133 2005-11-20 19:53:37 +00:00
Yaroslav Halchenko 8ce3c2c19e fixed init.d script so it doesn"t fail on stop action if fail2ban is not running 2005-11-03 22:18:40 +00:00
Yaroslav Halchenko 6efa9597c9 fixed changelog back to normal... damn -svn-tag-only 2005-10-31 22:08:56 +00:00
Yaroslav Halchenko 909f05351e added localtime config option to MAIL 2005-10-31 22:04:11 +00:00
Yaroslav Halchenko 1e0cb0326e decided to swith to proper debian versioning 2005-10-21 01:22:59 +00:00
Yaroslav Halchenko a1509ae1e4 init.d script fixed 2005-10-21 01:20:17 +00:00
Yaroslav Halchenko f322d7205a Trying to fix it up a bit 2005-10-20 17:46:13 +00:00
Yaroslav Halchenko 4206c543a3 Trying to fix it up a bit 2005-10-20 17:46:00 +00:00
Yaroslav Halchenko a40245010f * Fixed typos (thanx to Ross Boylan).
* Robust startup: if iptables module gets fully initialized after
    startup of fail2ban, fail2ban will do "maxreinit" attempts to
    initialize its own firewall. It will sleep between attempts for
    "polltime" number of seconds (closes: #334272).
  * To overcome possible conflict with other firewall solutions and as a
    secondary solution for the bug 334272, fail2ban startup is moved
    during bootup to the latest (S99) sequenece position. That should not
    cause any discomfort I believe.
2005-10-20 17:33:53 +00:00
Yaroslav Halchenko 51d453a3d2 fixed issue with crashing on wrong log file
added a cleanup of firewall on emergency exit
2005-10-16 15:07:47 +00:00
Yaroslav Halchenko e9792f95f6 fixed enabledsections to handle MAIL properly 2005-10-15 16:12:45 +00:00
Yaroslav Halchenko d4ee4645ec added -e (enabledsections) command line parameter 2005-10-15 05:47:35 +00:00
Yaroslav Halchenko ac5242815f fixed an issue with command line parameters 2005-10-15 05:14:56 +00:00
Yaroslav Halchenko f2136c09d5 fixing the issue with disregarding command line parameters 2005-10-14 21:27:19 +00:00
Yaroslav Halchenko 93dbf609fa fix #2 to Cyril and mine fixes:
I had to bring ExternalError exception into Firewall because of the loop in flushBanList.
 Also provided naming of Firewalls
2005-10-14 16:30:20 +00:00
Yaroslav Halchenko 14fbb34e51 fixed introduced by me problem - we should wrap each call 2005-10-14 16:09:13 +00:00
Yaroslav Halchenko f3da148d0f fix #1 for Cyrils adjustments 2005-10-14 15:51:04 +00:00
Yaroslav Halchenko 91df9c7526 applied Cyril"s modifications to my patch for missing chain 2005-10-14 14:59:47 +00:00
Yaroslav Halchenko 501955f36a adjusted README: removed part about missing chain because the issue is
resolved by now
Also postinst announces about necessity to upgrade the config file
2005-10-12 17:21:45 +00:00
Yaroslav Halchenko a9efdf16ea should be close to proper debian release now 2005-10-12 15:09:54 +00:00
Yaroslav Halchenko 9c639040bc refined it to work nicely with current approach to handle externally modified iptables 2005-10-12 15:08:05 +00:00
Yaroslav Halchenko da0bb74180 remade handling of missing chains or other errors from IPTables 2005-10-12 14:16:52 +00:00
Yaroslav Halchenko 03e7d722de uff - nasty refactoring to make fail2ban loop if there is some error occur 2005-10-12 05:11:16 +00:00
Yaroslav Halchenko d7dc8f35d1 wrapped with exception handling to avoid crash during pidlock remove -adjusted changelog 2005-10-12 02:13:56 +00:00
Yaroslav Halchenko ee0ce118a9 wrapped with exception handling to avoid crash during pidlock remove 2005-10-12 01:43:55 +00:00
Yaroslav Halchenko d922899bba Illegal -> Invalid 2005-10-10 15:57:35 +00:00
Yaroslav Halchenko 5590dabfd3 uff -- one more adjustement 2005-10-09 20:37:26 +00:00
Yaroslav Halchenko 94ac381122 uff -- one more adjustement 2005-10-09 20:36:45 +00:00
Yaroslav Halchenko b5c8d0aeeb ajusted failregex a bit 2005-10-09 20:00:38 +00:00
Yaroslav Halchenko 9a374592e7 adjusted failregex for SSH 2005-10-09 17:12:46 +00:00
Yaroslav Halchenko 782dabdc7e mangled version a bit... now it conflicts with NMU but... 2005-10-04 06:49:32 +00:00
Yaroslav Halchenko 9e5ca7e048 fixed address to avoid lintian complains 2005-10-04 06:43:32 +00:00
Yaroslav Halchenko 555d12ece4 added a notification regarding configuration file 2005-10-04 06:36:09 +00:00
Yaroslav Halchenko 3d00eec62c removed pre1 2005-10-03 14:48:11 +00:00
Yaroslav Halchenko 0482957f9c fixed security bug #330827 2005-10-01 06:53:51 +00:00
Yaroslav Halchenko 83c201992d added reporting of the enabled sections: unified more with the rest :-/ 2005-09-29 15:44:07 +00:00
Yaroslav Halchenko 897018932b added reporting of the enabled sections: unified it a bit with the rest 2005-09-29 15:41:02 +00:00
Yaroslav Halchenko b046e73bef added reporting of the enabled sections 2005-09-29 15:35:56 +00:00
Yaroslav Halchenko a1d7835cb6 adjusted to have proper description / actions for debug option 2005-09-29 05:26:18 +00:00
Yaroslav Halchenko 802dbea036 fixed Debian bugs 329722, 330311 2005-09-27 15:45:26 +00:00
Yaroslav Halchenko 207b3f712e added export to PATH, removed -b 2005-09-21 12:19:22 +00:00
Yaroslav Halchenko b54377be2c merged with upstream 2005-09-20 16:37:44 +00:00
Yaroslav Halchenko 018e4a115d decided to tag before getting fresh upstream 2005-09-20 16:17:39 +00:00
Cyril Jaquier 1c3f233475 - Updated for 0.5.4
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@201 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-13 20:43:00 +00:00
Cyril Jaquier c07015129b - Formatting
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@200 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-13 20:42:33 +00:00
Cyril Jaquier 3ca5a75094 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@199 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-12 14:44:07 +00:00
Cyril Jaquier cfa8d0a7fe - Updated to CVS version
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@198 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-12 14:43:51 +00:00
Cyril Jaquier 0d4302c912 - Fixed bug #1286222
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@197 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-12 14:42:08 +00:00
Cyril Jaquier 11d887c603 - Formatting
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@196 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-12 14:41:40 +00:00
Yaroslav Halchenko f0e4ef017c fresh changes I forgotten to submit :-/ 2005-09-11 19:22:54 +00:00
Yaroslav Halchenko 12ddba6cf2 fresh changes I forgotten to submit :-/ 2005-09-11 19:22:32 +00:00
Yaroslav Halchenko eb11caa621 Propagated patches introduced by Debian maintainer
* Fixed handling of SYSLOG logging target. Now it can log
    to any SYSLOG target and facility as directed by the
    config
  * Format of SYSLOG entries fixed to look closer to standard
  * Fixed errata in config/gentoo-confd
  * Introduced findtime configuration variable to control the
    lifetime of caught "failed" log entries


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@195 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-11 15:42:32 +00:00
Yaroslav Halchenko b25140b40c fixed changelog 2005-09-09 21:16:14 +00:00
Yaroslav Halchenko 66c8660494 merged with upstream. Need to propagate 'Debian' patches into upstream as soon as possible because they lead to conflicts on upgrades 2005-09-09 21:15:41 +00:00
Yaroslav Halchenko e32a92e7c9 adjusted watch for uscan 2005-09-09 19:17:25 +00:00
Yaroslav Halchenko 0415da9229 see changelog 2005-09-09 18:57:53 +00:00
Cyril Jaquier 10c0307ad5 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@193 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-08 18:21:04 +00:00
Cyril Jaquier d0c70e1535 - Updated for 0.5.3
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@191 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-08 18:20:51 +00:00
Cyril Jaquier 830ac2001e - Added more debug output if an error occurs when sending mail. Thanks to Stephen Gildea
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@190 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-08 18:05:59 +00:00
Cyril Jaquier c1a86f9e18 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@189 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-05 21:12:32 +00:00
Cyril Jaquier c573432e74 - Fixed a bug when overriding "maxfailures" or "bantime". Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@188 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-05 21:12:08 +00:00
Cyril Jaquier 54f4a7d240 - Hopefully fixed bug #1256075
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@187 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-05 21:06:15 +00:00
Cyril Jaquier cdc7b4b048 - Renamed "maxretry" to "maxfailures" and changed default value to 5. Thanks to Stephen Gildea
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@186 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-09-05 21:05:00 +00:00
Yaroslav Halchenko ea7f23e534 corrected for proper format of SYSLOG entries 2005-08-19 10:34:03 +00:00
Yaroslav Halchenko 21ed0e04e0 proper cleaning 2005-08-19 08:56:12 +00:00
Yaroslav Halchenko 3ca4b1f0df minor bug introduced while modifying handling of per section configs 2005-08-19 08:45:42 +00:00
Yaroslav Halchenko 79d9c5fdba minor bug 2005-08-19 08:41:52 +00:00
Yaroslav Halchenko 22e3fd1708 added findtime configuration parameter 2005-08-19 08:40:09 +00:00
Yaroslav Halchenko 1acb0f2648 fixed man pages - cross referenced them, placed fail2ban into section 8
added upstream README and TODO, patched with SYSLOG (160:166)
2005-08-19 07:14:17 +00:00
Yaroslav Halchenko 61f10ac4cb fixed man pages - cross referenced them, placed fail2ban into section 8
added upstream README and TODO
2005-08-18 23:40:49 +00:00
Cyril Jaquier 631f2ac352 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@185 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-17 19:34:00 +00:00
Cyril Jaquier c5c90b182a - Fixed bug #1262345
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@184 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-17 19:26:49 +00:00
Cyril Jaquier daf35a3535 - Added a warning message if IP address is not valid in ignoreip
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@183 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-17 19:26:14 +00:00
Yaroslav Halchenko d8d79656f5 fixed errata... closes #323451 2005-08-16 21:30:27 +00:00
Yaroslav Halchenko e099536945 adjusted changelog 2005-08-13 08:55:08 +00:00
Yaroslav Halchenko e5e22cf50d Adjusted description and added logrotate config 2005-08-13 08:31:19 +00:00
Cyril Jaquier 8a1241533f - Removed warning when using "-V" or "-h" with no config file. Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@182 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-07 13:12:15 +00:00
Cyril Jaquier ed46bcdaf2 - Removed "It needs log4py" from description
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@181 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-07 13:10:39 +00:00
Cyril Jaquier 38f2c24be1 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@180 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-07 13:10:00 +00:00
Cyril Jaquier dd27cafee3 - Added better handling of exception
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@179 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-07 13:08:18 +00:00
Cyril Jaquier b3a90d7492 - Changed mask to 16
- Removed "-i eth0". Match all interfaces


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@178 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-07 13:06:56 +00:00
Yaroslav Halchenko 1ae50b123d uff... pid file is now removed by fail2ban itself... so for it to don't choke - I removed rm -f from init script 2005-08-06 22:30:00 +00:00
Yaroslav Halchenko 46d43bb128 lib->share 2005-08-06 22:18:28 +00:00
Yaroslav Halchenko fe6d07eae5 moved -v --help options to be acted before config file is read 2005-08-06 21:51:51 +00:00
Yaroslav Halchenko 87a6c5a069 fixed a bug which came during conflict resolution /usr/share insteadh of /usr/lib 2005-08-06 19:52:21 +00:00
Yaroslav Halchenko e46b5f6665 New upstream release, removed log4py, fresh man file for conf 2005-08-06 19:43:43 +00:00
Cyril Jaquier d2f3d1c263 - Fixed a bug with "-k"
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@177 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-06 18:44:06 +00:00
Cyril Jaquier 9548edaff0 - Do not exit on exception. Continue and wait for an unhandled exception
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@176 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-06 18:43:11 +00:00
Cyril Jaquier 7e0e005e24 - Prepared for 0.5.2
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@174 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-06 15:07:11 +00:00
Cyril Jaquier 800115a422 - Fixed a bug in logging level
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@173 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 21:03:49 +00:00
Cyril Jaquier a8f98be252 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@172 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 21:01:12 +00:00
Cyril Jaquier e93c0db20b - Added new PID lock file management
- Fixed a bug with daemon mode and logging


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@171 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 20:52:13 +00:00
Cyril Jaquier 1fcf7612fd - Added new PID lock file management
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@170 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 20:51:14 +00:00
Cyril Jaquier 9761d31f4b - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@169 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 20:49:00 +00:00
Cyril Jaquier 4d0c5f6341 - Added a PID lock file class
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@168 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-04 20:48:30 +00:00
Cyril Jaquier d0a0088894 - Redirect stdout to /dev/null
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@167 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:58:14 +00:00
Cyril Jaquier e8b4d66c54 - Removed log4py dependency
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@166 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:41:33 +00:00
Cyril Jaquier 5a38a2563c - Removed log4py dependency
- Catch the unhandled exceptions


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@165 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:40:46 +00:00
Cyril Jaquier c2d30a29de - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@164 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:39:11 +00:00
Cyril Jaquier 8688acab65 - Removed log4py dependency
- Better handling of the return value of os.system()


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@163 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:38:07 +00:00
Cyril Jaquier 4d9c24adbf - Removed log4py dependency
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@162 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:35:18 +00:00
Cyril Jaquier bed25265d7 - Added man pages
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@161 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-08-01 16:33:56 +00:00
Yaroslav Halchenko e965ab1504 fixed description as ftpmaster required + fixed dependency on python-dev 2005-07-31 01:25:17 +00:00
Cyril Jaquier a081e8b3f5 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@160 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:59:28 +00:00
Cyril Jaquier bebba84f0e - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@159 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:31:00 +00:00
Cyril Jaquier e40dd99727 - Added description
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@158 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:30:34 +00:00
Cyril Jaquier 84042dbd31 - "maxretry" and "bantime" can be overridden in each section
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@157 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:29:45 +00:00
Cyril Jaquier 45426598dd - "maxretry" and "bantime" can be overridden in each section
- Fixed bug #1246278 (excessive memory usage)


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@156 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:27:26 +00:00
Cyril Jaquier 8686151421 - Fixed crash on wrong option value in configuration file
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@155 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:20:13 +00:00
Cyril Jaquier 46a4f1fcf3 - Changed custom chains to lowercase
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@154 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-28 20:18:59 +00:00
Yaroslav Halchenko bc7318245b Fixed a bug: conf file wasn't copied as of revision 73 2005-07-26 21:27:19 +00:00
Yaroslav Halchenko d62486656e tiny one - forgotten to remove conf script installation from top Makefile 2005-07-23 19:47:18 +00:00
Yaroslav Halchenko a96ec80625 tiny one - forgotten to remove conf script installation from top Makefile 2005-07-23 19:46:19 +00:00
Yaroslav Halchenko 35c7616cc0 * down cased the name of the chain so it doesn't appear first in iptables -L 2005-07-23 19:44:01 +00:00
Yaroslav Halchenko ff32f0ec9a * because upstream includes debian-init file I decided to just copy it during installation into debian
* adjusted Makefile/rules to handle /etc/default/fail2ban correctly
2005-07-23 19:30:44 +00:00
Yaroslav Halchenko 120a1d9fbc * Merged with upstream
* Changed debian/watch to run svn-upgrade
2005-07-23 19:15:22 +00:00
Yaroslav Halchenko c3909b8ec4 fixed watch file 2005-07-23 18:46:16 +00:00
Cyril Jaquier d6e7bc7b03 - Prepared for 0.5.1
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@152 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-23 09:31:12 +00:00
Cyril Jaquier 891b8d9e8a - Fixed a bug in the previous... bug fix
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@151 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-23 09:07:53 +00:00
Cyril Jaquier 02386131e9 - Fixed bug #1239557
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@150 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-22 21:13:19 +00:00
Cyril Jaquier a3f30d8555 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@149 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-22 21:12:14 +00:00
Cyril Jaquier ec299bd60f - Better check of IPv4 validity
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@148 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-22 21:11:42 +00:00
Cyril Jaquier bbfc65f569 - Fixed bug #1241756
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@147 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-22 21:10:29 +00:00
Yaroslav Halchenko ddc2d0f708 to please Linda and common sense or to be fair - Debian policy, we install .py files into /usr/share, not to /usr/lib 2005-07-17 03:38:51 +00:00
Yaroslav Halchenko 880b6584f2 Absorbed LICENSE.log4py inside a copyright file so to make lintian shut up 2005-07-15 22:37:42 +00:00
Yaroslav Halchenko a57a4908bf Absorbed LICENSE.log4py inside a copyright file so to make lintian shut up 2005-07-15 22:37:13 +00:00
Yaroslav Halchenko 54c7125feb added a license file for log4py which is distributed according to MIT license 2005-07-15 22:33:12 +00:00
Cyril Jaquier 5dbed848bc - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@146 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 19:28:15 +00:00
Cyril Jaquier bb430ec25c - Removed logfile option and added logtargets
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@145 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 19:27:38 +00:00
Cyril Jaquier 74dfb8440e - Added obsolete files detection and update config reminder after install
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@144 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:14:12 +00:00
Cyril Jaquier 2b8df84fa9 - Changed Fail2Ban description
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@143 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:12:51 +00:00
Cyril Jaquier cd1ede8d5b - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@142 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:11:49 +00:00
Cyril Jaquier 8e43d98ca4 - Moved path.append() before importing log4py
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@141 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:11:21 +00:00
Cyril Jaquier 3b154baae5 - Removed os.umask(0) as it is a potential security issue. Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@140 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:08:17 +00:00
Cyril Jaquier d2f7dc0521 - Fixed banList which must not be static
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@139 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:07:08 +00:00
Cyril Jaquier 6be14566e1 - Corrected logfile path
- Changed firewall rules in order to create a specific chain for each section


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@138 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:06:11 +00:00
Cyril Jaquier e919d8372b - Initial commit. Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@137 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-15 14:04:39 +00:00
Yaroslav Halchenko 8c17f3180f * tuned description to satisfy lintian
* went to a new Stadards-Version
* adjusted shipped config to ignore all private nets of 
  class A, so mask is /16, not /24
2005-07-13 10:19:20 +00:00
Yaroslav Halchenko ce98955f34 I"m not paranoid but fixed umask also in utils/process.py although it seems that fail2ban.py corrects it properly later on 2005-07-13 10:04:20 +00:00
Yaroslav Halchenko b8240499b1 forgotten to adjust make clean due to inclusion of proper fail2ban 2005-07-13 10:01:49 +00:00
Yaroslav Halchenko 61e23f45f7 Merged with 0.5.0 upstream release 2005-07-13 10:01:01 +00:00
Yaroslav Halchenko 5930368ed9 few grammatical errors fixed in the description of the package and --help message 2005-07-13 09:21:21 +00:00
Cyril Jaquier df28acf495 - Prepared for 0.5.0
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@136 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:12:40 +00:00
Cyril Jaquier 158110aa46 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@135 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:12:22 +00:00
Cyril Jaquier 0a8905e3a6 - Fixed bug #1234699
- Added mail notification support


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@134 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:11:58 +00:00
Cyril Jaquier 3acb0b8548 - Added CIDR mask support
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@133 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:10:14 +00:00
Cyril Jaquier a50d0ace81 - Initial commit
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@132 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:09:47 +00:00
Cyril Jaquier dba169ae9c - Moved replaceTag() to utils/strings.py
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@131 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:08:24 +00:00
Cyril Jaquier 8a94f873de - Removed MAIL for getSections()
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@130 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:07:35 +00:00
Cyril Jaquier 6ae8556d15 - Added mail notification support
- Added CIDR mask support in ignoreip


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@129 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-12 13:06:25 +00:00
Cyril Jaquier 7cdb6c94bb - Added more tags in firewall rules definition. Should help for Feature Request #1229479
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@128 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-09 15:11:48 +00:00
Cyril Jaquier 18486d66bd - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@127 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-09 15:09:03 +00:00
Cyril Jaquier 6ae86bd7d6 - Removed unused options
- Cleanup


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@126 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-09 13:18:59 +00:00
Cyril Jaquier cb97a9e091 - Oups... I forgot to add this one. Now, this is the main executable
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@125 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-08 10:21:52 +00:00
Cyril Jaquier 8e16185ef1 - Applied changes (command line options) from Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@124 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-08 10:01:04 +00:00
Yaroslav Halchenko fc4531ff45 fixed security hole with world-open umask 2005-07-08 05:05:49 +00:00
Yaroslav Halchenko 02c1a20bf6 fixed a bug with duplicate information in man page, removed link to sbin and now it should start from /usr/bin 2005-07-08 04:27:03 +00:00
Barak A. Pearlmutter 2a8be4bf8c domain change 2005-07-07 23:10:33 +00:00
Cyril Jaquier ebccfea6cb - Added new fail2ban binary
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@123 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:57:05 +00:00
Cyril Jaquier 5595ffcac7 - Lot of changes. Most of them are cleanup
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@122 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:56:30 +00:00
Cyril Jaquier e98f8c8182 - Updated
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@121 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:55:50 +00:00
Cyril Jaquier 3d79d9d1cb - Initial import
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@120 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:53:47 +00:00
Cyril Jaquier 3df3c510f4 - Moved __executeCmd to utils/process.py
- Removed interface


git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@119 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:52:54 +00:00
Cyril Jaquier 65fef83e56 - Made configreader more generic. Also used for global options now
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@118 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:51:52 +00:00
Cyril Jaquier 1014183f3f - Changed fail2ban binary name
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@117 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:50:56 +00:00
Cyril Jaquier 992a3f7d31 - Added start and end command options
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@116 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-07 16:50:20 +00:00
Yaroslav Halchenko b2cfa213eb adjusted just to check if svn works for different users 2005-07-07 03:54:33 +00:00
Yaroslav Halchenko e6555108b9 added stupid not for now regarding help2man malfunction 2005-07-07 03:22:57 +00:00
Yaroslav Halchenko cbef51548f minor 2005-07-07 03:19:29 +00:00
Yaroslav Halchenko f62b0345b2 adjusted for proper help2man functioning. still help2man freeks out a bit and duplicates help output -- that is for later to fix 2005-07-07 03:06:56 +00:00
Yaroslav Halchenko a527233718 removed shdeps 2005-07-07 02:21:04 +00:00
Yaroslav Halchenko 549ac7290e fixed a bug in Makefile which forbid man page creation 2005-07-07 02:20:24 +00:00
Yaroslav Halchenko f544c58d74 added help2man to builddepends 2005-07-07 01:56:20 +00:00
Yaroslav Halchenko c3666f222d removed cdbs from build-depends 2005-07-07 01:54:33 +00:00
Yaroslav Halchenko 88aa27bb21 adjusted email 2005-07-07 01:52:07 +00:00
Yaroslav Halchenko 12304aa348 went away from cdbs, compiled simple man using help2man, removed conffiles 2005-07-07 01:47:23 +00:00
Yaroslav Halchenko 1634aa9532 added cdbs to Build-Depends 2005-07-07 00:11:01 +00:00
Yaroslav Halchenko edd7ed5d30 Load fail2ban-0.4.1 into debs/fail2ban/trunk. 2005-07-06 23:10:26 +00:00
Yaroslav Halchenko 2b5c103cd0 [svn-inject] Forking fail2ban source to Trunk 2005-07-06 23:10:20 +00:00
Yaroslav Halchenko 28cca31e3f [svn-inject] Installing original source of fail2ban 2005-07-06 23:10:19 +00:00
Cyril Jaquier 685f4aad99 - Initial 0.5 commit
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@115 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-05 12:57:20 +00:00
Cyril Jaquier ea9a671e88 This commit was manufactured by cvs2svn to create branch 'FAIL2BAN-0_5'.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@114 a942ae1a-1317-0410-a47c-b1dcaea8d605
2005-07-01 09:30:52 +00:00
Cyril Jaquier 5c9c6e82cf This commit was manufactured by cvs2svn to create branch 'FAIL2BAN-0_5'.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@12 a942ae1a-1317-0410-a47c-b1dcaea8d605
2004-10-10 23:41:08 +00:00
371 changed files with 32228 additions and 6635 deletions
+9 -1
View File
@@ -1,4 +1,12 @@
[run]
branch = True
omit = /usr*
source =
config
fail2ban
[report]
exclude_lines =
pragma: ?no ?cover
pragma: ?${F2B_PY}.x no ?cover
pragma: ?systemd no ?cover
+49
View File
@@ -0,0 +1,49 @@
_We will be very grateful, if your problem was described as completely as possible,
enclosing excerpts from logs (if possible within DEBUG mode, if no errors evident
within INFO mode), and configuration in particular of effected relevant settings
(e.g., with ` fail2ban-client -d | grep 'affected-jail-name' ` for a particular
jail troubleshooting).
Thank you in advance for the details, because such issues like "It does not work"
alone could not help to resolve anything!
Thanks! (remove this paragraph and other comments upon reading)_
### Environment:
_Fill out and check (`[x]`) the boxes which apply. If your Fail2Ban version is outdated,
and you can't verify that the issue persists in the recent release, better seek support
from the distribution you obtained Fail2Ban from_
- Fail2Ban version (including any possible distribution suffixes):
- OS, including release name/version:
- [ ] Fail2Ban installed via OS/distribution mechanisms
- [ ] You have not applied any additional foreign patches to the codebase
- [ ] Some customizations were done to the configuration (provide details below is so)
### The issue:
_Summary here_
#### Steps to reproduce
#### Expected behavior
#### Observed behavior
#### Any additional information
### Configuration, dump and another helpful excerpts
#### Any customizations done to /etc/fail2ban/ configuration
```
```
#### Relevant parts of /var/log/fail2ban.log file:
_preferably obtained while running fail2ban with `loglevel = 4`_
```
```
#### Relevant lines from monitored log files in question:
```
```
+11
View File
@@ -0,0 +1,11 @@
Before submitting your PR, please review the following checklist:
- [ ] **CHOOSE CORRECT BRANCH**: if filing a bugfix/enhancement
against 0.9.x series, choose `master` branch
- [ ] **CONSIDER adding a unit test** if your PR resolves an issue
- [ ] **LIST ISSUES** this PR resolves
- [ ] **MAKE SURE** this PR doesn't break existing tests
- [ ] **KEEP PR small** so it could be easily reviewed.
- [ ] **AVOID** making unnecessary stylistic changes in unrelated code
- [ ] **ACCOMPANY** each new `failregex` for filter `X` with sample log lines
within `fail2ban/tests/files/logs/X` file
+1
View File
@@ -9,3 +9,4 @@ htmlcov
*.bak
__pycache__
.vagrant/
.idea/
+5
View File
@@ -0,0 +1,5 @@
Lee Clemens <java@leeclemens.net>
Serg G. Brester <info@sebres.de>
Serg G. Brester <serg.brester@sebres.de>
Serg G. Brester <sergey.brester@W7-DEHBG0189.wincor-nixdorf.com>
Viktor Szépe <viktor@szepe.net>
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.3</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/fail2ban-0.8/client</path>
<path>/fail2ban-0.8/server</path>
<path>/fail2ban-0.8/testcases</path>
<path>/fail2ban-0.8</path>
</pydev_pathproperty>
</pydev_project>
+82 -15
View File
@@ -1,22 +1,89 @@
# vim ft=yaml
# travis-ci.org definition for Fail2Ban build
# https://travis-ci.org/fail2ban/fail2ban/
#os: linux
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "pypy"
dist: xenial
matrix:
fast_finish: true
include:
- python: 2.6
dist: trusty # required for Python 2.6
- python: 2.7
dist: trusty # required for packages like gamin
name: 2.7 (trusty)
- python: 2.7
name: 2.7 (xenial)
- python: pypy
dist: trusty
- python: 3.3
dist: trusty
- python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
- python: 3.8-dev
- python: pypy3.5
before_install:
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then sudo apt-get update -qq; fi
- echo "running under $TRAVIS_PYTHON_VERSION"
- if [[ $TRAVIS_PYTHON_VERSION == 2* || $TRAVIS_PYTHON_VERSION == pypy* && $TRAVIS_PYTHON_VERSION != pypy3* ]]; then export F2B_PY=2; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3* || $TRAVIS_PYTHON_VERSION == pypy3* ]]; then export F2B_PY=3; fi
- echo "Set F2B_PY=$F2B_PY"
- travis_retry sudo apt-get update -qq
# Set this so sudo executes the correct python binary
# Anything not using sudo will already have the correct environment
- export VENV_BIN="$VIRTUAL_ENV/bin" && echo "VENV_BIN set to $VENV_BIN"
install:
- pip install pyinotify
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then sudo apt-get install -qq python-gamin; cp /usr/share/pyshared/gamin.py /usr/lib/pyshared/python2.7/_gamin.so $VIRTUAL_ENV/lib/python2.7/site-packages/; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then cd ..; pip install -q coveralls; cd -; fi
# Install Python packages / dependencies
# coverage
- travis_retry pip install coverage
# coveralls (note coveralls doesn't support 2.6 now):
- if [[ $TRAVIS_PYTHON_VERSION != 2.6* ]]; then F2B_COV=1; else F2B_COV=0; fi
- if [[ "$F2B_COV" = 1 ]]; then travis_retry pip install coveralls; fi
# codecov:
- travis_retry pip install codecov
# dnspython or dnspython3
- if [[ "$F2B_PY" = 2 ]]; then travis_retry pip install dnspython || echo 'not installed'; fi
- if [[ "$F2B_PY" = 3 ]]; then travis_retry pip install dnspython3 || echo 'not installed'; fi
# python systemd bindings:
- if [[ "$F2B_PY" = 2 ]]; then travis_retry sudo apt-get install -qq python-systemd || echo 'not installed'; fi
- if [[ "$F2B_PY" = 3 ]]; then travis_retry sudo apt-get install -qq python3-systemd || echo 'not installed'; fi
# gamin - install manually (not in PyPI) - travis-ci system Python is 2.7
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then (travis_retry sudo apt-get install -qq python-gamin && cp /usr/share/pyshared/gamin.py /usr/lib/pyshared/python2.7/_gamin.so $VIRTUAL_ENV/lib/python2.7/site-packages/) || echo 'not installed'; fi
# pyinotify
- travis_retry pip install pyinotify || echo 'not installed'
# Install helper tools
- sudo apt-get install shellcheck
before_script:
# Manually execute 2to3 for now
- if [[ "$F2B_PY" = 3 ]]; then ./fail2ban-2to3; fi
# (debug) output current preferred encoding:
- python -c 'import locale, sys; from fail2ban.helpers import PREFER_ENC; print(PREFER_ENC, locale.getpreferredencoding(), (sys.stdout and sys.stdout.encoding))'
script:
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then coverage run --rcfile=.travis_coveragerc setup.py test; else python setup.py test; fi
# Keep the legacy setup.py test approach of checking coverage for python2
- if [[ "$F2B_PY" = 2 ]]; then coverage run setup.py test; fi
# Coverage doesn't pick up setup.py test with python3, so run it directly (with same verbosity as from setup)
- if [[ "$F2B_PY" = 3 ]]; then coverage run bin/fail2ban-testcases --verbosity=2; fi
# Use $VENV_BIN (not python) or else sudo will always run the system's python (2.7)
- sudo $VENV_BIN/pip install .
# Doc files should get installed on Travis under Linux (python >= 3.8 seem to use another path segment)
- if [[ $TRAVIS_PYTHON_VERSION < 3.8 ]]; then test -e /usr/share/doc/fail2ban/FILTERS; fi
# Test initd script
- shellcheck -s bash -e SC1090,SC1091 files/debian-initd
after_success:
# Coverage config file must be .coveragerc for coveralls
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then cp -v .travis_coveragerc .coveragerc; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then coveralls; fi
- if [[ "$F2B_COV" = 1 ]]; then coveralls; fi
- codecov
# Might be worth looking into
#notifications:
# email: true
# irc:
# channels: "irc.freenode.org#fail2ban"
# template:
# - "%{repository}@%{branch}: %{message} (%{build_url})"
# on_success: change
# on_failure: change
# skip_join: true
-7
View File
@@ -1,7 +0,0 @@
[run]
branch = True
omit =
/usr/*
/home/travis/virtualenv/*
fail2ban/server/filtersystemd.py
-181
View File
@@ -1,181 +0,0 @@
#!/usr/bin/perl
##########################################################################
# $Id: fail2ban 150 2013-06-18 22:19:38Z mtremaine $
##########################################################################
# $Log: fail2ban,v $
# Revision 1.5 2008/08/18 16:07:46 mike
# Patches from Paul Gear <paul at libertysys.com> -mgt
#
# Revision 1.4 2008/06/30 23:07:51 kirk
# fixed copyright holders for files where I know who they should be
#
# Revision 1.3 2008/03/24 23:31:26 kirk
# added copyright/license notice to each script
#
# Revision 1.2 2006/12/15 04:53:59 bjorn
# Additional filtering, by Willi Mann.
#
# Revision 1.1 2006/05/30 19:04:26 bjorn
# Added fail2ban service, written by Yaroslav Halchenko.
#
# Written by Yaroslav Halchenko <debian@onerussian.com> for fail2ban
#
##########################################################################
########################################################
## Copyright (c) 2008 Yaroslav Halchenko
## Covered under the included MIT/X-Consortium License:
## http://www.opensource.org/licenses/mit-license.php
## All modifications and contributions by other persons to
## this script are assumed to have been donated to the
## Logwatch project and thus assume the above copyright
## and licensing terms. If you want to make contributions
## under your own copyright or a different license this
## must be explicitly stated in the contribution an the
## Logwatch project reserves the right to not accept such
## contributions. If you have made significant
## contributions to this script and want to claim
## copyright please contact logwatch-devel@lists.sourceforge.net.
#########################################################
use strict;
use Logwatch ':all';
my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
my $IgnoreHost = $ENV{'sshd_ignore_host'} || "";
my $DebugCounter = 0;
my $ReInitializations = 0;
my @IptablesErrors = ();
my @ActionErrors = ();
my $NotValidIP = 0; # reported invalid IPs number
my @OtherList = ();
my %ServicesBans = ();
if ( $Debug >= 5 ) {
print STDERR "\n\nDEBUG: Inside Fail2Ban Filter \n\n";
$DebugCounter = 1;
}
while (defined(my $ThisLine = <STDIN>)) {
if ( $Debug >= 5 ) {
print STDERR "DEBUG($DebugCounter): $ThisLine";
$DebugCounter++;
}
chomp($ThisLine);
if ( ($ThisLine =~ /..,... DEBUG: /) or
($ThisLine =~ /..,... \S*\s*: DEBUG /) or # syntax of 0.7.? fail2ban
($ThisLine =~ /..,... INFO: (Fail2Ban v.* is running|Exiting|Enabled sections:)/) or
($ThisLine =~ /INFO\s+Log rotation detected for/) or
($ThisLine =~ /INFO\s+Jail.+(?:stopped|started|uses poller)/) or
($ThisLine =~ /INFO\s+Changed logging target to/) or
($ThisLine =~ /INFO\s+Creating new jail/) or
($ThisLine =~ /..,... \S+\s*: INFO\s+(Set |Socket|Exiting|Gamin|Created|Added|Using)/) or # syntax of 0.7.? fail2ban
($ThisLine =~ /..,... WARNING: Verbose level is /) or
($ThisLine =~ /..,... WARNING: Restoring firewall rules/)
)
{
if ( $Debug >= 6 ) {
print STDERR "DEBUG($DebugCounter): line ignored\n";
}
} elsif ( my ($Service,$Action,$Host) = ($ThisLine =~ m/WARNING:?\s\[?(.*?)[]:]?\s(Ban|Unban)[^\.]* (\S+)/)) {
if ( $Debug >= 6 ) {
print STDERR "DEBUG($DebugCounter): Found $Action for $Service from $Host\n";
}
$ServicesBans{$Service}{$Host}{$Action}++;
$ServicesBans{$Service}{"(all)"}{$Action}++;
} elsif ( my ($Service,$Host,$NumFailures) = ($ThisLine =~ m/INFO: (\S+): (.+) has (\d+) login failure\(s\). Banned./)) {
if ($Debug >= 4) {
print STDERR "DEBUG: Found host $Host trying to access $Service - failed $NumFailures times\n";
}
push @{$ServicesBans{$Service}{$Host}{'Failures'}}, $NumFailures;
} elsif ( my ($Service,$Host) = ($ThisLine =~ m/ ERROR:\s(.*):\s(\S+)\salready in ban list/)) {
$ServicesBans{$Service}{$Host}{'AlreadyInTheList'}++;
} elsif ( my ($Service,$Host) = ($ThisLine =~ m/WARNING\s*\[(.*)\]\s*(\S+)\s*already banned/)) {
$ServicesBans{$Service}{$Host}{'AlreadyInTheList'}++;
} elsif ( my ($Service,$Host) = ($ThisLine =~ m/ WARNING:\s(.*):\sReBan (\S+)/)) {
$ServicesBans{$Service}{$Host}{'ReBan'}++;
} elsif ($ThisLine =~ / ERROR:?\s*(Execution of command )?\'?iptables/) {
push @IptablesErrors, "$ThisLine\n";
} elsif ($ThisLine =~ /ERROR.*returned \d+$/) {
push @ActionErrors, "$ThisLine\n";
} elsif (($ThisLine =~ /..,... WARNING: \#\S+ reinitialization of firewalls/) or
($ThisLine =~ / ERROR\s*Invariant check failed. Trying to restore a sane environment/)) {
$ReInitializations++;
} elsif ($ThisLine =~ /..,... WARNING: is not a valid IP address/) {
# just ignore - this will be fixed within fail2ban and is harmless warning
}
else
{
# Report any unmatched entries...
push @OtherList, "$ThisLine\n";
}
}
###########################################################
if (keys %ServicesBans) {
printf("\nBanned services with Fail2Ban: Bans:Unbans\n");
foreach my $service (sort {$a cmp $b} keys %ServicesBans) {
printf(" %-55s [%3d:%-3d]\n", "$service:",
$ServicesBans{$service}{'(all)'}{'Ban'},
$ServicesBans{$service}{'(all)'}{'Unban'});
delete $ServicesBans{$service}{'(all)'};
my $totalSort = TotalCountOrder(%{$ServicesBans{$service}}, \&SortIP);
if ($Detail >= 5) {
foreach my $ip (sort $totalSort keys %{$ServicesBans{$service}}) {
my $name = LookupIP($ip);
printf(" %-53s %3d:%-3d\n",
$name,
$ServicesBans{$service}{$ip}{'Ban'},
$ServicesBans{$service}{$ip}{'Unban'});
if (($Detail >= 10) and ($ServicesBans{$service}{$ip}{'Failures'}>0)) {
print " Failed ";
foreach my $fails (@{$ServicesBans{$service}{$ip}{'Failures'}}) {
print " $fails";
}
print " times";
printf("\n %d Duplicate Ban attempts", $ServicesBans{$service}{$ip}{'AlreadyInTheList'}) ;
printf("\n %d ReBans due to rules reinitilizations", $ServicesBans{$service}{$ip}{'ReBan'}) ;
print "\n";
}
}
}
}
}
if ($Detail>0) {
if ($#IptablesErrors > 0) {
printf("\n%d faulty iptables invocation(s)", $#IptablesErrors);
if ($Detail > 5) {
print ":\n";
print @IptablesErrors ;
}
}
if ($#ActionErrors > 0) {
printf("\n%d error(s) returned from actions", $#ActionErrors);
if ($Detail > 5) {
print ":\n";
print @ActionErrors ;
}
}
if ($ReInitializations > 0) {
printf("\n%d fail2ban rules reinitialization(s)", $ReInitializations);
}
if ($#OtherList >= 0) {
print "\n**Unmatched Entries**\n";
print @OtherList;
}
}
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et
# Local Variables:
# mode: perl
# perl-indent-level: 3
# indent-tabs-mode: nil
# End:
+10
View File
@@ -15,3 +15,13 @@ join the [mailing list](https://lists.sourceforge.net/lists/listinfo/fail2ban-us
### You would like to contribute (new filters/actions/code/documentation)?
send a [pull request](https://github.com/fail2ban/fail2ban/pulls)
Pull requests guidelines
========================
- If there is an issue on github to be closed by the pull request, include
```Closes #ISSUE``` (where ISSUE is issue's number)
- Add a brief summary of the change to the ChangeLog file into a corresponding
section out of Fixes, New Features or Enhancements (improvements to existing
features)
+1729 -566
View File
File diff suppressed because it is too large Load Diff
+23 -4
View File
@@ -56,9 +56,12 @@ following (note: on Debian-based systems, the script is called
`python-coverage`)::
coverage run bin/fail2ban-testcases
coverage report
Optionally:
coverage html
Then look at htmlcov/index.html and see how much coverage your test cases
And then browse htmlcov/index.html and see how much coverage your test cases
exert over the code base. Full coverage is a good thing however it may not be
complete. Try to ensure tests cover as many independent paths through the
code.
@@ -81,6 +84,18 @@ some quick commands::
status test
Testing with vagrant
--------------------
Testing can now be done inside a vagrant VM. Vagrantfile provided in
source code repository established two VMs:
- VM "secure" which can be used for testing fail2ban code.
- VM "attacker" which can be used to perform attack against our "secure" VM.
Both VMs are sharing the 192.168.200/24 network. If you are using this network
take a look into the Vagrantfile and change the IP.
Coding Standards
================
@@ -247,12 +262,16 @@ FileContainer
Keeps the position pointer
dnsutils.py
~~~~~~~~~~~
ipdns.py
~~~~~~~~
DNSUtils
Utility class for DNS and IP handling
Utility class for DNS handling
IPAddr
Object-class for IP address handling
filter*.py
+1 -1
View File
@@ -227,7 +227,7 @@ Regular expressions (failregex, ignoreregex) assume that the date/time has been
removed from the log line (this is just how fail2ban works internally ATM).
If the format is like '<date...> error 1.2.3.4 is evil' then you need to match
the < at the start so regex should be similar to '^<> <HOST> is evil$' using
the <> at the start so regex should be similar to '^<> error <HOST> is evil$' using
<HOST> where the IP/domain name appears in the log line.
The following general rules apply to regular expressions:
+349 -242
View File
@@ -1,318 +1,425 @@
README.md
README.Solaris
ChangeLog
TODO
THANKS
COPYING
DEVELOP
FILTERS
fail2ban-2to3
fail2ban-testcases-all
fail2ban-testcases-all-python3
bin/fail2ban-client
bin/fail2ban-regex
bin/fail2ban-server
bin/fail2ban-testcases
bin/fail2ban-regex
doc/run-rootless.txt
fail2ban/client/configreader.py
fail2ban/client/configparserinc.py
fail2ban/client/jailreader.py
fail2ban/client/fail2banreader.py
fail2ban/client/jailsreader.py
fail2ban/client/beautifier.py
fail2ban/client/filterreader.py
ChangeLog
config/action.d/abuseipdb.conf
config/action.d/apf.conf
config/action.d/badips.conf
config/action.d/badips.py
config/action.d/blocklist_de.conf
config/action.d/bsd-ipfw.conf
config/action.d/cloudflare.conf
config/action.d/complain.conf
config/action.d/dshield.conf
config/action.d/dummy.conf
config/action.d/firewallcmd-allports.conf
config/action.d/firewallcmd-common.conf
config/action.d/firewallcmd-ipset.conf
config/action.d/firewallcmd-multiport.conf
config/action.d/firewallcmd-new.conf
config/action.d/firewallcmd-rich-logging.conf
config/action.d/firewallcmd-rich-rules.conf
config/action.d/helpers-common.conf
config/action.d/hostsdeny.conf
config/action.d/ipfilter.conf
config/action.d/ipfw.conf
config/action.d/iptables-allports.conf
config/action.d/iptables-common.conf
config/action.d/iptables.conf
config/action.d/iptables-ipset-proto4.conf
config/action.d/iptables-ipset-proto6-allports.conf
config/action.d/iptables-ipset-proto6.conf
config/action.d/iptables-multiport.conf
config/action.d/iptables-multiport-log.conf
config/action.d/iptables-new.conf
config/action.d/iptables-xt_recent-echo.conf
config/action.d/mail-buffered.conf
config/action.d/mail.conf
config/action.d/mail-whois-common.conf
config/action.d/mail-whois.conf
config/action.d/mail-whois-lines.conf
config/action.d/mynetwatchman.conf
config/action.d/netscaler.conf
config/action.d/nftables-allports.conf
config/action.d/nftables.conf
config/action.d/nftables-multiport.conf
config/action.d/nginx-block-map.conf
config/action.d/npf.conf
config/action.d/nsupdate.conf
config/action.d/osx-afctl.conf
config/action.d/osx-ipfw.conf
config/action.d/pf.conf
config/action.d/route.conf
config/action.d/sendmail-buffered.conf
config/action.d/sendmail-common.conf
config/action.d/sendmail.conf
config/action.d/sendmail-geoip-lines.conf
config/action.d/sendmail-whois.conf
config/action.d/sendmail-whois-ipjailmatches.conf
config/action.d/sendmail-whois-ipmatches.conf
config/action.d/sendmail-whois-lines.conf
config/action.d/sendmail-whois-matches.conf
config/action.d/shorewall.conf
config/action.d/shorewall-ipset-proto6.conf
config/action.d/smtp.py
config/action.d/symbiosis-blacklist-allports.conf
config/action.d/ufw.conf
config/action.d/xarf-login-attack.conf
config/fail2ban.conf
config/filter.d/3proxy.conf
config/filter.d/apache-auth.conf
config/filter.d/apache-badbots.conf
config/filter.d/apache-botsearch.conf
config/filter.d/apache-common.conf
config/filter.d/apache-fakegooglebot.conf
config/filter.d/apache-modsecurity.conf
config/filter.d/apache-nohome.conf
config/filter.d/apache-noscript.conf
config/filter.d/apache-overflows.conf
config/filter.d/apache-pass.conf
config/filter.d/apache-shellshock.conf
config/filter.d/assp.conf
config/filter.d/asterisk.conf
config/filter.d/bitwarden.conf
config/filter.d/botsearch-common.conf
config/filter.d/centreon.conf
config/filter.d/common.conf
config/filter.d/counter-strike.conf
config/filter.d/courier-auth.conf
config/filter.d/courier-smtp.conf
config/filter.d/cyrus-imap.conf
config/filter.d/directadmin.conf
config/filter.d/domino-smtp.conf
config/filter.d/dovecot.conf
config/filter.d/dropbear.conf
config/filter.d/drupal-auth.conf
config/filter.d/ejabberd-auth.conf
config/filter.d/exim-common.conf
config/filter.d/exim.conf
config/filter.d/exim-spam.conf
config/filter.d/freeswitch.conf
config/filter.d/froxlor-auth.conf
config/filter.d/groupoffice.conf
config/filter.d/gssftpd.conf
config/filter.d/guacamole.conf
config/filter.d/haproxy-http-auth.conf
config/filter.d/horde.conf
config/filter.d/ignorecommands/apache-fakegooglebot
config/filter.d/kerio.conf
config/filter.d/lighttpd-auth.conf
config/filter.d/mongodb-auth.conf
config/filter.d/monit.conf
config/filter.d/murmur.conf
config/filter.d/mysqld-auth.conf
config/filter.d/nagios.conf
config/filter.d/named-refused.conf
config/filter.d/nginx-botsearch.conf
config/filter.d/nginx-http-auth.conf
config/filter.d/nginx-limit-req.conf
config/filter.d/nsd.conf
config/filter.d/openhab.conf
config/filter.d/openwebmail.conf
config/filter.d/oracleims.conf
config/filter.d/pam-generic.conf
config/filter.d/perdition.conf
config/filter.d/phpmyadmin-syslog.conf
config/filter.d/php-url-fopen.conf
config/filter.d/portsentry.conf
config/filter.d/postfix.conf
config/filter.d/proftpd.conf
config/filter.d/pure-ftpd.conf
config/filter.d/qmail.conf
config/filter.d/recidive.conf
config/filter.d/roundcube-auth.conf
config/filter.d/screensharingd.conf
config/filter.d/selinux-common.conf
config/filter.d/selinux-ssh.conf
config/filter.d/sendmail-auth.conf
config/filter.d/sendmail-reject.conf
config/filter.d/sieve.conf
config/filter.d/slapd.conf
config/filter.d/sogo-auth.conf
config/filter.d/solid-pop3d.conf
config/filter.d/squid.conf
config/filter.d/squirrelmail.conf
config/filter.d/sshd.conf
config/filter.d/stunnel.conf
config/filter.d/suhosin.conf
config/filter.d/tine20.conf
config/filter.d/traefik-auth.conf
config/filter.d/uwimap-auth.conf
config/filter.d/vsftpd.conf
config/filter.d/webmin-auth.conf
config/filter.d/wuftpd.conf
config/filter.d/xinetd-fail.conf
config/filter.d/znc-adminlog.conf
config/filter.d/zoneminder.conf
config/jail.conf
config/paths-arch.conf
config/paths-common.conf
config/paths-debian.conf
config/paths-fedora.conf
config/paths-freebsd.conf
config/paths-opensuse.conf
config/paths-osx.conf
CONTRIBUTING.md
COPYING
.coveragerc
DEVELOP
fail2ban-2to3
fail2ban/client/actionreader.py
fail2ban/client/__init__.py
fail2ban/client/beautifier.py
fail2ban/client/configparserinc.py
fail2ban/client/configreader.py
fail2ban/client/configurator.py
fail2ban/client/csocket.py
fail2ban/client/fail2banclient.py
fail2ban/client/fail2bancmdline.py
fail2ban/client/fail2banreader.py
fail2ban/client/fail2banregex.py
fail2ban/client/fail2banserver.py
fail2ban/client/filterreader.py
fail2ban/client/__init__.py
fail2ban/client/jailreader.py
fail2ban/client/jailsreader.py
fail2ban/exceptions.py
fail2ban/helpers.py
fail2ban/__init__.py
fail2ban/protocol.py
fail2ban/server/action.py
fail2ban/server/actions.py
fail2ban/server/asyncserver.py
fail2ban/server/banmanager.py
fail2ban/server/database.py
fail2ban/server/filter.py
fail2ban/server/filterpyinotify.py
fail2ban/server/datedetector.py
fail2ban/server/datetemplate.py
fail2ban/server/failmanager.py
fail2ban/server/failregex.py
fail2ban/server/filtergamin.py
fail2ban/server/filterpoll.py
fail2ban/server/filter.py
fail2ban/server/filterpyinotify.py
fail2ban/server/filtersystemd.py
fail2ban/server/iso8601.py
fail2ban/server/server.py
fail2ban/server/actions.py
fail2ban/server/faildata.py
fail2ban/server/failmanager.py
fail2ban/server/datedetector.py
fail2ban/server/jailthread.py
fail2ban/server/transmitter.py
fail2ban/server/action.py
fail2ban/server/ticket.py
fail2ban/server/__init__.py
fail2ban/server/ipdns.py
fail2ban/server/jail.py
fail2ban/server/jails.py
fail2ban/server/__init__.py
fail2ban/server/banmanager.py
fail2ban/server/datetemplate.py
fail2ban/server/jailthread.py
fail2ban/server/mytime.py
fail2ban/server/failregex.py
fail2ban/server/database.py
fail2ban/tests/banmanagertestcase.py
fail2ban/tests/failmanagertestcase.py
fail2ban/tests/clientreadertestcase.py
fail2ban/tests/filtertestcase.py
fail2ban/tests/__init__.py
fail2ban/tests/dummyjail.py
fail2ban/tests/samplestestcase.py
fail2ban/tests/datedetectortestcase.py
fail2ban/server/observer.py
fail2ban/server/server.py
fail2ban/server/strptime.py
fail2ban/server/ticket.py
fail2ban/server/transmitter.py
fail2ban/server/utils.py
fail2ban/setup.py
fail2ban-testcases-all
fail2ban-testcases-all-python3
fail2ban/tests/action_d/__init__.py
fail2ban/tests/action_d/test_badips.py
fail2ban/tests/action_d/test_smtp.py
fail2ban/tests/actionstestcase.py
fail2ban/tests/actiontestcase.py
fail2ban/tests/servertestcase.py
fail2ban/tests/sockettestcase.py
fail2ban/tests/utils.py
fail2ban/tests/misctestcase.py
fail2ban/tests/databasetestcase.py
fail2ban/tests/config/jail.conf
fail2ban/tests/config/fail2ban.conf
fail2ban/tests/config/paths-common.conf
fail2ban/tests/config/paths-freebsd.conf
fail2ban/tests/config/paths-osx.conf
fail2ban/tests/config/paths-debian.conf
fail2ban/tests/config/filter.d/simple.conf
fail2ban/tests/banmanagertestcase.py
fail2ban/tests/clientbeautifiertestcase.py
fail2ban/tests/clientreadertestcase.py
fail2ban/tests/config/action.d/action.conf
fail2ban/tests/config/action.d/brokenaction.conf
fail2ban/tests/files/config/apache-auth/digest/.htaccess
fail2ban/tests/files/config/apache-auth/digest/.htpasswd
fail2ban/tests/files/config/apache-auth/digest_time/.htaccess
fail2ban/tests/files/config/apache-auth/digest_time/.htpasswd
fail2ban/tests/files/config/apache-auth/basic/authz_owner/.htaccess
fail2ban/tests/config/fail2ban.conf
fail2ban/tests/config/filter.d/simple.conf
fail2ban/tests/config/filter.d/test.conf
fail2ban/tests/config/filter.d/test.local
fail2ban/tests/config/filter.d/zzz-generic-example.conf
fail2ban/tests/config/filter.d/zzz-sshd-obsolete-multiline.conf
fail2ban/tests/config/jail.conf
fail2ban/tests/databasetestcase.py
fail2ban/tests/datedetectortestcase.py
fail2ban/tests/dummyjail.py
fail2ban/tests/fail2banclienttestcase.py
fail2ban/tests/fail2banregextestcase.py
fail2ban/tests/failmanagertestcase.py
fail2ban/tests/files/action.d/action_checkainfo.py
fail2ban/tests/files/action.d/action_errors.py
fail2ban/tests/files/action.d/action_modifyainfo.py
fail2ban/tests/files/action.d/action_noAction.py
fail2ban/tests/files/action.d/action_nomethod.py
fail2ban/tests/files/action.d/action.py
fail2ban/tests/files/config/apache-auth/basic/authz_owner/cant_get_me.html
fail2ban/tests/files/config/apache-auth/basic/authz_owner/.htaccess
fail2ban/tests/files/config/apache-auth/basic/authz_owner/.htpasswd
fail2ban/tests/files/config/apache-auth/basic/file/.htaccess
fail2ban/tests/files/config/apache-auth/basic/file/.htpasswd
fail2ban/tests/files/config/apache-auth/digest.py
fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htaccess
fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htpasswd
fail2ban/tests/files/config/apache-auth/digest_anon/.htaccess
fail2ban/tests/files/config/apache-auth/digest_anon/.htpasswd
fail2ban/tests/files/config/apache-auth/README
fail2ban/tests/files/config/apache-auth/digest/.htaccess
fail2ban/tests/files/config/apache-auth/digest/.htpasswd
fail2ban/tests/files/config/apache-auth/digest.py
fail2ban/tests/files/config/apache-auth/digest_time/.htaccess
fail2ban/tests/files/config/apache-auth/digest_time/.htpasswd
fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htaccess
fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htpasswd
fail2ban/tests/files/config/apache-auth/noentry/.htaccess
fail2ban/tests/files/config/apache-auth/README
fail2ban/tests/files/database_v1.db
fail2ban/tests/files/ignorecommand.py
fail2ban/tests/files/database_v2.db
fail2ban/tests/files/filter.d/substition.conf
fail2ban/tests/files/filter.d/testcase-common.conf
fail2ban/tests/files/filter.d/testcase01.conf
fail2ban/tests/files/testcase01.log
fail2ban/tests/files/testcase02.log
fail2ban/tests/files/testcase03.log
fail2ban/tests/files/testcase04.log
fail2ban/tests/files/testcase-usedns.log
fail2ban/tests/files/testcase-journal.log
fail2ban/tests/files/testcase-multiline.log
fail2ban/tests/files/logs/bsd/syslog-plain.txt
fail2ban/tests/files/logs/bsd/syslog-v.txt
fail2ban/tests/files/logs/bsd/syslog-vv.txt
fail2ban/tests/files/filter.d/testcase-common.conf
fail2ban/tests/files/ignorecommand.py
fail2ban/tests/files/logs/3proxy
fail2ban/tests/files/logs/apache-auth
fail2ban/tests/files/logs/apache-badbots
fail2ban/tests/files/logs/apache-botscripts
fail2ban/tests/files/logs/apache-botsearch
fail2ban/tests/files/logs/apache-fakegooglebot
fail2ban/tests/files/logs/apache-modsecurity
fail2ban/tests/files/logs/apache-nohome
fail2ban/tests/files/logs/apache-noscript
fail2ban/tests/files/logs/apache-overflows
fail2ban/tests/files/logs/apache-pass
fail2ban/tests/files/logs/apache-shellshock
fail2ban/tests/files/logs/assp
fail2ban/tests/files/logs/asterisk
fail2ban/tests/files/logs/bitwarden
fail2ban/tests/files/logs/bsd/syslog-plain.txt
fail2ban/tests/files/logs/bsd/syslog-v.txt
fail2ban/tests/files/logs/bsd/syslog-vv.txt
fail2ban/tests/files/logs/centreon
fail2ban/tests/files/logs/counter-strike
fail2ban/tests/files/logs/courier-auth
fail2ban/tests/files/logs/courier-smtp
fail2ban/tests/files/logs/cyrus-imap
fail2ban/tests/files/logs/directadmin
fail2ban/tests/files/logs/domino-smtp
fail2ban/tests/files/logs/dovecot
fail2ban/tests/files/logs/dropbear
fail2ban/tests/files/logs/drupal-auth
fail2ban/tests/files/logs/ejabberd-auth
fail2ban/tests/files/logs/exim
fail2ban/tests/files/logs/exim-spam
fail2ban/tests/files/logs/freeswitch
fail2ban/tests/files/logs/froxlor-auth
fail2ban/tests/files/logs/groupoffice
fail2ban/tests/files/logs/gssftpd
fail2ban/tests/files/logs/guacamole
fail2ban/tests/files/logs/haproxy-http-auth
fail2ban/tests/files/logs/horde
fail2ban/tests/files/logs/kerio
fail2ban/tests/files/logs/lighttpd-auth
fail2ban/tests/files/logs/mongodb-auth
fail2ban/tests/files/logs/monit
fail2ban/tests/files/logs/murmur
fail2ban/tests/files/logs/mysqld-auth
fail2ban/tests/files/logs/nagios
fail2ban/tests/files/logs/nsd
fail2ban/tests/files/logs/perdition
fail2ban/tests/files/logs/php-url-fopen
fail2ban/tests/files/logs/postfix-sasl
fail2ban/tests/files/logs/named-refused
fail2ban/tests/files/logs/nginx-botsearch
fail2ban/tests/files/logs/nginx-http-auth
fail2ban/tests/files/logs/nginx-limit-req
fail2ban/tests/files/logs/nsd
fail2ban/tests/files/logs/openhab
fail2ban/tests/files/logs/openwebmail
fail2ban/tests/files/logs/oracleims
fail2ban/tests/files/logs/pam-generic
fail2ban/tests/files/logs/perdition
fail2ban/tests/files/logs/phpmyadmin-syslog
fail2ban/tests/files/logs/php-url-fopen
fail2ban/tests/files/logs/portsentry
fail2ban/tests/files/logs/postfix
fail2ban/tests/files/logs/proftpd
fail2ban/tests/files/logs/pure-ftpd
fail2ban/tests/files/logs/qmail
fail2ban/tests/files/logs/recidive
fail2ban/tests/files/logs/roundcube-auth
fail2ban/tests/files/logs/screensharingd
fail2ban/tests/files/logs/selinux-ssh
fail2ban/tests/files/logs/sendmail-spam
fail2ban/tests/files/logs/sendmail-auth
fail2ban/tests/files/logs/sendmail-reject
fail2ban/tests/files/logs/sieve
fail2ban/tests/files/logs/squid
fail2ban/tests/files/logs/stunnel
fail2ban/tests/files/logs/suhosin
fail2ban/tests/files/logs/slapd
fail2ban/tests/files/logs/sogo-auth
fail2ban/tests/files/logs/solid-pop3d
fail2ban/tests/files/logs/squid
fail2ban/tests/files/logs/squirrelmail
fail2ban/tests/files/logs/sshd
fail2ban/tests/files/logs/sshd-ddos
fail2ban/tests/files/logs/sshd-journal
fail2ban/tests/files/logs/stunnel
fail2ban/tests/files/logs/suhosin
fail2ban/tests/files/logs/tine20
fail2ban/tests/files/logs/traefik-auth
fail2ban/tests/files/logs/uwimap-auth
fail2ban/tests/files/logs/vsftpd
fail2ban/tests/files/logs/webmin-auth
fail2ban/tests/files/logs/wuftpd
fail2ban/tests/files/logs/uwimap-auth
fail2ban/tests/files/logs/xinetd-fail
fail2ban/tests/config/jail.conf
fail2ban/tests/config/fail2ban.conf
fail2ban/tests/config/filter.d/simple.conf
fail2ban/tests/config/action.d/brokenaction.conf
setup.py
setup.cfg
fail2ban/__init__.py
fail2ban/exceptions.py
fail2ban/helpers.py
fail2ban/tests/files/logs/znc-adminlog
fail2ban/tests/files/logs/zoneminder
fail2ban/tests/files/logs/zzz-generic-example
fail2ban/tests/files/logs/zzz-sshd-obsolete-multiline
fail2ban/tests/files/testcase01a.log
fail2ban/tests/files/testcase01.log
fail2ban/tests/files/testcase02.log
fail2ban/tests/files/testcase03.log
fail2ban/tests/files/testcase04.log
fail2ban/tests/files/testcase-journal.log
fail2ban/tests/files/testcase-multiline.log
fail2ban/tests/files/testcase-usedns.log
fail2ban/tests/files/testcase-wrong-char.log
fail2ban/tests/files/zzz-sshd-obsolete-multiline.log
fail2ban/tests/filtertestcase.py
fail2ban/tests/__init__.py
fail2ban/tests/misctestcase.py
fail2ban/tests/observertestcase.py
fail2ban/tests/samplestestcase.py
fail2ban/tests/servertestcase.py
fail2ban/tests/sockettestcase.py
fail2ban/tests/tickettestcase.py
fail2ban/tests/utils.py
fail2ban/version.py
fail2ban/protocol.py
setup.py
setup.cfg
kill-server
config/jail.conf
config/fail2ban.conf
config/filter.d/common.conf
config/filter.d/apache-auth.conf
config/filter.d/apache-badbots.conf
config/filter.d/apache-botsearch.conf
config/filter.d/apache-modsecurity.conf
config/filter.d/apache-nohome.conf
config/filter.d/apache-noscript.conf
config/filter.d/apache-overflows.conf
config/filter.d/nginx-http-auth.conf
config/filter.d/counter-strike.conf
config/filter.d/courier-auth.conf
config/filter.d/courier-smtp.conf
config/filter.d/cyrus-imap.conf
config/filter.d/ejabberd-auth.conf
config/filter.d/exim.conf
config/filter.d/freeswitch.conf
config/filter.d/gssftpd.conf
config/filter.d/kerio.conf
config/filter.d/horde.conf
config/filter.d/suhosin.conf
config/filter.d/nagios.conf
config/filter.d/named-refused.conf
config/filter.d/nsd.conf
config/filter.d/openwebmail.conf
config/filter.d/pam-generic.conf
config/filter.d/php-url-fopen.conf
config/filter.d/postfix-sasl.conf
config/filter.d/pam-generic.conf
config/filter.d/php-url-fopen.conf
config/filter.d/postfix-sasl.conf
config/filter.d/postfix.conf
config/filter.d/proftpd.conf
config/filter.d/pure-ftpd.conf
config/filter.d/qmail.conf
config/filter.d/pam-generic.conf
config/filter.d/php-url-fopen.conf
config/filter.d/postfix-sasl.conf
config/filter.d/sendmail-auth.conf
config/filter.d/sendmail-reject.conf
config/filter.d/sieve.conf
config/filter.d/solid-pop3d.conf
config/filter.d/squid.conf
config/filter.d/sshd.conf
config/filter.d/sshd-ddos.conf
config/filter.d/stunnel.conf
config/filter.d/vsftpd.conf
config/filter.d/webmin-auth.conf
config/filter.d/wuftpd.conf
config/filter.d/xinetd-fail.conf
config/filter.d/asterisk.conf
config/filter.d/dovecot.conf
config/filter.d/dropbear.conf
config/filter.d/lighttpd-auth.conf
config/filter.d/recidive.conf
config/filter.d/roundcube-auth.conf
config/filter.d/assp.conf
config/filter.d/sogo-auth.conf
config/filter.d/mysqld-auth.conf
config/filter.d/selinux-common.conf
config/filter.d/selinux-ssh.conf
config/filter.d/3proxy.conf
config/filter.d/apache-common.conf
config/filter.d/exim-common.conf
config/filter.d/exim-spam.conf
config/filter.d/freeswitch.conf
config/filter.d/groupoffice.conf
config/filter.d/perdition.conf
config/filter.d/uwimap-auth.conf
config/filter.d/courier-auth.conf
config/filter.d/courier-smtp.conf
config/filter.d/ejabberd-auth.conf
config/filter.d/guacamole.conf
config/filter.d/sendmail-spam.conf
config/action.d/apf.conf
config/action.d/blocklist_de.conf
config/action.d/osx-afctl.conf
config/action.d/osx-ipfw.conf
config/action.d/sendmail-common.conf
config/action.d/badips.conf
config/action.d/bsd-ipfw.conf
config/action.d/dummy.conf
config/action.d/firewallcmd-new.conf
config/action.d/firewallcmd-ipset.conf
config/action.d/iptables-ipset-proto6-allports.conf
config/action.d/iptables-common.conf
config/action.d/iptables-ipset-proto4.conf
config/action.d/iptables-ipset-proto6.conf
config/action.d/iptables-xt_recent-echo.conf
config/action.d/route.conf
config/action.d/complain.conf
config/action.d/dshield.conf
config/action.d/hostsdeny.conf
config/action.d/ipfw.conf
config/action.d/ipfilter.conf
config/action.d/iptables.conf
config/action.d/iptables-allports.conf
config/action.d/iptables-multiport.conf
config/action.d/iptables-multiport-log.conf
config/action.d/iptables-new.conf
config/action.d/mail.conf
config/action.d/mail-buffered.conf
config/action.d/mail-whois.conf
config/action.d/mail-whois-lines.conf
config/action.d/mynetwatchman.conf
config/action.d/pf.conf
config/action.d/sendmail.conf
config/action.d/sendmail-buffered.conf
config/action.d/sendmail-whois-ipmatches.conf
config/action.d/sendmail-whois.conf
config/action.d/sendmail-whois-lines.conf
config/action.d/shorewall.conf
config/action.d/xarf-login-attack.conf
config/action.d/ufw.conf
config/fail2ban.conf
doc/run-rootless.txt
man/fail2ban-client.1
man/fail2ban.1
man/jail.conf.5
man/fail2ban-client.h2m
man/fail2ban-server.1
man/fail2ban-server.h2m
man/fail2ban-regex.1
man/fail2ban-regex.h2m
man/generate-man
files/gentoo-initd
files/bash-completion
files/cacti/cacti_host_template_fail2ban.xml
files/cacti/fail2ban_stats.sh
files/cacti/README
files/debian-initd
files/fail2ban-logrotate
files/fail2ban.service.in
files/fail2ban-tmpfiles.conf
files/fail2ban.upstart
files/gen_badbots
files/gentoo-confd
files/redhat-initd
files/gentoo-initd
files/ipmasq-ZZZzzz_fail2ban.rul
files/logwatch/fail2ban
files/logwatch/fail2ban-0.8.log
files/logwatch/fail2ban-0.9.log
files/macosx-initd
files/monit/fail2ban
files/nagios/check_fail2ban
files/nagios/README
files/redhat-initd
files/solaris-fail2ban.xml
files/solaris-svc-fail2ban
files/suse-initd
files/fail2ban-logrotate
files/cacti/fail2ban_stats.sh
files/cacti/cacti_host_template_fail2ban.xml
files/cacti/README
files/nagios/check_fail2ban
files/nagios/README
files/bash-completion
files/fail2ban-tmpfiles.conf
files/fail2ban.service
files/ipmasq-ZZZzzz_fail2ban.rul
files/gen_badbots
FILTERS
kill-server
man/fail2ban.1
man/fail2ban-client.1
man/fail2ban-client.h2m
man/fail2ban-python.1
man/fail2ban-python.h2m
man/fail2ban-regex.1
man/fail2ban-regex.h2m
man/fail2ban-server.1
man/fail2ban-server.h2m
man/fail2ban-testcases.1
man/fail2ban-testcases.h2m
man/generate-man
man/jail.conf.5
.pylintrc
README.md
README.Solaris
RELEASE
setup.cfg
setup.py
THANKS
TODO
Vagrantfile
+2 -1
View File
@@ -1,4 +1,5 @@
include ChangeLog COPYING DEVELOP FILTERS README.* THANKS TODO
include ChangeLog COPYING DEVELOP FILTERS README.* THANKS TODO CONTRIBUTING* Vagrantfile
graft doc
graft files
recursive-include config *.conf *.py
recursive-include config/filter.d/ignorecommands *
+56 -26
View File
@@ -2,46 +2,62 @@
/ _|__ _(_) |_ ) |__ __ _ _ _
| _/ _` | | |/ /| '_ \/ _` | ' \
|_| \__,_|_|_/___|_.__/\__,_|_||_|
v0.9.0 2014/03/14
v0.11.0.dev1 20??/??/??
## Fail2Ban: ban hosts that cause multiple authentication errors
Fail2Ban scans log files like /var/log/pwdfail and bans IP that makes too many
password failures. It updates firewall rules to reject the IP address. These
rules can be defined by the user. Fail2Ban can read multiple log files such as
sshd or Apache web server ones.
Fail2Ban scans log files like `/var/log/auth.log` and bans IP addresses conducting
too many failed login attempts. It does this by updating system firewall rules
to reject new connections from those IP addresses, for a configurable amount
of time. Fail2Ban comes out-of-the-box ready to read many standard log files,
such as those for sshd and Apache, and is easily configured to read any log
file of your choosing, for any error you wish.
Fail2Ban is able to reduce the rate of incorrect authentications attempts
however it cannot eliminate the risk that weak authentication presents.
Configure services to use only two factor or public/private authentication
Though Fail2Ban is able to reduce the rate of incorrect authentication
attempts, it cannot eliminate the risk presented by weak authentication.
Set up services to use only two factor, or public/private authentication
mechanisms if you really want to protect services.
<img src="http://www.worldipv6launch.org/wp-content/themes/ipv6/downloads/World_IPv6_launch_logo.svg" height="52pt"/> | Since v0.10 fail2ban supports the matching of IPv6 addresses.
------|------
This README is a quick introduction to Fail2ban. More documentation, FAQ, HOWTOs
are available in fail2ban(1) manpage and on the website http://www.fail2ban.org
This README is a quick introduction to Fail2Ban. More documentation, FAQ, and HOWTOs
to be found on fail2ban(1) manpage, [Wiki](https://github.com/fail2ban/fail2ban/wiki),
[Developers documentation](https://fail2ban.readthedocs.io/)
and the website: https://www.fail2ban.org
Installation:
-------------
**It is possible that Fail2ban is already packaged for your distribution. In
this case, you should use it instead.**
**It is possible that Fail2Ban is already packaged for your distribution. In
this case, you should use that instead.**
Required:
- [Python2 >= 2.6 or Python >= 3.2](http://www.python.org) or [PyPy](http://pypy.org)
- [Python2 >= 2.6 or Python >= 3.2](https://www.python.org) or [PyPy](https://pypy.org)
Optional:
- [pyinotify >= 0.8.3](https://github.com/seb-m/pyinotify)
- Linux >= 2.6.13
- [pyinotify >= 0.8.3](https://github.com/seb-m/pyinotify), may require:
* Linux >= 2.6.13
- [gamin >= 0.0.21](http://www.gnome.org/~veillard/gamin)
- [systemd >= 204](http://www.freedesktop.org/wiki/Software/systemd)
- [systemd >= 204](http://www.freedesktop.org/wiki/Software/systemd) and python bindings:
* [python-systemd package](https://www.freedesktop.org/software/systemd/python-systemd/index.html)
- [dnspython](http://www.dnspython.org/)
To install, just do:
tar xvfj fail2ban-0.9.0.tar.bz2
cd fail2ban-0.9.0
python setup.py install
To install:
tar xvfj fail2ban-0.11.0.tar.bz2
cd fail2ban-0.11.0
sudo python setup.py install
Alternatively, you can clone the source from GitHub to a directory of Your choice, and do the install from there. Pick the correct branch, for example, 0.11
git clone https://github.com/fail2ban/fail2ban.git
cd fail2ban
sudo python setup.py install
This will install Fail2Ban into the python library directory. The executable
scripts are placed into /usr/bin, and configuration under /etc/fail2ban.
scripts are placed into `/usr/bin`, and configuration in `/etc/fail2ban`.
Fail2Ban should be correctly installed now. Just type:
@@ -49,21 +65,35 @@ Fail2Ban should be correctly installed now. Just type:
to see if everything is alright. You should always use fail2ban-client and
never call fail2ban-server directly.
You can verify that you have the correct version installed with
fail2ban-client version
Please note that the system init/service script is not automatically installed.
To enable fail2ban as an automatic service, simply copy the script for your
distro from the `files` directory to `/etc/init.d`. Example (on a Debian-based
system):
cp files/debian-initd /etc/init.d/fail2ban
update-rc.d fail2ban defaults
service fail2ban start
Configuration:
--------------
You can configure Fail2Ban using the files in /etc/fail2ban. It is possible to
configure the server using commands sent to it by fail2ban-client. The
You can configure Fail2Ban using the files in `/etc/fail2ban`. It is possible to
configure the server using commands sent to it by `fail2ban-client`. The
available commands are described in the fail2ban-client(1) manpage. Also see
fail2ban(1) and jail.conf(5) manpages for further references.
Code status:
------------
* [![tests status](https://secure.travis-ci.org/fail2ban/fail2ban.png?branch=master)](https://travis-ci.org/fail2ban/fail2ban) travis-ci.org (master branch)
* travis-ci.org: [![tests status](https://secure.travis-ci.org/fail2ban/fail2ban.svg?branch=0.11)](https://travis-ci.org/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [![tests status](https://secure.travis-ci.org/fail2ban/fail2ban.svg?branch=0.10)](https://travis-ci.org/fail2ban/fail2ban?branch=0.10) (0.10 branch)
* [![Coverage Status](https://coveralls.io/repos/fail2ban/fail2ban/badge.png?branch=master)](https://coveralls.io/r/fail2ban/fail2ban)
* coveralls.io: [![Coverage Status](https://coveralls.io/repos/fail2ban/fail2ban/badge.svg?branch=0.11)](https://coveralls.io/github/fail2ban/fail2ban?branch=0.11) (0.11 branch) / [![Coverage Status](https://coveralls.io/repos/fail2ban/fail2ban/badge.svg?branch=0.10)](https://coveralls.io/github/fail2ban/fail2ban?branch=0.10) / (0.10 branch)
* codecov.io: [![codecov.io](https://codecov.io/gh/fail2ban/fail2ban/coverage.svg?branch=0.11)](https://codecov.io/gh/fail2ban/fail2ban/branch/0.11) (0.11 branch) / [![codecov.io](https://codecov.io/gh/fail2ban/fail2ban/coverage.svg?branch=0.10)](https://codecov.io/gh/fail2ban/fail2ban/branch/0.10) (0.10 branch)
Contact:
--------
@@ -72,7 +102,7 @@ Contact:
See [CONTRIBUTING.md](https://github.com/fail2ban/fail2ban/blob/master/CONTRIBUTING.md)
### You just appreciate this program:
send kudos to the original author ([Cyril Jaquier](mailto: Cyril Jaquier <cyril.jaquier@fail2ban.org>))
Send kudos to the original author ([Cyril Jaquier](mailto:cyril.jaquier@fail2ban.org))
or *better* to the [mailing list](https://lists.sourceforge.net/lists/listinfo/fail2ban-users)
since Fail2Ban is "community-driven" for years now.
+22 -13
View File
@@ -47,6 +47,15 @@ Preparation
* Ensure the MANIFEST is complete
ad-hoc bash script to run in a clean clone:
find -type f | grep -v -e '\.git' -e '/doc/' -e '\.travis' -e MANIFEST | sed -e 's,^\./,,g' | while read f; do grep -ne "^$f\$" MANIFEST >/dev/null || echo "$f" ; done
or an alternative for comparison with previous release
git diff 0.10.0 | grep -B2 'index 0000000..' | grep -B1 'new file mode' | sed -n -e '/^diff /s,.* b/,,gp' >> MANIFEST
sort MANIFEST | uniq | sponge MANIFEST
* Run::
python setup.py sdist
@@ -57,24 +66,24 @@ Preparation
* Which indicates that testcases/files/logs/mysqld.log has been moved or is a directory::
tar -C /tmp -jxf dist/fail2ban-0.9.0.tar.bz2
tar -C /tmp -jxf dist/fail2ban-0.9.6.tar.bz2
* clean up current direcory::
* clean up current directory::
diff -rul --exclude \*.pyc . /tmp/fail2ban-0.9.0/
diff -rul --exclude \*.pyc . /tmp/fail2ban-0.10.0/
* Only differences should be files that you don't want distributed.
* Ensure the tests work from the tarball::
cd /tmp/fail2ban-0.9.0/ && export PYTHONPATH=`pwd` && bin/fail2ban-testcases
cd /tmp/fail2ban-0.9.6/ && bin/fail2ban-testcases
* Add/finalize the corresponding entry in the ChangeLog
* To generate a list of committers use e.g.::
git shortlog -sn 0.8.12.. | sed -e 's,^[ 0-9\t]*,,g' | tr '\n' '\|' | sed -e 's:|:, :g'
git shortlog -sn 0.10.0.. | sed -e 's,^[ 0-9\t]*,,g' | tr '\n' '\|' | sed -e 's:|:, :g'
* Ensure the top of the ChangeLog has the right version and current date.
* Ensure the top entry of the ChangeLog has the right version and current date.
@@ -97,7 +106,7 @@ Preparation
* Tag the release by using a signed (and annotated) tag. Cut/paste
release ChangeLog entry as tag annotation::
git tag -s 0.9.1
git tag -s 0.10.0
Pre Release
===========
@@ -112,7 +121,7 @@ Pre Release
* http://packages.qa.debian.org/f/fail2ban.html
* FreeBSD: Christoph Theis theis@gmx.at>, Nick Hilliard <nick@foobar.org>
* FreeBSD: Christoph Theis theis@gmx.at>
* http://svnweb.freebsd.org/ports/head/security/py-fail2ban/Makefile?view=markup
* http://www.freebsd.org/cgi/query-pr-summary.cgi?text=fail2ban
@@ -140,7 +149,7 @@ Pre Release
* https://bugs.mageia.org/buglist.cgi?quicksearch=fail2ban
* An potentially to the fail2ban-users email list.
* And potentially to the fail2ban-users email list.
* Wait for feedback from distributors
@@ -181,17 +190,17 @@ Post Release
Add the following to the top of the ChangeLog::
ver. 0.9.1 (2014/XX/XXX) - wanna-be-released
ver. 0.10.0 (2016/XX/XXX) - wanna-be-released
-----------
- Fixes:
### Fixes
- New Features:
### New Features
- Enhancements:
### Enhancements
Alter the git shortlog command in the previous section to refer to the just
released version.
and adjust fail2ban/version.py to carry .dev suffix to signal
and adjust fail2ban/version.py to carry .dev0 suffix to signal
a version under development.
+23 -1
View File
@@ -6,13 +6,18 @@ the project. If you have been left off, please let us know
(preferably send a pull request on github with the "fix") and you will
be added
Aaron Brice
Adam Tkac
Adrien Clerc
ache
ag4ve (Shawn)
Alasdair D. Campbell
Alexander Koeppe (IPv6 support)
Alexandre Perrin (kAworu)
Amir Caspi
Amy
Andrew James Collett (ajcollett)
Andrew St. Jean
Andrey G. Grozin
Andy Fragen
Arturo 'Buanzo' Busleiman
@@ -26,16 +31,22 @@ Christian Rauch
Christophe Carles
Christoph Haas
Christos Psonis
craneworks
Cyril Jaquier
Daniel B. Cid
Daniel B.
Daniel Black
David Nutter
David Reagan (jerrac)
Derek Atkins
Donald Yandt
Eric Gerbier
Enrico Labedzki
Eugene Hopkinson (SlowRiot)
ftoppi
Florian Robert (1technophile)
François Boulogne
Frantisek Sumsal
Frédéric
Georgiy Mernov
Guilhem Lettron
@@ -50,6 +61,7 @@ John Thoe
Jacques Lav!gnotte
Johannes Weberhofer
Jason H Martin
Jeaye Wilkerson
Jisoo Park
Joel M Snyder
Jonathan Kamens
@@ -59,12 +71,14 @@ Joël Bertrand
JP Espinosa
jserrachinha
Justin Shore
Kevin Locke
Kévin Drapel
kjohnsonecl
kojiro
Lars Kneschke
Lee Clemens
leftyfb (Mike Rushton)
M. Maraun
Manuel Arostegui Ramirez
Marcel Dopita
Mark Edgington
@@ -80,7 +94,10 @@ Michael Hanselmann
Mika (mkl)
Nick Munger
onorua
Orion Poplawski
Pablo Rodriguez Fernandez
Paul Marrapese
Paul Traina
Noel Butler
Patrick Börjesson
Pressy
@@ -94,15 +111,20 @@ Russell Odom
SATO Kentaro
Sean DuBois
Sebastian Arcus
Serg G. Brester
Serg G. Brester (sebres)
Sergey Safarov
Shaun C.
Sireyessire
silviogarbes
Stefan Tatschner
Stephen Gildea
Steven Hiscocks
TESTOVIK
Thomas Mayer
Tom Pike
Tom Hendrikx
Tomas Pihl
Thomas Skierlo (phaleas)
Tony Lawrence
Tomasz Ciolek
Tyler
+15 -416
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
@@ -18,421 +18,20 @@
# along with Fail2Ban; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
__author__ = "Cyril Jaquier"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
"""
Fail2Ban reads log file that contains password failure report
and bans the corresponding IP addresses using firewall rules.
This tools starts/stops fail2ban server or does client/server communication,
to change/read parameters of the server or jails.
"""
__author__ = "Fail2Ban Developers"
__copyright__ = "Copyright (c) 2004-2008 Cyril Jaquier, 2012-2014 Yaroslav Halchenko, 2014-2016 Serg G. Brester"
__license__ = "GPL"
import sys, string, os, pickle, re, logging, signal
import getopt, time, shlex, socket
from fail2ban.client.fail2banclient import exec_command_line, sys
from fail2ban.version import version
from fail2ban.protocol import printFormatted
from fail2ban.client.csocket import CSocket
from fail2ban.client.configurator import Configurator
from fail2ban.client.beautifier import Beautifier
from fail2ban.helpers import getLogger
# Gets the instance of the logger.
logSys = getLogger("fail2ban")
##
#
# @todo This class needs cleanup.
class Fail2banClient:
SERVER = "fail2ban-server"
PROMPT = "fail2ban> "
def __init__(self):
self.__argv = None
self.__stream = None
self.__configurator = Configurator()
self.__conf = dict()
self.__conf["conf"] = "/etc/fail2ban"
self.__conf["dump"] = False
self.__conf["force"] = False
self.__conf["background"] = True
self.__conf["verbose"] = 1
self.__conf["interactive"] = False
self.__conf["socket"] = None
self.__conf["pidfile"] = None
def dispVersion(self):
print "Fail2Ban v" + version
print
print "Copyright (c) 2004-2008 Cyril Jaquier, 2008- Fail2Ban Contributors"
print "Copyright of modifications held by their respective authors."
print "Licensed under the GNU General Public License v2 (GPL)."
print
print "Written by Cyril Jaquier <cyril.jaquier@fail2ban.org>."
print "Many contributions by Yaroslav O. Halchenko <debian@onerussian.com>."
def dispUsage(self):
""" Prints Fail2Ban command line options and exits
"""
print "Usage: "+self.__argv[0]+" [OPTIONS] <COMMAND>"
print
print "Fail2Ban v" + version + " reads log file that contains password failure report"
print "and bans the corresponding IP addresses using firewall rules."
print
print "Options:"
print " -c <DIR> configuration directory"
print " -s <FILE> socket path"
print " -p <FILE> pidfile path"
print " -d dump configuration. For debugging"
print " -i interactive mode"
print " -v increase verbosity"
print " -q decrease verbosity"
print " -x force execution of the server (remove socket file)"
print " -b start server in background (default)"
print " -f start server in foreground (note that the client forks once itself)"
print " -h, --help display this help message"
print " -V, --version print the version"
print
print "Command:"
# Prints the protocol
printFormatted()
print
print "Report bugs to https://github.com/fail2ban/fail2ban/issues"
def dispInteractive(self):
print "Fail2Ban v" + version + " reads log file that contains password failure report"
print "and bans the corresponding IP addresses using firewall rules."
print
def __sigTERMhandler(self, signum, frame):
# Print a new line because we probably come from wait
print
logSys.warning("Caught signal %d. Exiting" % signum)
sys.exit(-1)
def __getCmdLineOptions(self, optList):
""" Gets the command line options
"""
for opt in optList:
if opt[0] == "-c":
self.__conf["conf"] = opt[1]
elif opt[0] == "-s":
self.__conf["socket"] = opt[1]
elif opt[0] == "-p":
self.__conf["pidfile"] = opt[1]
elif opt[0] == "-d":
self.__conf["dump"] = True
elif opt[0] == "-v":
self.__conf["verbose"] = self.__conf["verbose"] + 1
elif opt[0] == "-q":
self.__conf["verbose"] = self.__conf["verbose"] - 1
elif opt[0] == "-x":
self.__conf["force"] = True
elif opt[0] == "-i":
self.__conf["interactive"] = True
elif opt[0] == "-b":
self.__conf["background"] = True
elif opt[0] == "-f":
self.__conf["background"] = False
elif opt[0] in ["-h", "--help"]:
self.dispUsage()
sys.exit(0)
elif opt[0] in ["-V", "--version"]:
self.dispVersion()
sys.exit(0)
def __ping(self):
return self.__processCmd([["ping"]], False)
def __processCmd(self, cmd, showRet = True):
beautifier = Beautifier()
streamRet = True
for c in cmd:
beautifier.setInputCmd(c)
try:
client = CSocket(self.__conf["socket"])
ret = client.send(c)
if ret[0] == 0:
logSys.debug("OK : " + `ret[1]`)
if showRet:
print beautifier.beautify(ret[1])
else:
logSys.error("NOK: " + `ret[1].args`)
if showRet:
print beautifier.beautifyError(ret[1])
streamRet = False
except socket.error:
if showRet:
logSys.error("Unable to contact server. Is it running?")
return False
except Exception, e:
if showRet:
logSys.error(e)
return False
return streamRet
##
# Process a command line.
#
# Process one command line and exit.
# @param cmd the command line
def __processCommand(self, cmd):
if len(cmd) == 1 and cmd[0] == "start":
if self.__ping():
logSys.error("Server already running")
return False
else:
# Read the config
ret = self.__readConfig()
# Do not continue if configuration is not 100% valid
if not ret:
return False
# verify that directory for the socket file exists
socket_dir = os.path.dirname(self.__conf["socket"])
if not os.path.exists(socket_dir):
logSys.error(
"There is no directory %s to contain the socket file %s."
% (socket_dir, self.__conf["socket"]))
return False
if not os.access(socket_dir, os.W_OK | os.X_OK):
logSys.error(
"Directory %s exists but not accessible for writing"
% (socket_dir,))
return False
# Start the server
self.__startServerAsync(self.__conf["socket"],
self.__conf["pidfile"],
self.__conf["force"],
self.__conf["background"])
try:
# Wait for the server to start
self.__waitOnServer()
# Configure the server
self.__processCmd(self.__stream, False)
return True
except ServerExecutionException:
logSys.error("Could not start server. Maybe an old "
"socket file is still present. Try to "
"remove " + self.__conf["socket"] + ". If "
"you used fail2ban-client to start the "
"server, adding the -x option will do it")
return False
elif len(cmd) == 1 and cmd[0] == "reload":
if self.__ping():
ret = self.__readConfig()
# Do not continue if configuration is not 100% valid
if not ret:
return False
self.__processCmd([['stop', 'all']], False)
# Configure the server
return self.__processCmd(self.__stream, False)
else:
logSys.error("Could not find server")
return False
elif len(cmd) == 2 and cmd[0] == "reload":
if self.__ping():
jail = cmd[1]
ret = self.__readConfig(jail)
# Do not continue if configuration is not 100% valid
if not ret:
return False
self.__processCmd([['stop', jail]], False)
# Configure the server
return self.__processCmd(self.__stream, False)
else:
logSys.error("Could not find server")
return False
else:
return self.__processCmd([cmd])
##
# Start Fail2Ban server.
#
# Start the Fail2ban server in daemon mode.
def __startServerAsync(self, socket, pidfile, force = False, background = True):
# Forks the current process.
pid = os.fork()
if pid == 0:
args = list()
args.append(self.SERVER)
# Set the socket path.
args.append("-s")
args.append(socket)
# Set the pidfile
args.append("-p")
args.append(pidfile)
# Force the execution if needed.
if force:
args.append("-x")
# Start in foreground mode if requested.
if background:
args.append("-b")
else:
args.append("-f")
try:
# Use the current directory.
exe = os.path.abspath(os.path.join(sys.path[0], self.SERVER))
logSys.debug("Starting %r with args %r" % (exe, args))
os.execv(exe, args)
except OSError:
try:
# Use the PATH env.
logSys.warning("Initial start attempt failed. Starting %r with the same args" % (self.SERVER,))
os.execvp(self.SERVER, args)
except OSError:
logSys.error("Could not start %s" % self.SERVER)
os.exit(-1)
def __waitOnServer(self):
# Wait for the server to start
cnt = 0
if self.__conf["verbose"] > 1:
pos = 0
delta = 1
mask = "[ ]"
while not self.__ping():
# Wonderful visual :)
if self.__conf["verbose"] > 1:
pos += delta
sys.stdout.write("\rINFO " + mask[:pos] + '#' + mask[pos+1:] +
" Waiting on the server...")
sys.stdout.flush()
if pos > len(mask)-3:
delta = -1
elif pos < 2:
delta = 1
# The server has 30 seconds to start.
if cnt >= 300:
if self.__conf["verbose"] > 1:
sys.stdout.write('\n')
raise ServerExecutionException("Failed to start server")
time.sleep(0.1)
cnt += 1
if self.__conf["verbose"] > 1:
sys.stdout.write('\n')
def start(self, argv):
# Command line options
self.__argv = argv
# Install signal handlers
signal.signal(signal.SIGTERM, self.__sigTERMhandler)
signal.signal(signal.SIGINT, self.__sigTERMhandler)
# Reads the command line options.
try:
cmdOpts = 'hc:s:p:xfbdviqV'
cmdLongOpts = ['help', 'version']
optList, args = getopt.getopt(self.__argv[1:], cmdOpts, cmdLongOpts)
except getopt.GetoptError:
self.dispUsage()
return False
self.__getCmdLineOptions(optList)
verbose = self.__conf["verbose"]
if verbose <= 0:
logSys.setLevel(logging.ERROR)
elif verbose == 1:
logSys.setLevel(logging.WARNING)
elif verbose == 2:
logSys.setLevel(logging.INFO)
else:
logSys.setLevel(logging.DEBUG)
# Add the default logging handler to dump to stderr
logout = logging.StreamHandler(sys.stderr)
# set a format which is simpler for console use
formatter = logging.Formatter('%(levelname)-6s %(message)s')
# tell the handler to use this format
logout.setFormatter(formatter)
logSys.addHandler(logout)
# Set the configuration path
self.__configurator.setBaseDir(self.__conf["conf"])
# Set socket path
self.__configurator.readEarly()
conf = self.__configurator.getEarlyOptions()
if self.__conf["socket"] is None:
self.__conf["socket"] = conf["socket"]
if self.__conf["pidfile"] is None:
self.__conf["pidfile"] = conf["pidfile"]
logSys.info("Using socket file " + self.__conf["socket"])
if self.__conf["dump"]:
ret = self.__readConfig()
self.dumpConfig(self.__stream)
return ret
# Interactive mode
if self.__conf["interactive"]:
try:
import readline
except ImportError:
logSys.error("Readline not available")
return False
try:
ret = True
if len(args) > 0:
ret = self.__processCommand(args)
if ret:
readline.parse_and_bind("tab: complete")
self.dispInteractive()
while True:
cmd = raw_input(self.PROMPT)
if cmd == "exit" or cmd == "quit":
# Exit
return True
if cmd == "help":
self.dispUsage()
elif not cmd == "":
try:
self.__processCommand(shlex.split(cmd))
except Exception, e:
logSys.error(e)
except (EOFError, KeyboardInterrupt):
print
return True
# Single command mode
else:
if len(args) < 1:
self.dispUsage()
return False
return self.__processCommand(args)
def __readConfig(self, jail=None):
# Read the configuration
# TODO: get away from stew of return codes and exception
# handling -- handle via exceptions
try:
self.__configurator.readAll()
ret = self.__configurator.getOptions(jail)
self.__configurator.convertToProtocol()
self.__stream = self.__configurator.getConfigStream()
except Exception, e:
logSys.error("Failed during configuration: %s" % e)
ret = False
return ret
#@staticmethod
def dumpConfig(cmd):
for c in cmd:
print c
return True
dumpConfig = staticmethod(dumpConfig)
class ServerExecutionException(Exception):
pass
if __name__ == "__main__": # pragma: no cover - can't test main
client = Fail2banClient()
# Exit with correct return value
if client.start(sys.argv):
sys.exit(0)
else:
sys.exit(-1)
if __name__ == "__main__":
exec_command_line(sys.argv)
+3 -542
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
#
@@ -29,545 +29,6 @@ __author__ = "Fail2Ban Developers"
__copyright__ = "Copyright (c) 2004-2008 Cyril Jaquier, 2012-2014 Yaroslav Halchenko"
__license__ = "GPL"
import getopt, sys, time, logging, os, locale, shlex, time, urllib
from optparse import OptionParser, Option
from fail2ban.client.fail2banregex import exec_command_line
from ConfigParser import NoOptionError, NoSectionError, MissingSectionHeaderError
try:
from systemd import journal
from fail2ban.server.filtersystemd import FilterSystemd
except ImportError:
journal = None
from fail2ban.version import version
from fail2ban.client.filterreader import FilterReader
from fail2ban.server.filter import Filter
from fail2ban.server.failregex import RegexException
from fail2ban.helpers import FormatterWithTraceBack, getLogger
# Gets the instance of the logger.
logSys = getLogger("fail2ban")
def debuggexURL(sample, regex):
q = urllib.urlencode({ 're': regex.replace('<HOST>', '(?&.ipv4)'),
'str': sample,
'flavor': 'python' })
return 'http://www.debuggex.com/?' + q
def shortstr(s, l=53):
"""Return shortened string
"""
if len(s) > l:
return s[:l-3] + '...'
return s
def pprint_list(l, header=None):
if not len(l):
return
if header:
s = "|- %s\n" % header
else:
s = ''
print s + "| " + "\n| ".join(l) + '\n`-'
def file_lines_gen(hdlr):
for line in hdlr:
try:
line = line.decode(fail2banRegex.encoding, 'strict')
except UnicodeDecodeError:
if sys.version_info >= (3,): # Python 3 must be decoded
line = line.decode(fail2banRegex.encoding, 'ignore')
yield line
def journal_lines_gen(myjournal):
while True:
try:
entry = myjournal.get_next()
except OSError:
continue
if not entry:
break
yield FilterSystemd.formatJournalEntry(entry)
def get_opt_parser():
# use module docstring for help output
p = OptionParser(
usage="%s [OPTIONS] <LOG> <REGEX> [IGNOREREGEX]\n" % sys.argv[0] + __doc__
+ """
LOG:
string a string representing a log line
filename path to a log file (/var/log/auth.log)
"systemd-journal" search systemd journal (systemd-python required)
REGEX:
string a string representing a 'failregex'
filename path to a filter file (filter.d/sshd.conf)
IGNOREREGEX:
string a string representing an 'ignoreregex'
filename path to a filter file (filter.d/sshd.conf)
Copyright (c) 2004-2008 Cyril Jaquier, 2008- Fail2Ban Contributors
Copyright of modifications held by their respective authors.
Licensed under the GNU General Public License v2 (GPL).
Written by Cyril Jaquier <cyril.jaquier@fail2ban.org>.
Many contributions by Yaroslav O. Halchenko and Steven Hiscocks.
Report bugs to https://github.com/fail2ban/fail2ban/issues
""",
version="%prog " + version)
p.add_options([
Option("-d", "--datepattern",
help="set custom pattern used to match date/times"),
Option("-e", "--encoding",
help="File encoding. Default: system locale"),
Option("-L", "--maxlines", type=int, default=0,
help="maxlines for multi-line regex"),
Option("-m", "--journalmatch",
help="journalctl style matches overriding filter file. "
"\"systemd-journal\" only"),
Option('-l', "--log-level", type="choice",
dest="log_level",
choices=('heavydebug', 'debug', 'info', 'notice', 'warning', 'error', 'critical'),
default=None,
help="Log level for the Fail2Ban logger to use"),
Option("-v", "--verbose", action='store_true',
help="Be verbose in output"),
Option("-D", "--debuggex", action='store_true',
help="Produce debuggex.com urls for debugging there"),
Option("--print-no-missed", action='store_true',
help="Do not print any missed lines"),
Option("--print-no-ignored", action='store_true',
help="Do not print any ignored lines"),
Option("--print-all-matched", action='store_true',
help="Print all matched lines"),
Option("--print-all-missed", action='store_true',
help="Print all missed lines, no matter how many"),
Option("--print-all-ignored", action='store_true',
help="Print all ignored lines, no matter how many"),
Option("-t", "--log-traceback", action='store_true',
help="Enrich log-messages with compressed tracebacks"),
Option("--full-traceback", action='store_true',
help="Either to make the tracebacks full, not compressed (as by default)"),
])
return p
class RegexStat(object):
def __init__(self, failregex):
self._stats = 0
self._failregex = failregex
self._ipList = list()
def __str__(self):
return "%s(%r) %d failed: %s" \
% (self.__class__, self._failregex, self._stats, self._ipList)
def inc(self):
self._stats += 1
def getStats(self):
return self._stats
def getFailRegex(self):
return self._failregex
def appendIP(self, value):
self._ipList.append(value)
def getIPList(self):
return self._ipList
class LineStats(object):
"""Just a convenience container for stats
"""
def __init__(self):
self.tested = self.matched = 0
self.matched_lines = []
self.missed = 0
self.missed_lines = []
self.missed_lines_timeextracted = []
self.ignored = 0
self.ignored_lines = []
self.ignored_lines_timeextracted = []
def __str__(self):
return "%(tested)d lines, %(ignored)d ignored, %(matched)d matched, %(missed)d missed" % self
# just for convenient str
def __getitem__(self, key):
return getattr(self, key)
class Fail2banRegex(object):
def __init__(self, opts):
self._verbose = opts.verbose
self._debuggex = opts.debuggex
self._maxlines = 20
self._print_no_missed = opts.print_no_missed
self._print_no_ignored = opts.print_no_ignored
self._print_all_matched = opts.print_all_matched
self._print_all_missed = opts.print_all_missed
self._print_all_ignored = opts.print_all_ignored
self._maxlines_set = False # so we allow to override maxlines in cmdline
self._datepattern_set = False
self._journalmatch = None
self._filter = Filter(None)
self._ignoreregex = list()
self._failregex = list()
self._time_elapsed = None
self._line_stats = LineStats()
if opts.maxlines:
self.setMaxLines(opts.maxlines)
if opts.journalmatch is not None:
self.setJournalMatch(opts.journalmatch.split())
if opts.datepattern:
self.setDatePattern(opts.datepattern)
if opts.encoding:
self.encoding = opts.encoding
else:
self.encoding = locale.getpreferredencoding()
def setDatePattern(self, pattern):
if not self._datepattern_set:
self._filter.setDatePattern(pattern)
self._datepattern_set = True
if pattern is not None:
print "Use datepattern : %s" % (
self._filter.getDatePattern()[1], )
def setMaxLines(self, v):
if not self._maxlines_set:
self._filter.setMaxLines(int(v))
self._maxlines_set = True
print "Use maxlines : %d" % self._filter.getMaxLines()
def setJournalMatch(self, v):
if self._journalmatch is None:
self._journalmatch = v
def readRegex(self, value, regextype):
assert(regextype in ('fail', 'ignore'))
regex = regextype + 'regex'
if os.path.isfile(value):
print "Use %11s file : %s" % (regex, value)
reader = FilterReader(value, 'fail2ban-regex-jail', {})
reader.setBaseDir(None)
if reader.readexplicit():
reader.getOptions(None)
readercommands = reader.convert()
regex_values = [
RegexStat(m[3])
for m in filter(
lambda x: x[0] == 'set' and x[2] == "add%sregex" % regextype,
readercommands)]
# Read out and set possible value of maxlines
for command in readercommands:
if command[2] == "maxlines":
maxlines = int(command[3])
try:
self.setMaxLines(maxlines)
except ValueError:
print "ERROR: Invalid value for maxlines (%(maxlines)r) " \
"read from %(value)s" % locals()
return False
elif command[2] == 'addjournalmatch':
journalmatch = command[3]
self.setJournalMatch(shlex.split(journalmatch))
elif command[2] == 'datepattern':
datepattern = command[3]
self.setDatePattern(datepattern)
else:
print "ERROR: failed to read %s" % value
return False
else:
print "Use %11s line : %s" % (regex, shortstr(value))
regex_values = [RegexStat(value)]
setattr(self, "_" + regex, regex_values)
for regex in regex_values:
getattr(
self._filter,
'add%sRegex' % regextype.title())(regex.getFailRegex())
return True
def testIgnoreRegex(self, line):
found = False
try:
ret = self._filter.ignoreLine([(line, "", "")])
if ret is not None:
found = True
regex = self._ignoreregex[ret].inc()
except RegexException, e:
print e
return False
return found
def testRegex(self, line, date=None):
orgLineBuffer = self._filter._Filter__lineBuffer
fullBuffer = len(orgLineBuffer) >= self._filter.getMaxLines()
try:
line, ret = self._filter.processLine(line, date, checkAllRegex=True)
for match in ret:
# Append True/False flag depending if line was matched by
# more than one regex
match.append(len(ret)>1)
regex = self._failregex[match[0]]
regex.inc()
regex.appendIP(match)
except RegexException, e:
print e
return False
except IndexError:
print "Sorry, but no <HOST> found in regex"
return False
for bufLine in orgLineBuffer[int(fullBuffer):]:
if bufLine not in self._filter._Filter__lineBuffer:
try:
self._line_stats.missed_lines.pop(
self._line_stats.missed_lines.index("".join(bufLine)))
self._line_stats.missed_lines_timeextracted.pop(
self._line_stats.missed_lines_timeextracted.index(
"".join(bufLine[::2])))
except ValueError:
pass
else:
self._line_stats.matched += 1
self._line_stats.missed -= 1
return line, ret
def process(self, test_lines):
t0 = time.time()
for line_no, line in enumerate(test_lines):
if isinstance(line, tuple):
line_datetimestripped, ret = fail2banRegex.testRegex(
line[0], line[1])
line = "".join(line[0])
else:
line = line.rstrip('\r\n')
if line.startswith('#') or not line:
# skip comment and empty lines
continue
line_datetimestripped, ret = fail2banRegex.testRegex(line)
is_ignored = fail2banRegex.testIgnoreRegex(line_datetimestripped)
if is_ignored:
self._line_stats.ignored += 1
if not self._print_no_ignored and (self._print_all_ignored or self._line_stats.ignored <= self._maxlines + 1):
self._line_stats.ignored_lines.append(line)
self._line_stats.ignored_lines_timeextracted.append(line_datetimestripped)
if len(ret) > 0:
assert(not is_ignored)
self._line_stats.matched += 1
if self._print_all_matched:
self._line_stats.matched_lines.append(line)
else:
if not is_ignored:
self._line_stats.missed += 1
if not self._print_no_missed and (self._print_all_missed or self._line_stats.missed <= self._maxlines + 1):
self._line_stats.missed_lines.append(line)
self._line_stats.missed_lines_timeextracted.append(line_datetimestripped)
self._line_stats.tested += 1
if line_no % 10 == 0 and self._filter.dateDetector is not None:
self._filter.dateDetector.sortTemplate()
self._time_elapsed = time.time() - t0
def printLines(self, ltype):
lstats = self._line_stats
assert(self._line_stats.missed == lstats.tested - (lstats.matched + lstats.ignored))
lines = lstats[ltype]
l = lstats[ltype + '_lines']
if lines:
header = "%s line(s):" % (ltype.capitalize(),)
if self._debuggex:
if ltype == 'missed' or ltype == 'matched':
regexlist = self._failregex
else:
regexlist = self._ignoreregex
l = lstats[ltype + '_lines_timeextracted']
if lines < self._maxlines or getattr(self, '_print_all_' + ltype):
ans = [[]]
for arg in [l, regexlist]:
ans = [ x + [y] for x in ans for y in arg ]
b = map(lambda a: a[0] + ' | ' + a[1].getFailRegex() + ' | ' + debuggexURL(a[0], a[1].getFailRegex()), ans)
pprint_list([x.rstrip() for x in b], header)
else:
print "%s too many to print. Use --print-all-%s " \
"to print all %d lines" % (header, ltype, lines)
elif lines < self._maxlines or getattr(self, '_print_all_' + ltype):
pprint_list([x.rstrip() for x in l], header)
else:
print "%s too many to print. Use --print-all-%s " \
"to print all %d lines" % (header, ltype, lines)
def printStats(self):
print
print "Results"
print "======="
def print_failregexes(title, failregexes):
# Print title
total, out = 0, []
for cnt, failregex in enumerate(failregexes):
match = failregex.getStats()
total += match
if (match or self._verbose):
out.append("%2d) [%d] %s" % (cnt+1, match, failregex.getFailRegex()))
if self._verbose and len(failregex.getIPList()):
for ip in failregex.getIPList():
timeTuple = time.localtime(ip[2])
timeString = time.strftime("%a %b %d %H:%M:%S %Y", timeTuple)
out.append(
" %s %s%s" % (
ip[1],
timeString,
ip[-1] and " (multiple regex matched)" or ""))
print "\n%s: %d total" % (title, total)
pprint_list(out, " #) [# of hits] regular expression")
return total
# Print title
total = print_failregexes("Failregex", self._failregex)
_ = print_failregexes("Ignoreregex", self._ignoreregex)
if self._filter.dateDetector is not None:
print "\nDate template hits:"
out = []
for template in self._filter.dateDetector.templates:
if self._verbose or template.hits:
out.append("[%d] %s" % (
template.hits, template.name))
pprint_list(out, "[# of hits] date format")
print "\nLines: %s" % self._line_stats,
if self._time_elapsed is not None:
print "[processed in %.2f sec]" % self._time_elapsed,
print
if self._print_all_matched:
self.printLines('matched')
if not self._print_no_ignored:
self.printLines('ignored')
if not self._print_no_missed:
self.printLines('missed')
return True
if __name__ == "__main__":
parser = get_opt_parser()
(opts, args) = parser.parse_args()
if opts.print_no_missed and opts.print_all_missed:
sys.stderr.write("ERROR: --print-no-missed and --print-all-missed are mutually exclusive.\n\n")
parser.print_help()
sys.exit(-1)
if opts.print_no_ignored and opts.print_all_ignored:
sys.stderr.write("ERROR: --print-no-ignored and --print-all-ignored are mutually exclusive.\n\n")
parser.print_help()
sys.exit(-1)
print
print "Running tests"
print "============="
print
fail2banRegex = Fail2banRegex(opts)
# We need 2 or 3 parameters
if not len(args) in (2, 3):
sys.stderr.write("ERROR: provide both <LOG> and <REGEX>.\n\n")
parser.print_help()
sys.exit(-1)
# TODO: taken from -testcases -- move common functionality somewhere
if opts.log_level is not None: # pragma: no cover
# so we had explicit settings
logSys.setLevel(getattr(logging, opts.log_level.upper()))
else: # pragma: no cover
# suppress the logging but it would leave unittests' progress dots
# ticking, unless like with '-l critical' which would be silent
# unless error occurs
logSys.setLevel(getattr(logging, 'CRITICAL'))
# Add the default logging handler
stdout = logging.StreamHandler(sys.stdout)
fmt = 'D: %(message)s'
if opts.log_traceback:
Formatter = FormatterWithTraceBack
fmt = (opts.full_traceback and ' %(tb)s' or ' %(tbc)s') + fmt
else:
Formatter = logging.Formatter
# Custom log format for the verbose tests runs
if opts.verbose: # pragma: no cover
stdout.setFormatter(Formatter(' %(asctime)-15s %(thread)s' + fmt))
else: # pragma: no cover
# just prefix with the space
stdout.setFormatter(Formatter(fmt))
logSys.addHandler(stdout)
cmd_log, cmd_regex = args[:2]
fail2banRegex.readRegex(cmd_regex, 'fail') or sys.exit(-1)
if len(args) == 3:
fail2banRegex.readRegex(args[2], 'ignore') or sys.exit(-1)
if os.path.isfile(cmd_log):
try:
hdlr = open(cmd_log, 'rb')
print "Use log file : %s" % cmd_log
print "Use encoding : %s" % fail2banRegex.encoding
test_lines = file_lines_gen(hdlr)
except IOError, e:
print e
sys.exit(-1)
elif cmd_log == "systemd-journal":
if not journal:
print "Error: systemd library not found. Exiting..."
sys.exit(-1)
myjournal = journal.Reader(converters={'__CURSOR': lambda x: x})
journalmatch = fail2banRegex._journalmatch
fail2banRegex.setDatePattern(None)
if journalmatch:
try:
for element in journalmatch:
if element == "+":
myjournal.add_disjunction()
else:
myjournal.add_match(element)
except ValueError:
print "Error: Invalid journalmatch: %s" % shortstr(" ".join(journalmatch))
sys.exit(-1)
print "Use journal match : %s" % " ".join(journalmatch)
test_lines = journal_lines_gen(myjournal)
else:
print "Use single line : %s" % shortstr(cmd_log)
test_lines = [ cmd_log ]
print
fail2banRegex.process(test_lines)
fail2banRegex.printStats() or sys.exit(-1)
exec_command_line()
+14 -115
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
@@ -18,121 +18,20 @@
# along with Fail2Ban; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
__author__ = "Cyril Jaquier"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
"""
Fail2Ban reads log file that contains password failure report
and bans the corresponding IP addresses using firewall rules.
This tool starts/stops fail2ban server or does client/server communication
to change/read parameters of the server or jails.
"""
__author__ = "Fail2Ban Developers"
__copyright__ = "Copyright (c) 2004-2008 Cyril Jaquier, 2012-2014 Yaroslav Halchenko, 2014-2016 Serg G. Brester"
__license__ = "GPL"
import getopt, sys, os
from fail2ban.version import version
from fail2ban.server.server import Server
from fail2ban.helpers import getLogger
# Gets the instance of the logger.
logSys = getLogger("fail2ban")
##
# \mainpage Fail2Ban
#
# \section Introduction
#
# Fail2ban is designed to protect your server against brute force attacks.
# Its first goal was to protect a SSH server.
class Fail2banServer:
def __init__(self):
self.__server = None
self.__argv = None
self.__conf = dict()
self.__conf["background"] = True
self.__conf["force"] = False
self.__conf["socket"] = "/var/run/fail2ban/fail2ban.sock"
self.__conf["pidfile"] = "/var/run/fail2ban/fail2ban.pid"
def dispVersion(self):
print "Fail2Ban v" + version
print
print "Copyright (c) 2004-2008 Cyril Jaquier, 2008- Fail2Ban Contributors"
print "Copyright of modifications held by their respective authors."
print "Licensed under the GNU General Public License v2 (GPL)."
print
print "Written by Cyril Jaquier <cyril.jaquier@fail2ban.org>."
print "Many contributions by Yaroslav O. Halchenko <debian@onerussian.com>."
def dispUsage(self):
""" Prints Fail2Ban command line options and exits
"""
print "Usage: "+self.__argv[0]+" [OPTIONS]"
print
print "Fail2Ban v" + version + " reads log file that contains password failure report"
print "and bans the corresponding IP addresses using firewall rules."
print
print "Only use this command for debugging purpose. Start the server with"
print "fail2ban-client instead. The default behaviour is to start the server"
print "in background."
print
print "Options:"
print " -b start in background"
print " -f start in foreground"
print " -s <FILE> socket path"
print " -p <FILE> pidfile path"
print " -x force execution of the server (remove socket file)"
print " -h, --help display this help message"
print " -V, --version print the version"
print
print "Report bugs to https://github.com/fail2ban/fail2ban/issues"
def __getCmdLineOptions(self, optList):
""" Gets the command line options
"""
for opt in optList:
if opt[0] == "-b":
self.__conf["background"] = True
if opt[0] == "-f":
self.__conf["background"] = False
if opt[0] == "-s":
self.__conf["socket"] = opt[1]
if opt[0] == "-p":
self.__conf["pidfile"] = opt[1]
if opt[0] == "-x":
self.__conf["force"] = True
if opt[0] in ["-h", "--help"]:
self.dispUsage()
sys.exit(0)
if opt[0] in ["-V", "--version"]:
self.dispVersion()
sys.exit(0)
def start(self, argv):
# Command line options
self.__argv = argv
# Reads the command line options.
try:
cmdOpts = 'bfs:p:xhV'
cmdLongOpts = ['help', 'version']
optList, args = getopt.getopt(self.__argv[1:], cmdOpts, cmdLongOpts)
except getopt.GetoptError:
self.dispUsage()
sys.exit(-1)
self.__getCmdLineOptions(optList)
try:
self.__server = Server(self.__conf["background"])
self.__server.start(self.__conf["socket"],
self.__conf["pidfile"],
self.__conf["force"])
return True
except Exception, e:
logSys.exception(e)
self.__server.quit()
return False
from fail2ban.client.fail2banserver import exec_command_line, sys
if __name__ == "__main__":
server = Fail2banServer()
if server.start(sys.argv):
sys.exit(0)
else:
sys.exit(-1)
exec_command_line(sys.argv)
+21 -79
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
"""Script to run Fail2Ban tests battery
@@ -25,99 +25,41 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2012- Yaroslav Halchenko"
__license__ = "GPL"
import logging
import unittest, sys, time, os
import os
import sys
import time
import unittest
# Check if local fail2ban module exists, and use if it exists by
# modifying the path. This is such that tests can be used in dev
# Check if local fail2ban module exists, and use if it exists by
# modifying the path. This is done so that tests can be used in dev
# environment.
if os.path.exists("fail2ban/__init__.py"):
sys.path.insert(0, ".")
from fail2ban.version import version
from fail2ban.tests.utils import gatherTests
from fail2ban.helpers import FormatterWithTraceBack, getLogger
from fail2ban.server.mytime import MyTime
from fail2ban.tests.utils import getOptParser, initProcess, gatherTests
from fail2ban.setup import updatePyExec
from optparse import OptionParser, Option
# Update fail2ban-python env to current python version (where f2b-modules located/installed)
bindir = os.path.dirname(
# __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.):
sys.argv[0] if os.path.basename(sys.argv[0]) == 'fail2ban-testcases' else __file__
)
updatePyExec(bindir)
def get_opt_parser():
# use module docstring for help output
p = OptionParser(
usage="%s [OPTIONS] [regexps]\n" % sys.argv[0] + __doc__,
version="%prog " + version)
p.add_options([
Option('-l', "--log-level", type="choice",
dest="log_level",
choices=('heavydebug', 'debug', 'info', 'notice', 'warning', 'error', 'critical'),
default=None,
help="Log level for the logger to use during running tests"),
Option('-n', "--no-network", action="store_true",
dest="no_network",
help="Do not run tests that require the network"),
Option("-t", "--log-traceback", action='store_true',
help="Enrich log-messages with compressed tracebacks"),
Option("--full-traceback", action='store_true',
help="Either to make the tracebacks full, not compressed (as by default)"),
])
return p
parser = get_opt_parser()
(opts, regexps) = parser.parse_args()
(opts, regexps) = getOptParser(__doc__).parse_args()
#
# Logging
# Process initialization corresponding options (logging, default options, etc.)
#
logSys = getLogger("fail2ban")
# Numerical level of verbosity corresponding to a log "level"
verbosity = {'heavydebug': 4,
'debug': 3,
'info': 2,
'notice': 2,
'warning': 1,
'error': 1,
'critical': 0,
None: 1}[opts.log_level]
if opts.log_level is not None: # pragma: no cover
# so we had explicit settings
logSys.setLevel(getattr(logging, opts.log_level.upper()))
else: # pragma: no cover
# suppress the logging but it would leave unittests' progress dots
# ticking, unless like with '-l critical' which would be silent
# unless error occurs
logSys.setLevel(getattr(logging, 'CRITICAL'))
# Add the default logging handler
stdout = logging.StreamHandler(sys.stdout)
fmt = ' %(message)s'
if opts.log_traceback:
Formatter = FormatterWithTraceBack
fmt = (opts.full_traceback and ' %(tb)s' or ' %(tbc)s') + fmt
else:
Formatter = logging.Formatter
# Custom log format for the verbose tests runs
if verbosity > 1: # pragma: no cover
stdout.setFormatter(Formatter(' %(asctime)-15s %(thread)s' + fmt))
else: # pragma: no cover
# just prefix with the space
stdout.setFormatter(Formatter(fmt))
logSys.addHandler(stdout)
opts = initProcess(opts)
verbosity = opts.verbosity
#
# Let know the version
# Gather tests (and filter corresponding options)
#
if not opts.log_level or opts.log_level != 'critical': # pragma: no cover
print("Fail2ban %s test suite. Python %s. Please wait..." \
% (version, str(sys.version).replace('\n', '')))
tests = gatherTests(regexps, opts)
tests = gatherTests(regexps, opts.no_network)
#
# Run the tests
#
+105
View File
@@ -0,0 +1,105 @@
# Fail2ban configuration file
#
# Action to report IP address to abuseipdb.com
# You must sign up to obtain an API key from abuseipdb.com.
#
# NOTE: These reports may include sensitive Info.
# If you want cleaner reports that ensure no user data see the helper script at the below website.
#
# IMPORTANT:
#
# Reporting an IP of abuse is a serious complaint. Make sure that it is
# serious. Fail2ban developers and network owners recommend you only use this
# action for:
# * The recidive where the IP has been banned multiple times
# * Where maxretry has been set quite high, beyond the normal user typing
# password incorrectly.
# * For filters that have a low likelihood of receiving human errors
#
# This action relies on a api_key being added to the above action conf,
# and the appropriate categories set.
#
# Example, for ssh bruteforce (in section [sshd] of `jail.local`):
# action = %(known/action)s
# %(action_abuseipdb)s[abuseipdb_apikey="my-api-key", abuseipdb_category="18,22"]
#
# See below for catagories.
#
# Original Ref: https://wiki.shaunc.com/wikka.php?wakka=ReportingToAbuseIPDBWithFail2Ban
# Added to fail2ban by Andrew James Collett (ajcollett)
## abuseIPDB Catagories, `the abuseipdb_category` MUST be set in the jail.conf action call.
# Example, for ssh bruteforce: action = %(action_abuseipdb)s[abuseipdb_category="18,22"]
# ID Title Description
# 3 Fraud Orders
# 4 DDoS Attack
# 9 Open Proxy
# 10 Web Spam
# 11 Email Spam
# 14 Port Scan
# 18 Brute-Force
# 19 Bad Web Bot
# 20 Exploited Host
# 21 Web App Attack
# 22 SSH Secure Shell (SSH) abuse. Use this category in combination with more specific categories.
# 23 IoT Targeted
# See https://abuseipdb.com/categories for more descriptions
[Definition]
# bypass action for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
#
# ** IMPORTANT! **
#
# By default, this posts directly to AbuseIPDB's API, unfortunately
# this results in a lot of backslashes/escapes appearing in the
# reports. This also may include info like your hostname.
# If you have your own web server with PHP available, you can
# use my (Shaun's) helper PHP script by commenting out the first #actionban
# line below, uncommenting the second one, and pointing the URL at
# wherever you install the helper script. For the PHP helper script, see
# <https://wiki.shaunc.com/wikka.php?wakka=ReportingToAbuseIPDBWithFail2Ban>
#
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = lgm=$(printf '%%.1000s\n...' "<matches>"); curl -sSf "https://api.abuseipdb.com/api/v2/report" -H "Accept: application/json" -H "Key: <abuseipdb_apikey>" --data-urlencode "comment=$lgm" --data-urlencode "ip=<ip>" --data "categories=<abuseipdb_category>"
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban =
[Init]
# Option: abuseipdb_apikey
# Notes Your API key from abuseipdb.com
# Values: STRING Default: None
# Register for abuseipdb [https://www.abuseipdb.com], get api key and set below.
# You will need to set the category in the action call.
abuseipdb_apikey =
+2 -2
View File
@@ -1,6 +1,6 @@
# Fail2ban reporting to badips.com
#
# Note: This reports and IP only and does not actually ban traffic. Use
# Note: This reports an IP only and does not actually ban traffic. Use
# another action in the same jail if you want bans to occur.
#
# Set the category to the appropriate value before use.
@@ -10,7 +10,7 @@
[Definition]
actionban = curl --fail --user-agent "fail2ban v0.8.12" http://www.badips.com/add/<category>/<ip>
actionban = curl --fail --user-agent "<agent>" http://www.badips.com/add/<category>/<ip>
[Init]
+92 -64
View File
@@ -18,24 +18,25 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
if sys.version_info < (2, 7):
if sys.version_info < (2, 7): # pragma: no cover
raise ImportError("badips.py action requires Python >= 2.7")
import json
from functools import partial
import threading
import logging
if sys.version_info >= (3, ):
if sys.version_info >= (3, ): # pragma: 2.x no cover
from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
else:
else: # pragma: 3.x no cover
from urllib2 import Request, urlopen, HTTPError
from urllib import urlencode
from fail2ban.server.actions import ActionBase
from fail2ban.version import version as f2bVersion
from fail2ban.server.actions import Actions, ActionBase, BanTicket
from fail2ban.helpers import splitwords, str2LogLevel
class BadIPsAction(ActionBase):
class BadIPsAction(ActionBase): # pragma: no cover - may be unavailable
"""Fail2Ban action which reports bans to badips.com, and also
blacklist bad IPs listed on badips.com by using another action's
ban method.
@@ -53,9 +54,6 @@ class BadIPsAction(ActionBase):
age : str, optional
Age of last report for bad IPs, per badips.com syntax.
Default "24h" (24 hours)
key : str, optional
Key issued by badips.com to report bans, for later retrieval
of personalised content.
banaction : str, optional
Name of banaction to use for blacklisting bad IPs. If `None`,
no blacklist of IPs will take place.
@@ -66,11 +64,20 @@ class BadIPsAction(ActionBase):
"postfix", but want to use whole "mail" category for blacklist.
Default `category`.
bankey : str, optional
Key issued by badips.com to blacklist IPs reported with the
associated key.
Key issued by badips.com to retrieve personal list
of blacklist IPs.
updateperiod : int, optional
Time in seconds between updating bad IPs blacklist.
Default 900 (15 minutes)
loglevel : int/str, optional
Log level of the message when an IP is (un)banned.
Default `DEBUG`.
Can be also supplied as two-value list (comma- or space separated) to
provide level of the summary message when a group of IPs is (un)banned.
Example `DEBUG,INFO`.
agent : str, optional
User agent transmitted to server.
Default `Fail2Ban/ver.`
Raises
------
@@ -78,27 +85,52 @@ class BadIPsAction(ActionBase):
If invalid `category`, `score`, `banaction` or `updateperiod`.
"""
_badips = "http://www.badips.com"
_Request = partial(
Request, headers={'User-Agent': "Fail2Ban %s" % f2bVersion})
TIMEOUT = 10
_badips = "https://www.badips.com"
def _Request(self, url, **argv):
return Request(url, headers={'User-Agent': self.agent}, **argv)
def __init__(self, jail, name, category, score=3, age="24h", key=None,
banaction=None, bancategory=None, bankey=None, updateperiod=900):
def __init__(self, jail, name, category, score=3, age="24h",
banaction=None, bancategory=None, bankey=None, updateperiod=900,
loglevel='DEBUG', agent="Fail2Ban", timeout=TIMEOUT):
super(BadIPsAction, self).__init__(jail, name)
self.timeout = timeout
self.agent = agent
self.category = category
self.score = score
self.age = age
self.key = key
self.banaction = banaction
self.bancategory = bancategory or category
self.bankey = bankey
loglevel = splitwords(loglevel)
self.sumloglevel = str2LogLevel(loglevel[-1])
self.loglevel = str2LogLevel(loglevel[0])
self.updateperiod = updateperiod
self._bannedips = set()
# Used later for threading.Timer for updating badips
self._timer = None
@staticmethod
def isAvailable(timeout=1):
try:
response = urlopen(Request("/".join([BadIPsAction._badips]),
headers={'User-Agent': "Fail2Ban"}), timeout=timeout)
return True, ''
except Exception as e: # pragma: no cover
return False, e
def logError(self, response, what=''): # pragma: no cover - sporadical (502: Bad Gateway, etc)
messages = {}
try:
messages = json.loads(response.read().decode('utf-8'))
except:
pass
self._logSys.error(
"%s. badips.com response: '%s'", what,
messages.get('err', 'Unknown'))
def getCategories(self, incParents=False):
"""Get badips.com categories.
@@ -111,18 +143,23 @@ class BadIPsAction(ActionBase):
------
HTTPError
Any issues with badips.com request.
ValueError
If badips.com response didn't contain necessary information
"""
try:
response = urlopen(
self._Request("/".join([self._badips, "get", "categories"])))
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Failed to fetch categories. badips.com response: '%s'",
messages['err'])
self._Request("/".join([self._badips, "get", "categories"])), timeout=self.timeout)
except HTTPError as response: # pragma: no cover
self.logError(response, "Failed to fetch categories")
raise
else:
categories = json.loads(response.read().decode('utf-8'))['categories']
response_json = json.loads(response.read().decode('utf-8'))
if not 'categories' in response_json:
err = "badips.com response lacked categories specification. Response was: %s" \
% (response_json,)
self._logSys.error(err)
raise ValueError(err)
categories = response_json['categories']
categories_names = set(
value['Name'] for value in categories)
if incParents:
@@ -162,12 +199,10 @@ class BadIPsAction(ActionBase):
urlencode({'age': age})])
if key:
url = "&".join([url, urlencode({'key': key})])
response = urlopen(self._Request(url))
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Failed to fetch bad IP list. badips.com response: '%s'",
messages['err'])
self._logSys.debug('badips.com: get list, url: %r', url)
response = urlopen(self._Request(url), timeout=self.timeout)
except HTTPError as response: # pragma: no cover
self.logError(response, "Failed to fetch bad IP list")
raise
else:
return set(response.read().decode('utf-8').split())
@@ -195,7 +230,7 @@ class BadIPsAction(ActionBase):
@bancategory.setter
def bancategory(self, bancategory):
if bancategory not in self.getCategories(incParents=True):
if bancategory != "any" and bancategory not in self.getCategories(incParents=True):
self._logSys.error("Category name '%s' not valid. "
"see badips.com for list of valid categories",
bancategory)
@@ -247,13 +282,8 @@ class BadIPsAction(ActionBase):
def _banIPs(self, ips):
for ip in ips:
try:
self._jail.actions[self.banaction].ban({
'ip': ip,
'failures': 0,
'matches': "",
'ipmatches': "",
'ipjailmatches': "",
})
ai = Actions.ActionInfo(BanTicket(ip), self._jail)
self._jail.actions[self.banaction].ban(ai)
except Exception as e:
self._logSys.error(
"Error banning IP %s for jail '%s' with action '%s': %s",
@@ -261,27 +291,22 @@ class BadIPsAction(ActionBase):
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
else:
self._bannedips.add(ip)
self._logSys.info(
self._logSys.log(self.loglevel,
"Banned IP %s for jail '%s' with action '%s'",
ip, self._jail.name, self.banaction)
def _unbanIPs(self, ips):
for ip in ips:
try:
self._jail.actions[self.banaction].unban({
'ip': ip,
'failures': 0,
'matches': "",
'ipmatches': "",
'ipjailmatches': "",
})
ai = Actions.ActionInfo(BanTicket(ip), self._jail)
self._jail.actions[self.banaction].unban(ai)
except Exception as e:
self._logSys.info(
self._logSys.error(
"Error unbanning IP %s for jail '%s' with action '%s': %s",
ip, self._jail.name, self.banaction, e,
exc_info=self._logSys.getEffectiveLevel()<=logging.DEBUG)
else:
self._logSys.info(
self._logSys.log(self.loglevel,
"Unbanned IP %s for jail '%s' with action '%s'",
ip, self._jail.name, self.banaction)
finally:
@@ -309,12 +334,19 @@ class BadIPsAction(ActionBase):
ips = self.getList(
self.bancategory, self.score, self.age, self.bankey)
# Remove old IPs no longer listed
self._unbanIPs(self._bannedips - ips)
s = self._bannedips - ips
m = len(s)
self._unbanIPs(s)
# Add new IPs which are now listed
self._banIPs(ips - self._bannedips)
self._logSys.info(
"Updated IPs for jail '%s'. Update again in %i seconds",
s = ips - self._bannedips
p = len(s)
self._banIPs(s)
if m != 0 or p != 0:
self._logSys.log(self.sumloglevel,
"Updated IPs for jail '%s' (-%d/+%d)",
self._jail.name, m, p)
self._logSys.debug(
"Next update for jail '%' in %i seconds",
self._jail.name, self.updateperiod)
finally:
self._timer = threading.Timer(self.updateperiod, self.update)
@@ -344,19 +376,15 @@ class BadIPsAction(ActionBase):
Any issues with badips.com request.
"""
try:
url = "/".join([self._badips, "add", self.category, aInfo['ip']])
if self.key:
url = "?".join([url, urlencode({'key': self.key})])
response = urlopen(self._Request(url))
except HTTPError as response:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.error(
"Response from badips.com report: '%s'",
messages['err'])
url = "/".join([self._badips, "add", self.category, str(aInfo['ip'])])
self._logSys.debug('badips.com: ban, url: %r', url)
response = urlopen(self._Request(url), timeout=self.timeout)
except HTTPError as response: # pragma: no cover
self.logError(response, "Failed to ban")
raise
else:
messages = json.loads(response.read().decode('utf-8'))
self._logSys.info(
self._logSys.debug(
"Response from badips.com report: '%s'",
messages['suc'])
+4 -6
View File
@@ -31,13 +31,13 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -54,7 +54,7 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = curl --fail --data-urlencode 'server=<email>' --data 'apikey=<apikey>' --data 'service=<service>' --data 'ip=<ip>' --data-urlencode 'logs=<matches>' --data 'format=text' --user-agent "fail2ban v0.8.12" "https://www.blocklist.de/en/httpreports.html"
actionban = curl --fail --data-urlencode "server=<email>" --data "apikey=<apikey>" --data "service=<service>" --data "ip=<ip>" --data-urlencode "logs=<matches><br>" --data 'format=text' --user-agent "<agent>" "https://www.blocklist.de/en/httpreports.html"
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -64,10 +64,8 @@ actionban = curl --fail --data-urlencode 'server=<email>' --data 'apikey=<apikey
#
actionunban =
[Init]
# Option: email
# Notes server email address, as per blocklise.de account
# Notes server email address, as per blocklist.de account
# Values: STRING Default: None
#
#email =
+13 -5
View File
@@ -11,14 +11,14 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = ipfw show | fgrep -q 'table(<table>)' || ( ipfw show | awk 'BEGIN { b = 1 } { if ($1 <= b) { b = $1 + 1 } else { e = b } } END { if (e) exit e <br> else exit b }'; num=$?; ipfw -q add $num <blocktype> <block> from table\(<table>\) to me <port>; echo $num > "<startstatefile>" )
actionstart = ipfw show | fgrep -c -m 1 -s 'table(<table>)' > /dev/null 2>&1 || ( ipfw show | awk 'BEGIN { b = <lowest_rule_num> } { if ($1 < b) {} else if ($1 == b) { b = $1 + 1 } else { e = b } } END { if (e) exit e <br> else exit b }'; num=$?; ipfw -q add $num <blocktype> <block> from table\(<table>\) to me <port>; echo $num > "<startstatefile>" )
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = [ ! -f <startstatefile> ] || ( read num < "<startstatefile>" <br> ipfw -q delete $num <br> rm "<startstatefile>" )
@@ -38,7 +38,7 @@ actioncheck =
# Values: CMD
#
# requires an ipfw rule like "deny ip from table(1) to me"
actionban = ipfw table <table> add <ip>
actionban = e=`ipfw table <table> add <ip> 2>&1`; x=$?; [ $x -eq 0 -o "$e" = 'ipfw: setsockopt(IP_FW_TABLE_XADD): File exists' ] || echo "$e" | grep -q "record already exists" || { echo "$e" 1>&2; exit $x; }
# Option: actionunban
@@ -47,7 +47,7 @@ actionban = ipfw table <table> add <ip>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = ipfw table <table> delete <ip>
actionunban = e=`ipfw table <table> delete <ip> 2>&1`; x=$?; [ $x -eq 0 -o "$e" = 'ipfw: setsockopt(IP_FW_TABLE_XDEL): No such process' ] || echo "$e" | grep -q "record not found" || { echo "$e" 1>&2; exit $x; }
[Init]
# Option: table
@@ -81,3 +81,11 @@ block = ip
# Values: STRING
#
blocktype = unreach port
# Option: lowest_rule_num
# Notes: When fail2ban starts with action and there is no rule for the given table yet
# then fail2ban will start looking for an empty slot starting with this rule number.
# Values: NUM
lowest_rule_num = 111
+34 -11
View File
@@ -1,21 +1,27 @@
#
# Author: Mike Rushton
#
# Referenced from from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
# IMPORTANT
#
# To get your Cloudflare API key: https://www.cloudflare.com/my-account
# Please set jail.local's permission to 640 because it contains your CF API key.
#
# This action depends on curl.
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
#
# To get your CloudFlare API Key: https://www.cloudflare.com/a/account/my-account
#
# CloudFlare API error codes: https://www.cloudflare.com/docs/host-api.html#s4.2
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -34,7 +40,13 @@ actioncheck =
# <time> unix timestamp of the ban time
# Values: CMD
#
actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v1
#actionban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v4
actionban = curl -s -o /dev/null -X POST -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
-H 'Content-Type: application/json' -d '{ "mode": "block", "configuration": { "target": "ip", "value": "<ip>" } }' \
https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
@@ -43,13 +55,24 @@ actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cf
# <time> unix timestamp of the ban time
# Values: CMD
#
actionunban = curl https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v1
#actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v4
actionunban = curl -s -o /dev/null -X DELETE -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules/$(curl -s -X GET -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' \
'https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules?mode=block&configuration_target=ip&configuration_value=<ip>&page=1&per_page=1' | cut -d'"' -f6)
[Init]
# Default Cloudflare API token
cftoken =
# If you like to use this action with mailing whois lines, you could use the composite action
# action_cf_mwl predefined in jail.conf, just define in your jail:
#
# action = %(action_cf_mwl)s
# # Your CF account e-mail
# cfemail =
# # Your CF API Key
# cfapikey =
# Default Cloudflare username
cfuser =
cftoken =
cfuser =
+33 -6
View File
@@ -28,16 +28,26 @@
#
[INCLUDES]
before = helpers-common.conf
[Definition]
# Used in test cases for coverage internal transformations
debug = 0
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -54,10 +64,18 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = oifs=${IFS}; IFS=.;SEP_IP=( <ip> ); set -- ${SEP_IP}; ADDRESSES=$(dig +short -t txt -q $4.$3.$2.$1.abuse-contacts.abusix.org); IFS=${oifs}
IP=<ip>
actionban = oifs=${IFS};
RESOLVER_ADDR="%(addr_resolver)s"
if [ "<debug>" -gt 0 ]; then echo "try to resolve $RESOLVER_ADDR"; fi
ADDRESSES=$(dig +short -t txt -q $RESOLVER_ADDR | tr -d '"')
IFS=,; ADDRESSES=$(echo $ADDRESSES)
IFS=${oifs}
IP=<ip>
if [ ! -z "$ADDRESSES" ]; then
(printf %%b "<message>\n"; date '+Note: Local timezone is %%z (%%Z)'; grep -E '(^|[^0-9])<ip>([^0-9]|$)' <logpath>) | <mailcmd> "Abuse from <ip>" <mailargs> ${ADDRESSES//,/\" \"}
( printf %%b "<message>\n"; date '+Note: Local timezone is %%z (%%Z)';
printf %%b "\nLines containing failures of <ip> (max <grepmax>)\n";
%(_grep_logs)s;
) | <mailcmd> "Abuse from <ip>" <mailargs> $ADDRESSES
fi
# Option: actionunban
@@ -68,7 +86,12 @@ actionban = oifs=${IFS}; IFS=.;SEP_IP=( <ip> ); set -- ${SEP_IP}; ADDRESSES=$(di
#
actionunban =
[Init]
# Server as resolver used in dig command
#
addr_resolver = <ip-rev>abuse-contacts.abusix.org
# Default message used for abuse content
#
message = Dear Sir/Madam,\n\nWe have detected abuse from the IP address $IP, which according to a abusix.com is on your network. We would appreciate if you would investigate and take action as appropriate.\n\nLog lines are given below, but please ask if you require any further information.\n\n(If you are not the correct person to contact about this please accept our apologies - your e-mail address was extracted from the whois record by an automated process.)\n\n This mail was generated by Fail2Ban.\nThe recipient address of this report was provided by the Abuse Contact DB by abusix.com. abusix.com does not maintain the content of the database. All information which we pass out, derives from the RIR databases and is processed for ease of use. If you want to change or report non working abuse contacts please contact the appropriate RIR. If you have any further question, contact abusix.com directly via email (info@abusix.com). Information about the Abuse Contact Database can be found here: https://abusix.com/global-reporting/abuse-contact-db\nabusix.com is neither responsible nor liable for the content or accuracy of this message.\n
# Path to the log files which contain relevant lines for the abuser IP
@@ -92,3 +115,7 @@ mailcmd = mail -s
#
mailargs =
# Number of log lines to include in the email
#
#grepmax = 1000
#grepopts = -m <grepmax>
+5 -2
View File
@@ -28,14 +28,17 @@
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = if [ -f <tmpfile>.buffer ]; then
+23 -7
View File
@@ -7,17 +7,26 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = touch /var/run/fail2ban/fail2ban.dummy
printf %%b "<init>\n" >> /var/run/fail2ban/fail2ban.dummy
actionstart = if [ ! -z '<target>' ]; then touch <target>; fi;
printf %%b "<init>\n" <to_target>
echo "%(debug)s started"
# Option: actionflush
# Notes.: command executed once to flush (clear) all IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = printf %%b "-*\n" <to_target>
echo "%(debug)s clear all"
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = rm -f /var/run/fail2ban/fail2ban.dummy
actionstop = if [ ! -z '<target>' ]; then rm -f <target>; fi;
echo "%(debug)s stopped"
# Option: actioncheck
# Notes.: command executed once before each actionban command
@@ -31,7 +40,8 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "+<ip>\n" >> /var/run/fail2ban/fail2ban.dummy
actionban = printf %%b "+<ip>\n" <to_target>
echo "%(debug)s banned <ip> (family: <family>)"
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -39,9 +49,15 @@ actionban = printf %%b "+<ip>\n" >> /var/run/fail2ban/fail2ban.dummy
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = printf %%b "-<ip>\n" >> /var/run/fail2ban/fail2ban.dummy
actionunban = printf %%b "-<ip>\n" <to_target>
echo "%(debug)s unbanned <ip> (family: <family>)"
debug = [<name>] <actname> <target> --
[Init]
init = 123
target = /var/run/fail2ban/fail2ban.dummy
to_target = >> <target>
+45
View File
@@ -0,0 +1,45 @@
# Fail2Ban configuration file
#
# Author: Donald Yandt
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
[INCLUDES]
before = firewallcmd-common.conf
[Definition]
actionstart = firewall-cmd --direct --add-chain <family> filter f2b-<name>
firewall-cmd --direct --add-rule <family> filter f2b-<name> 1000 -j RETURN
firewall-cmd --direct --add-rule <family> filter <chain> 0 -j f2b-<name>
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 -j f2b-<name>
firewall-cmd --direct --remove-rules <family> filter f2b-<name>
firewall-cmd --direct --remove-chain <family> filter f2b-<name>
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-recidive$'
actioncheck = firewall-cmd --direct --get-chains <family> filter | sed -e 's, ,\n,g' | grep -q '^f2b-<name>$'
actionban = firewall-cmd --direct --add-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
actionunban = firewall-cmd --direct --remove-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
# DEV NOTES:
#
# Author: Donald Yandt
# Uses "FirewallD" instead of the "iptables daemon".
#
#
# Output:
# actionstart:
# $ firewall-cmd --direct --add-chain ipv4 filter f2b-recidive
# success
# $ firewall-cmd --direct --add-rule ipv4 filter f2b-recidive 1000 -j RETURN
# success
# $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -j f2b-recidive
# success
+76
View File
@@ -0,0 +1,76 @@
# Fail2Ban configuration file
#
# Author: Donald Yandt
#
[Init]
# Option: name
# Notes Default name of the chain
# Values: STRING
name = default
# Option port
# Notes Can also use port numbers separated by a comma and in rich-rules comma and/or space.
# Value STRING Default: 1:65535
port = 1:65535
# Option: protocol
# Notes [ tcp | udp | icmp | all ]
# Values: STRING Default: tcp
protocol = tcp
# Option: family(ipv4)
# Notes specifies the socket address family type
# Values: STRING
family = ipv4
# Option: chain
# Notes specifies the firewalld chain to which the Fail2Ban rules should be
# added
# Values: STRING Default: INPUT_direct
chain = INPUT_direct
# Option: zone
# Notes use command firewall-cmd --get-active-zones to see a list of all active zones. See firewalld man pages for more information on zones
# Values: STRING Default: public
zone = public
# Option: service
# Notes use command firewall-cmd --get-services to see a list of services available
# Examples services: amanda-client amanda-k5-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns freeipa-ldap freeipa-ldaps
# freeipa-replication ftp high-availability http https imaps ipp ipp-client ipsec iscsi-target kadmin kerberos
# kpasswd ldap ldaps libvirt libvirt-tls mdns mosh mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s
# postgresql privoxy proxy-dhcp puppetmaster radius rpc-bind rsyncd samba samba-client sane smtp squid ssh synergy
# telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
# Values: STRING Default: ssh
service = ssh
# Option: rejecttype (ipv4)
# Notes See iptables/firewalld man pages for ipv4 reject types.
# Values: STRING
rejecttype = icmp-port-unreachable
# Option: blocktype (ipv4/ipv6)
# Notes See iptables/firewalld man pages for jump targets. Common values are REJECT,
# REJECT --reject-with icmp-port-unreachable, DROP
# Values: STRING
blocktype = REJECT --reject-with <rejecttype>
# Option: rich-blocktype (ipv4/ipv6)
# Notes See firewalld man pages for jump targets. Common values are reject,
# reject type="icmp-port-unreachable", drop
# Values: STRING
rich-blocktype = reject type='<rejecttype>'
[Init?family=inet6]
# Option: family(ipv6)
# Notes specifies the socket address family type
# Values: STRING
family = ipv6
# Option: rejecttype (ipv6)
# Note: See iptables/firewalld man pages for ipv6 reject types.
# Values: STRING
rejecttype = icmp6-port-unreachable
+40 -11
View File
@@ -14,20 +14,24 @@
[INCLUDES]
before = iptables-common.conf
before = firewallcmd-common.conf
[Definition]
actionstart = ipset create fail2ban-<name> hash:ip timeout <bantime>
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
firewall-cmd --direct --add-rule <family> filter <chain> 0 <actiontype> -m set --match-set <ipmset> src -j <blocktype>
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
ipset flush fail2ban-<name>
ipset destroy fail2ban-<name>
actionflush = ipset flush <ipmset>
actionban = ipset add fail2ban-<name> <ip> timeout <bantime> -exist
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 <actiontype> -m set --match-set <ipmset> src -j <blocktype>
<actionflush>
ipset destroy <ipmset>
actionunban = ipset del fail2ban-<name> <ip> -exist
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
actionprolong = %(actionban)s
actionunban = ipset del <ipmset> <ip> -exist
[Init]
@@ -38,11 +42,36 @@ actionunban = ipset del fail2ban-<name> <ip> -exist
#
chain = INPUT_direct
# Option: bantime
# Notes: specifies the bantime in seconds (handled internally rather than by fail2ban)
# Option: default-timeout
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
# Values: [ NUM ] Default: 600
bantime = 600
default-timeout = 600
# Option: actiontype
# Notes.: defines additions to the blocking rule
# Values: leave empty to block all attempts from the host
# Default: Value of the multiport
actiontype = <multiport>
# Option: allports
# Notes.: default addition to block all ports
# Usage.: use in jail config: banaction = firewallcmd-ipset[actiontype=<allports>]
# for all protocols: banaction = firewallcmd-ipset[actiontype=""]
allports = -p <protocol>
# Option: multiport
# Notes.: addition to block access only to specific ports
# Usage.: use in jail config: banaction = firewallcmd-ipset[actiontype=<multiport>]
multiport = -p <protocol> -m multiport --dports <port>
ipmset = f2b-<name>
familyopt =
[Init?family=inet6]
ipmset = f2b-<name>6
familyopt = <sp>family inet6
# DEV NOTES:
@@ -0,0 +1,26 @@
# Fail2Ban configuration file
#
# Author: Donald Yandt
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
[INCLUDES]
before = firewallcmd-common.conf
[Definition]
actionstart = firewall-cmd --direct --add-chain <family> filter f2b-<name>
firewall-cmd --direct --add-rule <family> filter f2b-<name> 1000 -j RETURN
firewall-cmd --direct --add-rule <family> filter <chain> 0 -m conntrack --ctstate NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 -m conntrack --ctstate NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
firewall-cmd --direct --remove-rules <family> filter f2b-<name>
firewall-cmd --direct --remove-chain <family> filter f2b-<name>
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-apache-modsecurity$'
actioncheck = firewall-cmd --direct --get-chains <family> filter | sed -e 's, ,\n,g' | grep -q '^f2b-<name>$'
actionban = firewall-cmd --direct --add-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
actionunban = firewall-cmd --direct --remove-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
+11 -20
View File
@@ -4,32 +4,23 @@
[INCLUDES]
before = iptables-common.conf
before = firewallcmd-common.conf
[Definition]
actionstart = firewall-cmd --direct --add-chain ipv4 filter f2b-<name>
firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 1000 -j RETURN
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
actionstart = firewall-cmd --direct --add-chain <family> filter f2b-<name>
firewall-cmd --direct --add-rule <family> filter f2b-<name> 1000 -j RETURN
firewall-cmd --direct --add-rule <family> filter <chain> 0 -m state --state NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
firewall-cmd --direct --remove-rules ipv4 filter f2b-<name>
firewall-cmd --direct --remove-chain ipv4 filter f2b-<name>
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 -m state --state NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
firewall-cmd --direct --remove-rules <family> filter f2b-<name>
firewall-cmd --direct --remove-chain <family> filter f2b-<name>
actioncheck = firewall-cmd --direct --get-chains ipv4 filter | grep -q 'f2b-<name>$'
actioncheck = firewall-cmd --direct --get-chains <family> filter | sed -e 's, ,\n,g' | grep -q 'f2b-<name>$'
actionban = firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 0 -s <ip> -j <blocktype>
actionban = firewall-cmd --direct --add-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
actionunban = firewall-cmd --direct --remove-rule ipv4 filter f2b-<name> 0 -s <ip> -j <blocktype>
[Init]
# Option: chain
# Notes specifies the iptables chain to which the fail2ban rules should be
# added
# Values: [ STRING ]
#
chain = INPUT_direct
actionunban = firewall-cmd --direct --remove-rule <family> filter f2b-<name> 0 -s <ip> -j <blocktype>
# DEV NOTES:
#
@@ -43,7 +34,7 @@ chain = INPUT_direct
# success
# $ firewall-cmd --direct --add-rule ipv4 filter fail2ban-name 1000 -j RETURN
# success
# $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -m state --state NEW -p tcp --dport 22 -j fail2ban-name
# $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -m state --state NEW -p tcp -m multiport --dports 22 -j fail2ban-name
# success
# $ firewall-cmd --direct --get-chains ipv4 filter
# fail2ban-name
@@ -0,0 +1,51 @@
# Fail2Ban configuration file
#
# Author: Donald Yandt
#
# Because of the rich rule commands requires firewalld-0.3.1+
# This action uses firewalld rich-rules which gives you a cleaner iptables since it stores rules according to zones and not
# by chain. So for an example all deny rules will be listed under <zone>_deny and all log rules under <zone>_log.
#
# Also this action logs banned access attempts so you can filter that and increase ban time for offenders.
#
# If you use the --permanent rule you get a xml file in /etc/firewalld/zones/<zone>.xml that can be shared and parsed easliy
#
# Example commands to view rules:
# firewall-cmd [--zone=<zone>] --list-rich-rules
# firewall-cmd [--zone=<zone>] --list-all
# firewall-cmd [--zone=zone] --query-rich-rule='rule'
[INCLUDES]
before = firewallcmd-common.conf
[Definition]
actionstart =
actionstop =
actioncheck =
# you can also use zones and/or service names.
#
# zone example:
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='<family>' source address='<ip>' port port='<port>' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"
#
# service name example:
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='<family>' source address='<ip>' service name='<service>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"
#
# Because rich rules can only handle single or a range of ports we must split ports and execute the command for each port. Ports can be single and ranges separated by a comma or space for an example: http, https, 22-60, 18 smtp
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"; done
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' log prefix='f2b-<name>' level='<level>' limit value='<rate>/m' <rich-blocktype>"; done
[Init]
# log levels are "emerg", "alert", "crit", "error", "warning", "notice", "info" or "debug"
level = info
# log rate per minute
rate = 1
@@ -0,0 +1,42 @@
# Fail2Ban configuration file
#
# Author: Donald Yandt
#
# Because of the rich rule commands requires firewalld-0.3.1+
# This action uses firewalld rich-rules which gives you a cleaner iptables since it stores rules according to zones and not
# by chain. So for an example all deny rules will be listed under <zone>_deny.
#
# If you use the --permanent rule you get a xml file in /etc/firewalld/zones/<zone>.xml that can be shared and parsed easliy
#
# Example commands to view rules:
# firewall-cmd [--zone=<zone>] --list-rich-rules
# firewall-cmd [--zone=<zone>] --list-all
# firewall-cmd [--zone=zone] --query-rich-rule='rule'
[INCLUDES]
before = firewallcmd-common.conf
[Definition]
actionstart =
actionstop =
actioncheck =
#you can also use zones and/or service names.
#
# zone example:
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='ipv4' source address='<ip>' port port='<port>' protocol='<protocol>' <rich-blocktype>"
#
# service name example:
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='ipv4' source address='<ip>' service name='<service>' <rich-blocktype>"
#
# Because rich rules can only handle single or a range of ports we must split ports and execute the command for each port. Ports can be single and ranges separated by a comma or space for an example: http, https, 22-60, 18 smtp
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' <rich-blocktype>"; done
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="rule family='<family>' source address='<ip>' port port='$p' protocol='<protocol>' <rich-blocktype>"; done
+17
View File
@@ -0,0 +1,17 @@
[DEFAULT]
# Usage:
# _grep_logs_args = 'test'
# (printf %%b "Log-excerpt contains 'test':\n"; %(_grep_logs)s; printf %%b "Log-excerpt contains 'test':\n") | mail ...
#
_grep_logs = logpath="<logpath>"; grep <grepopts> %(_grep_logs_args)s $logpath | <greplimit>
# options `-wF` used to match only whole words and fixed string (not as pattern)
_grep_logs_args = -wF "<ip>"
# Used for actions, that should not by executed if ticket was restored:
_bypass_if_restored = if [ '<restored>' = '1' ]; then exit 0; fi;
[Init]
greplimit = tail -n <grepmax>
grepmax = 1000
grepopts = -m <grepmax>
+10 -5
View File
@@ -8,13 +8,13 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -31,8 +31,7 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = IP=<ip> &&
printf %%b "<daemon_list>: $IP\n" >> <file>
actionban = printf %%b "<daemon_list>: <ip_value>\n" >> <file>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -40,7 +39,7 @@ actionban = IP=<ip> &&
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = echo "/^<daemon_list>: <ip>$/<br>d<br>w<br>q" | ed <file>
actionunban = IP=$(echo "<ip_value>" | sed 's/[][\.]/\\\0/g') && sed -i "/^<daemon_list>: $IP$/d" <file>
[Init]
@@ -55,3 +54,9 @@ file = /etc/hosts.deny
# for hosts.deny/hosts_access. Default is all services.
# Values: STR Default: ALL
daemon_list = ALL
# internal variable IP (to differentiate the IPv4 and IPv6 syntax, where it is enclosed in brackets):
ip_value = <ip>
[Init?family=inet6]
ip_value = [<ip>]
+2 -2
View File
@@ -9,7 +9,7 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
# enable IPF if not already enabled
@@ -17,7 +17,7 @@ actionstart = /sbin/ipf -E
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
# don't disable IPF with "/sbin/ipf -D", there may be other filters in use
+2 -2
View File
@@ -8,14 +8,14 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
+11 -11
View File
@@ -14,26 +14,26 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = iptables -N f2b-<name>
iptables -A f2b-<name> -j RETURN
iptables -I <chain> -p <protocol> -j f2b-<name>
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> -p <protocol> -j f2b-<name>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> -j f2b-<name>
iptables -F f2b-<name>
iptables -X f2b-<name>
actionstop = <iptables> -D <chain> -p <protocol> -j f2b-<name>
<actionflush>
<iptables> -X f2b-<name>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
actioncheck = <iptables> -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -41,7 +41,7 @@ actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j <blocktype>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -49,7 +49,7 @@ actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = iptables -D f2b-<name> -s <ip> -j <blocktype>
actionunban = <iptables> -D f2b-<name> -s <ip> -j <blocktype>
[Init]
+47
View File
@@ -6,6 +6,9 @@
# used in all iptables based actions by default.
#
# The user can override the defaults in iptables-common.local
#
# Modified: Alexander Koeppe <format_c@online.de>, Serg G. Brester <serg.brester@sebres.de>
# made config file IPv6 capable (see new section Init?family=inet6)
[INCLUDES]
@@ -13,6 +16,15 @@ after = iptables-blocktype.local
iptables-common.local
# iptables-blocktype.local is obsolete
[Definition]
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = <iptables> -F f2b-<name>
[Init]
# Option: chain
@@ -43,3 +55,38 @@ protocol = tcp
# REJECT, REJECT --reject-with icmp-port-unreachable
# Values: STRING
blocktype = REJECT --reject-with icmp-port-unreachable
# Option: returntype
# Note: This is the default rule on "actionstart". This should be RETURN
# in all (blocking) actions, except REJECT in allowing actions.
# Values: STRING
returntype = RETURN
# Option: lockingopt
# Notes.: Option was introduced to iptables to prevent multiple instances from
# running concurrently and causing irratic behavior. -w was introduced
# in iptables 1.4.20, so might be absent on older systems
# See https://github.com/fail2ban/fail2ban/issues/1122
# Values: STRING
lockingopt = -w
# Option: iptables
# Notes.: Actual command to be executed, including common to all calls options
# Values: STRING
iptables = iptables <lockingopt>
[Init?family=inet6]
# Option: blocktype (ipv6)
# Note: This is what the action does with rules. This can be any jump target
# as per the iptables man page (section 8). Common values are DROP
# REJECT, REJECT --reject-with icmp6-port-unreachable
# Values: STRING
blocktype = REJECT --reject-with icmp6-port-unreachable
# Option: iptables (ipv6)
# Notes.: Actual command to be executed, including common to all calls options
# Values: STRING
iptables = ip6tables <lockingopt>
+13 -6
View File
@@ -24,18 +24,25 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = ipset --create f2b-<name> iphash
iptables -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
<iptables> -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
ipset --flush f2b-<name>
actionflush = ipset --flush f2b-<name>
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = <iptables> -D <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
<actionflush>
ipset --destroy f2b-<name>
# Option: actionban
@@ -12,6 +12,9 @@
#
# If you are running on an older kernel you make need to patch in external
# modules which probably won't be protocol version 6.
#
# Modified: Alexander Koeppe <format_c@online.de>, Serg G. Brester <serg.brester@sebres.de>
# made config file IPv6 capable (see new section Init?family=inet6)
[INCLUDES]
@@ -20,19 +23,25 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = ipset create f2b-<name> hash:ip timeout <bantime>
iptables -I <chain> -m set --match-set f2b-<name> src -j <blocktype>
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
<iptables> -I <chain> -m set --match-set <ipmset> src -j <blocktype>
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = ipset flush <ipmset>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -m set --match-set f2b-<name> src -j <blocktype>
ipset flush f2b-<name>
ipset destroy f2b-<name>
actionstop = <iptables> -D <chain> -m set --match-set <ipmset> src -j <blocktype>
<actionflush>
ipset destroy <ipmset>
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -40,7 +49,9 @@ actionstop = iptables -D <chain> -m set --match-set f2b-<name> src -j <blocktype
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
actionprolong = %(actionban)s
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -48,12 +59,21 @@ actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = ipset del f2b-<name> <ip> -exist
actionunban = ipset del <ipmset> <ip> -exist
[Init]
# Option: bantime
# Notes: specifies the bantime in seconds (handled internally rather than by fail2ban)
# Option: default-timeout
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
# Values: [ NUM ] Default: 600
#
bantime = 600
default-timeout = 600
ipmset = f2b-<name>
familyopt =
[Init?family=inet6]
ipmset = f2b-<name>6
familyopt = <sp>family inet6
+33 -13
View File
@@ -12,6 +12,9 @@
#
# If you are running on an older kernel you make need to patch in external
# modules.
#
# Modified: Alexander Koeppe <format_c@online.de>, Serg G. Brester <serg.brester@sebres.de>
# made config file IPv6 capable (see new section Init?family=inet6)
[INCLUDES]
@@ -20,19 +23,25 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = ipset create f2b-<name> hash:ip timeout <bantime>
iptables -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
<iptables> -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set <ipmset> src -j <blocktype>
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = ipset flush <ipmset>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
ipset flush f2b-<name>
ipset destroy f2b-<name>
actionstop = <iptables> -D <chain> -p <protocol> -m multiport --dports <port> -m set --match-set <ipmset> src -j <blocktype>
<actionflush>
ipset destroy <ipmset>
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -40,7 +49,9 @@ actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -m s
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
actionprolong = %(actionban)s
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -48,12 +59,21 @@ actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = ipset del f2b-<name> <ip> -exist
actionunban = ipset del <ipmset> <ip> -exist
[Init]
# Option: bantime
# Notes: specifies the bantime in seconds (handled internally rather than by fail2ban)
# Option: default-timeout
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
# Values: [ NUM ] Default: 600
#
bantime = 600
default-timeout = 600
ipmset = f2b-<name>
familyopt =
[Init?family=inet6]
ipmset = f2b-<name>6
familyopt = <sp>family inet6
+22 -16
View File
@@ -16,31 +16,37 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = iptables -N f2b-<name>
iptables -A f2b-<name> -j RETURN
iptables -I <chain> 1 -p <protocol> -m multiport --dports <port> -j f2b-<name>
iptables -N f2b-<name>-log
iptables -I f2b-<name>-log -j LOG --log-prefix "$(expr f2b-<name> : '\(.\{1,23\}\)'):DROP " --log-level warning -m limit --limit 6/m --limit-burst 2
iptables -A f2b-<name>-log -j <blocktype>
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> 1 -p <protocol> -m multiport --dports <port> -j f2b-<name>
<iptables> -N f2b-<name>-log
<iptables> -I f2b-<name>-log -j LOG --log-prefix "$(expr f2b-<name> : '\(.\{1,23\}\)'):DROP " --log-level warning -m limit --limit 6/m --limit-burst 2
<iptables> -A f2b-<name>-log -j <blocktype>
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = <iptables> -F f2b-<name>
<iptables> -F f2b-<name>-log
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
iptables -F f2b-<name>
iptables -F f2b-<name>-log
iptables -X f2b-<name>
iptables -X f2b-<name>-log
actionstop = <iptables> -D <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
<actionflush>
<iptables> -X f2b-<name>
<iptables> -X f2b-<name>-log
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L f2b-<name>-log >/dev/null
actioncheck = <iptables> -n -L f2b-<name>-log >/dev/null
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -48,7 +54,7 @@ actioncheck = iptables -n -L f2b-<name>-log >/dev/null
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = iptables -I f2b-<name> 1 -s <ip> -j f2b-<name>-log
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j f2b-<name>-log
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -56,7 +62,7 @@ actionban = iptables -I f2b-<name> 1 -s <ip> -j f2b-<name>-log
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = iptables -D f2b-<name> -s <ip> -j f2b-<name>-log
actionunban = <iptables> -D f2b-<name> -s <ip> -j f2b-<name>-log
[Init]
+11 -11
View File
@@ -11,26 +11,26 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = iptables -N f2b-<name>
iptables -A f2b-<name> -j RETURN
iptables -I <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
iptables -F f2b-<name>
iptables -X f2b-<name>
actionstop = <iptables> -D <chain> -p <protocol> -m multiport --dports <port> -j f2b-<name>
<actionflush>
<iptables> -X f2b-<name>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
actioncheck = <iptables> -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -38,7 +38,7 @@ actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j <blocktype>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -46,7 +46,7 @@ actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = iptables -D f2b-<name> -s <ip> -j <blocktype>
actionunban = <iptables> -D f2b-<name> -s <ip> -j <blocktype>
[Init]
+11 -11
View File
@@ -13,26 +13,26 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = iptables -N f2b-<name>
iptables -A f2b-<name> -j RETURN
iptables -I <chain> -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
iptables -F f2b-<name>
iptables -X f2b-<name>
actionstop = <iptables> -D <chain> -m state --state NEW -p <protocol> --dport <port> -j f2b-<name>
<actionflush>
<iptables> -X f2b-<name>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
actioncheck = <iptables> -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -40,7 +40,7 @@ actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j <blocktype>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -48,7 +48,7 @@ actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = iptables -D f2b-<name> -s <ip> -j <blocktype>
actionunban = <iptables> -D f2b-<name> -s <ip> -j <blocktype>
[Init]
+23 -11
View File
@@ -2,7 +2,8 @@
#
# Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
#
#
# Modified: Alexander Koeppe <format_c@online.de>, Serg G. Brester <serg.brester@sebres.de>
# made config file IPv6 capable
[INCLUDES]
@@ -11,7 +12,7 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
# Changing iptables rules requires root privileges. If fail2ban is
@@ -22,30 +23,36 @@ before = iptables-common.conf
# iptables-persistent package).
#
# Explanation of the rule below:
# Check if any packets coming from an IP on the f2b-<name>
# Check if any packets coming from an IP on the <iptname>
# list have been seen in the last 3600 seconds. If yes, update the
# timestamp for this IP and drop the packet. If not, let the packet
# through.
#
# Fail2ban inserts blacklisted hosts into the f2b-<name> list
# Fail2ban inserts blacklisted hosts into the <iptname> list
# and removes them from the list after some time, according to its
# own rules. The 3600 second timeout is independent and acts as a
# safeguard in case the fail2ban process dies unexpectedly. The
# shorter of the two timeouts actually matters.
actionstart = if [ `id -u` -eq 0 ];then iptables -I <chain> -m recent --update --seconds 3600 --name f2b-<name> -j <blocktype>;fi
actionstart = if [ `id -u` -eq 0 ];then <iptables> -I <chain> -m recent --update --seconds 3600 --name <iptname> -j <blocktype>;fi
# Option: actionflush
#
# [TODO] Flushing is currently not implemented for xt_recent
#
actionflush =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = echo / > /proc/net/xt_recent/f2b-<name>
if [ `id -u` -eq 0 ];then iptables -D <chain> -m recent --update --seconds 3600 --name f2b-<name> -j <blocktype>;fi
actionstop = echo / > /proc/net/xt_recent/<iptname>
if [ `id -u` -eq 0 ];then <iptables> -D <chain> -m recent --update --seconds 3600 --name <iptname> -j <blocktype>;fi
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = test -e /proc/net/xt_recent/f2b-<name>
actioncheck = test -e /proc/net/xt_recent/<iptname>
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -53,7 +60,7 @@ actioncheck = test -e /proc/net/xt_recent/f2b-<name>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = echo +<ip> > /proc/net/xt_recent/f2b-<name>
actionban = echo +<ip> > /proc/net/xt_recent/<iptname>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -61,7 +68,12 @@ actionban = echo +<ip> > /proc/net/xt_recent/f2b-<name>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = echo -<ip> > /proc/net/xt_recent/f2b-<name>
actionunban = echo -<ip> > /proc/net/xt_recent/<iptname>
[Init]
iptname = f2b-<name>
[Init?family=inet6]
iptname = f2b-<name>6
+11 -11
View File
@@ -11,26 +11,26 @@ before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = iptables -N f2b-<name>
iptables -A f2b-<name> -j RETURN
iptables -I <chain> -p <protocol> --dport <port> -j f2b-<name>
actionstart = <iptables> -N f2b-<name>
<iptables> -A f2b-<name> -j <returntype>
<iptables> -I <chain> -p <protocol> --dport <port> -j f2b-<name>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = iptables -D <chain> -p <protocol> --dport <port> -j f2b-<name>
iptables -F f2b-<name>
iptables -X f2b-<name>
actionstop = <iptables> -D <chain> -p <protocol> --dport <port> -j f2b-<name>
<actionflush>
<iptables> -X f2b-<name>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
actioncheck = <iptables> -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -38,7 +38,7 @@ actioncheck = iptables -n -L <chain> | grep -q 'f2b-<name>[ \t]'
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j <blocktype>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -46,7 +46,7 @@ actionban = iptables -I f2b-<name> 1 -s <ip> -j <blocktype>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = iptables -D f2b-<name> -s <ip> -j <blocktype>
actionunban = <iptables> -D f2b-<name> -s <ip> -j <blocktype>
[Init]
+8 -5
View File
@@ -6,18 +6,21 @@
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Output will be buffered until <lines> lines are available.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = if [ -f <tmpfile> ]; then
@@ -25,13 +28,13 @@ actionstop = if [ -f <tmpfile> ]; then
These hosts have been banned by Fail2Ban.\n
`cat <tmpfile>`
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary from `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary from <fq-hostname>" <dest>
rm <tmpfile>
fi
printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
# Option: actioncheck
# Notes.: command executed once before each actionban command
+28
View File
@@ -0,0 +1,28 @@
# Fail2Ban configuration file
#
# Common settings for mail actions
#
# Users can override the defaults in mail-whois-common.local
[INCLUDES]
# Load customizations if any available
after = mail-whois-common.local
[DEFAULT]
#original character set of whois output will be sent to mail program
_whois = whois <ip> || echo "missing whois program"
# use heuristics to convert charset of whois output to a target
# character set before sending it to a mail program
# make sure you have 'file' and 'iconv' commands installed when opting for that
_whois_target_charset = UTF-8
_whois_convert_charset = (%(_whois)s) |
{ WHOIS_OUTPUT=$(cat) ; WHOIS_CHARSET=$(printf %%b "$WHOIS_OUTPUT" | file -b --mime-encoding -) ; printf %%b "$WHOIS_OUTPUT" | iconv -f $WHOIS_CHARSET -t %(_whois_target_charset)s//TRANSLIT - ; }
# choose between _whois and _whois_convert_charset in mail-whois-common.local
# or other *.local which include mail-whois-common.conf.
_whois_command = %(_whois)s
#_whois_command = %(_whois_convert_charset)s
[Init]
+33 -10
View File
@@ -4,25 +4,33 @@
# Modified-By: Yaroslav Halchenko to include grepping on IP over log files
#
[INCLUDES]
before = mail-whois-common.conf
helpers-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on `uname -n`" <dest>
Fail2Ban" | <mailcmd> "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on `uname -n`" <dest>
Fail2Ban" | <mailcmd> "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
# Option: actioncheck
# Notes.: command executed once before each actionban command
@@ -36,15 +44,19 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Hi,\n
_ban_mail_content = ( printf %%b "Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here is more information about <ip>:\n
`whois <ip> || echo missing whois program`\n\n
Lines containing IP:<ip> in <logpath>\n
`grep '[^0-9]<ip>[^0-9]' <logpath>`\n\n
Here is more information about <ip> :\n"
%(_whois_command)s;
printf %%b "\nLines containing failures of <ip> (max <grepmax>)\n";
%(_grep_logs)s;
printf %%b "\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from `uname -n`" <dest>
Fail2Ban" )
actionban = %(_ban_mail_content)s | <mailcmd> "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -56,6 +68,12 @@ actionunban =
[Init]
# Option: mailcmd
# Notes.: Your system mail command. Is passed 2 args: subject and recipient
# Values: CMD
#
mailcmd = mail -s
# Default name of the chain
#
name = default
@@ -67,3 +85,8 @@ dest = root
# Path to the log files which contain relevant lines for the abuser IP
#
logpath = /dev/null
# Number of log lines to include in the email
#
#grepmax = 1000
#grepopts = -m <grepmax>
+14 -7
View File
@@ -4,25 +4,32 @@
#
#
[INCLUDES]
before = mail-whois-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
# Option: actioncheck
# Notes.: command executed once before each actionban command
@@ -39,10 +46,10 @@ actioncheck =
actionban = printf %%b "Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here is more information about <ip>:\n
`whois <ip> || echo missing whois program`\n
Here is more information about <ip> :\n
`%(_whois_command)s`\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
+8 -5
View File
@@ -6,23 +6,26 @@
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = printf %%b "Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
# Option: actioncheck
# Notes.: command executed once before each actionban command
@@ -40,7 +43,7 @@ actionban = printf %%b "Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from `uname -n`" <dest>
Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
+8 -4
View File
@@ -28,13 +28,13 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -111,13 +111,17 @@ myip = `ip -4 addr show dev eth0 | grep inet | head -n 1 | sed -r 's/.*inet ([0-
#
protocol = tcp
# Option: agent
# Default: Fail2ban
agent = Fail2ban
# Option: getcmd
# Notes.: A command to fetch a URL. Should output page to STDOUT
# Values: CMD Default: wget
#
getcmd = wget --no-verbose --tries=3 --waitretry=10 --connect-timeout=10 --read-timeout=60 --retry-connrefused --output-document=- --user-agent=Fail2Ban
getcmd = wget --no-verbose --tries=3 --waitretry=10 --connect-timeout=10 --read-timeout=60 --retry-connrefused --output-document=- --user-agent=<agent>
# Alternative value:
# getcmd = curl --silent --show-error --retry 3 --connect-timeout 10 --max-time 60 --user-agent Fail2Ban
# getcmd = curl --silent --show-error --retry 3 --connect-timeout 10 --max-time 60 --user-agent <agent>
# Option: srcport
# Notes.: The source port of the attack. You're unlikely to have this info, so
+33
View File
@@ -0,0 +1,33 @@
# Fail2ban Citrix Netscaler Action
# by Juliano Jeziorny
# juliano@jeziorny.eu
#
# The script will add offender IPs to a dataset on netscaler, the dataset can then be used to block the IPs at a cs/vserver or global level
# This dataset is then used to block IPs using responder policies on the netscaler.
#
# The script assumes using HTTPS with unsecure certificate to access the netscaler,
# if you have a valid certificate installed remove the -k from the curl lines, or if you want http change it accordingly (and remove the -k)
#
# This action depends on curl
#
# You need to populate the 3 options inside Init
#
# ns_host: IP or hostname of netslcaer appliance
# ns_auth: username:password, suggest base64 encoded for a little added security (echo -n "username:password" | base64)
# ns_dataset: Name of the netscaler dataset holding the IPs to be blocked.
#
# For further details on how to use it please check http://blog.ckzone.eu/2017/01/fail2ban-action-for-citrix-netscaler.html
[Init]
ns_host =
ns_auth =
ns_dataset =
[Definition]
actionstart = curl -kH 'Authorization: Basic <ns_auth>' https://<ns_host>/nitro/v1/config
actioncheck =
actionban = curl -k -H 'Authorization: Basic <ns_auth>' -X PUT -d '{"policydataset_value_binding":{"name":"<ns_dataset>","value":"<ip>"}}' https://<ns_host>/nitro/v1/config/
actionunban = curl -H 'Authorization: Basic <ns_auth>' -X DELETE -k "https://<ns_host>/nitro/v1/config/policydataset_value_binding/<ns_dataset>?args=value:<ip>"
+17
View File
@@ -0,0 +1,17 @@
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
# Modified: Alexander Belykh <albel727@ngs.ru>
# adapted for nftables
#
# Obsolete: superseded by nftables[type=allports]
[INCLUDES]
before = nftables.conf
[Definition]
type = allports
+17
View File
@@ -0,0 +1,17 @@
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
# Modified: Alexander Belykh <albel727@ngs.ru>
# adapted for nftables
#
# Obsolete: superseded by nftables[type=multiport]
[INCLUDES]
before = nftables.conf
[Definition]
type = multiport
+203
View File
@@ -0,0 +1,203 @@
# Fail2Ban configuration file
#
# Author: Daniel Black
# Author: Cyril Jaquier
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
# Modified: Alexander Belykh <albel727@ngs.ru>
# adapted for nftables
#
# This is a included configuration file and includes the definitions for the nftables
# used in all nftables based actions by default.
#
# The user can override the defaults in nftables-common.local
# Example: redirect flow to honeypot
#
# [Init]
# table_family = ip
# chain_type = nat
# chain_hook = prerouting
# chain_priority = -50
# blocktype = counter redirect to 2222
[INCLUDES]
after = nftables-common.local
[Definition]
# Option: type
# Notes.: type of the action.
# Values: [ multiport | allports ] Default: multiport
#
type = multiport
rule_match-custom =
rule_match-allports = meta l4proto \{ <protocol> \}
rule_match-multiport = $proto dport \{ <port> \}
match = <rule_match-<type>>
# Option: rule_stat
# Notes.: statement for nftables filter rule.
# leaving it empty will block all (include udp and icmp)
# Values: nftables statement
#
rule_stat = %(match)s <addr_family> saddr @<addr_set> <blocktype>
# optional interator over protocol's:
_nft_for_proto-custom-iter =
_nft_for_proto-custom-done =
_nft_for_proto-allports-iter =
_nft_for_proto-allports-done =
_nft_for_proto-multiport-iter = for proto in $(echo '<protocol>' | sed 's/,/ /g'); do
_nft_for_proto-multiport-done = done
_nft_list = <nftables> -a list chain <table_family> <table> <chain>
_nft_get_handle_id = grep -oP '@<addr_set>\s+.*\s+\Khandle\s+(\d+)$'
_nft_add_set = <nftables> add set <table_family> <table> <addr_set> \{ type <addr_type>\; \}
<_nft_for_proto-<type>-iter>
<nftables> add rule <table_family> <table> <chain> %(rule_stat)s
<_nft_for_proto-<type>-done>
_nft_del_set = { %(_nft_list)s | %(_nft_get_handle_id)s; } | while read -r hdl; do
<nftables> delete rule <table_family> <table> <chain> $hdl; done
<nftables> delete set <table_family> <table> <addr_set>
# Option: _nft_shutdown_table
# Notes.: command executed after the stop in order to delete table (it checks that no sets are available):
# Values: CMD
#
_nft_shutdown_table = { <nftables> list table <table_family> <table> | grep -qP '^\s+set\s+'; } || {
<nftables> delete table <table_family> <table>
}
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = <nftables> add table <table_family> <table>
<nftables> -- add chain <table_family> <table> <chain> \{ type <chain_type> hook <chain_hook> priority <chain_priority> \; \}
%(_nft_add_set)s
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action);
# uses `nft flush set ...` and as fallback (e. g. unsupported) recreates the set (with references)
# Values: CMD
#
actionflush = { <nftables> flush set <table_family> <table> <addr_set> 2> /dev/null; } || {
%(_nft_del_set)s
%(_nft_add_set)s
}
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = %(_nft_del_set)s
<_nft_shutdown_table>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = <nftables> list chain <table_family> <table> <chain> | grep -q '@<addr_set>[ \t]'
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = <nftables> add element <table_family> <table> <addr_set> \{ <ip> \}
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = <nftables> delete element <table_family> <table> <addr_set> \{ <ip> \}
[Init]
# Option: table
# Notes.: main table to store chain and sets (automatically created on demand)
# Values: STRING Default: f2b-table
table = f2b-table
# Option: table_family
# Notes.: address family to work in
# Values: [ip | ip6 | inet] Default: inet
table_family = inet
# Option: chain
# Notes.: main chain to store rules
# Values: STRING Default: f2b-chain
chain = f2b-chain
# Option: chain_type
# Notes.: refers to the kind of chain to be created
# Values: [filter | route | nat] Default: filter
#
chain_type = filter
# Option: chain_hook
# Notes.: refers to the kind of chain to be created
# Values: [ prerouting | input | forward | output | postrouting ] Default: input
#
chain_hook = input
# Option: chain_priority
# Notes.: priority in the chain.
# Values: NUMBER Default: -1
#
chain_priority = -1
# Option: addr_type
# Notes.: address type to work with
# Values: [ipv4_addr | ipv6_addr] Default: ipv4_addr
#
addr_type = ipv4_addr
# Default name of the filtering set
#
name = default
# Option: port
# Notes.: specifies port to monitor
# Values: [ NUM | STRING ] Default:
#
port = ssh
# Option: protocol
# Notes.: internally used by config reader for interpolations.
# Values: [ tcp | udp ] Default: tcp
#
protocol = tcp
# Option: blocktype
# Note: This is what the action does with rules. This can be any jump target
# as per the nftables man page (section 8). Common values are drop,
# reject, reject with icmpx type host-unreachable, redirect to 2222
# Values: STRING
blocktype = reject
# Option: nftables
# Notes.: Actual command to be executed, including common to all calls options
# Values: STRING
nftables = nft
# Option: addr_set
# Notes.: The name of the nft set used to store banned addresses
# Values: STRING
addr_set = addr-set-<name>
# Option: addr_family
# Notes.: The family of the banned addresses
# Values: [ ip | ip6 ]
addr_family = ip
[Init?family=inet6]
addr_family = ip6
addr_type = ipv6_addr
addr_set = addr6-set-<name>
+108
View File
@@ -0,0 +1,108 @@
# Fail2Ban configuration file for black-listing via nginx
#
# Author: Serg G. Brester (aka sebres)
#
# To use 'nginx-block-map' action you should define some special blocks in your nginx configuration,
# and use it hereafter in your locations (to notify fail2ban by failure, resp. nginx by ban).
#
# Example (argument "token_id" resp. cookie "session_id" used here as unique identifier for user):
#
# http {
# ...
# # maps to check user is blacklisted (banned in f2b):
# #map $arg_token_id $blck_lst_tok { include blacklisted-tokens.map; }
# map $cookie_session_id $blck_lst_ses { include blacklisted-sessions.map; }
# ...
# # special log-format to notify fail2ban about failures:
# log_format f2b_session_errors '$msec failure "$cookie_session_id" - $remote_addr - $remote_user '
# ;# '"$request" $status $bytes_sent '
# # '"$http_referer" "$http_user_agent"';
#
# # location checking blacklisted values:
# location ... {
# # check banned sessionid:
# if ($blck_lst_ses != "") {
# try_files "" @f2b-banned;
# }
# ...
# # notify fail2ban about a failure inside nginx:
# error_page 401 = @notify-f2b;
# ...
# }
# ...
# # location for return with "403 Forbidden" if banned:
# location @f2b-banned {
# default_type text/html;
# return 403 "<br/><center>
# <b style=\"color:red; font-size:18pt; border:2pt solid black; padding:5pt;\">
# You are banned!</b></center>";
# }
# ...
# # location to notify fail2ban about a failure inside nginx:
# location @notify-f2b {
# access_log /var/log/nginx/f2b-auth-errors.log f2b_session_errors;
# }
# }
# ...
#
# Note that quote-character (and possibly other special characters) are not allowed currently as session-id.
# Thus please add any session-id validation rule in your locations (or in the corresponding backend-service),
# like in example below:
#
# location ... {
# if ($cookie_session_id !~ "^[\w\-]+$") {
# return 403 "Wrong session-id"
# }
# ...
# }
#
# The parameters for jail corresponding log-format (f2b_session_errors):
#
# [nginx-blck-lst]
# filter =
# datepattern = ^Epoch
# failregex = ^ failure "<F-ID>[^"]+</F-ID>" - <ADDR>
# usedns = no
#
# The same log-file can be used for IP-related jail (additionally to session-related, to ban very bad IPs):
#
# [nginx-blck-ip]
# maxretry = 100
# filter =
# datepattern = ^Epoch
# failregex = ^ failure "[^"]+" - <ADDR>
# usedns = no
#
[Definition]
# path to configuration of nginx (used to target nginx-instance in multi-instance system,
# and as path for the blacklisted map):
srv_cfg_path = /etc/nginx/
# cmd-line arguments to supply to test/reload nginx:
#srv_cmd = nginx -c %(srv_cfg_path)s/nginx.conf
srv_cmd = nginx
# first test configuration is correct, hereafter send reload signal:
blck_lst_reload = %(srv_cmd)s -qt; if [ $? -eq 0 ]; then
%(srv_cmd)s -s reload; if [ $? -ne 0 ]; then echo 'reload failed.'; fi;
fi;
# map-file for nginx, can be redefined using `action = nginx-block-map[blck_lst_file="/path/file.map"]`:
blck_lst_file = %(srv_cfg_path)s/blacklisted-sessions.map
# Action definition:
actionstart_on_demand = false
actionstart = touch '%(blck_lst_file)s'
actionflush = truncate -s 0 '%(blck_lst_file)s'; %(blck_lst_reload)s
actionstop = %(actionflush)s
actioncheck =
actionban = echo "\\\\<fid> 1;" >> '%(blck_lst_file)s'; %(blck_lst_reload)s
actionunban = id=$(echo "<fid>" | sed -e 's/[]\/$*.^|[]/\\&/g'); sed -i "/^\\\\$id 1;$/d" %(blck_lst_file)s; %(blck_lst_reload)s
+61
View File
@@ -0,0 +1,61 @@
# Fail2Ban configuration file
#
# NetBSD npf ban/unban
#
# Author: Nils Ratusznik <nils@NetBSD.org>
# Based on pf.conf action file
#
[Definition]
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
# we don't enable NPF automatically, as it will be enabled elsewhere
actionstart =
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
# we don't disable NPF automatically either
actionstop =
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
actionban = /sbin/npfctl table <tablename> add <ip>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
# note -r option used to remove matching rule
actionunban = /sbin/npfctl table <tablename> rem <ip>
[Init]
# Option: tablename
# Notes.: The pf table name.
# Values: [ STRING ]
#
tablename = fail2ban
+114
View File
@@ -0,0 +1,114 @@
# Fail2Ban configuration file
#
# Author: Andrew St. Jean
#
# Use nsupdate to perform dynamic DNS updates on a BIND zone file.
# One may want to do this to update a local RBL with banned IP addresses.
#
# Options
#
# domain DNS domain that will appear in nsupdate add and delete
# commands.
#
# ttl The time to live (TTL) in seconds of the TXT resource
# record.
#
# rdata Data portion of the TXT resource record.
#
# nsupdatecmd Full path to the nsupdate command.
#
# keyfile Full path to TSIG key file used for authentication between
# nsupdate and BIND.
#
# Create an nsupdate.local to set at least the <domain> and <keyfile>
# options as they don't have default values.
#
# The ban and unban commands assume nsupdate will authenticate to the BIND
# server using a TSIG key. The full path to the key file must be specified
# in the <keyfile> parameter. Use this command to generate your TSIG key.
#
# dnssec-keygen -a HMAC-MD5 -b 256 -n HOST <key_name>
#
# Replace <key_name> with some meaningful name.
#
# This command will generate two files. Specify the .private file in the
# <keyfile> option. Note that the .key file must also be present in the same
# directory for nsupdate to use the key.
#
# Don't forget to add the key and appropriate allow-update or update-policy
# option to your named.conf file.
#
[Definition]
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = echo <ip> | awk -F. '{print "prereq nxrrset "$4"."$3"."$2"."$1".<domain> TXT"; print "update add "$4"."$3"."$2"."$1".<domain> <ttl> IN TXT \"<rdata>\""; print "send"}' | <nsupdatecmd> -k <keyfile>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = echo <ip> | awk -F. '{print "update delete "$4"."$3"."$2"."$1".<domain>"; print "send"}' | <nsupdatecmd> -k <keyfile>
[Init]
# Option: domain
# Notes.: DNS domain that nsupdate will update.
# Values: STRING
#
domain =
# Option: ttl
# Notes.: time to live (TTL) in seconds of TXT resource record
# added by nsupdate.
# Values: NUM
#
ttl = 60
# Option: rdata
# Notes.: data portion of the TXT resource record added by nsupdate.
# Values: STRING
#
rdata = Your IP has been banned
# Option: nsupdatecmd
# Notes.: specifies the full path to the nsupdate program that dynamically
# updates BIND zone files.
# Values: CMD
#
nsupdatecmd = /usr/bin/nsupdate
# Option: keyfile
# Notes.: specifies the full path to the file containing the
# TSIG key for communicating with BIND.
# Values: STRING
#
keyfile =
+2 -2
View File
@@ -12,5 +12,5 @@ actioncheck =
actionban = /usr/libexec/afctl -a <ip> -t <bantime>
actionunban = /usr/libexec/afctl -r <ip>
[Init]
bantime = 2880
actionprolong = %(actionunban)s && %(actionban)s
+2 -2
View File
@@ -9,14 +9,14 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
+72 -10
View File
@@ -3,32 +3,59 @@
# OpenBSD pf ban/unban
#
# Author: Nick Hilliard <nick@foobar.org>
# Modified by: Alexander Koeppe making PF work seamless and with IPv4 and IPv6
#
#
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
# we don't enable PF automatically, as it will be enabled elsewhere
actionstart =
# we don't enable PF automatically; to enable run pfctl -e
# or add `pf_enable="YES"` to /etc/rc.conf (tested on FreeBSD)
# also, these rulesets are loaded into (nested) anchors
# to enable them, add as wildcard:
# anchor "f2b/*"
# or using jail names:
# anchor f2b {
# anchor name1
# anchor name2
# ...
# }
# to your main pf ruleset, where "namei" are the names of the jails
# which invoke this action
actionstart = echo "table <<tablename>-<name>> persist counters" | <pfctl> -f-
port="<port>"; if [ "$port" != "" ] && case "$port" in \{*) false;; esac; then port="{$port}"; fi
echo "<block> proto <protocol> from <<tablename>-<name>> to <actiontype>" | <pfctl> -f-
# Option: start_on_demand - to start action on demand
# Example: `action=pf[actionstart_on_demand=true]`
actionstart_on_demand = false
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
# we don't disable PF automatically either
actionstop =
# we only disable PF rules we've installed prior
actionstop = <pfctl> -sr 2>/dev/null | grep -v <tablename>-<name> | <pfctl> -f-
%(actionflush)s
<pfctl> -t <tablename>-<name> -T kill
# Option: actionflush
# Notes.: command executed once to flush IPS, by shutdown (resp. by stop of the jail or this action)
# Values: CMD
#
actionflush = <pfctl> -t <tablename>-<name> -T flush
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
actioncheck = <pfctl> -sr | grep -q <tablename>-<name>
# Option: actionban
@@ -39,7 +66,7 @@ actioncheck =
# <time> unix timestamp of the ban time
# Values: CMD
#
actionban = /sbin/pfctl -t <tablename> -T add <ip>/32
actionban = <pfctl> -t <tablename>-<name> -T add <ip>
# Option: actionunban
@@ -51,12 +78,47 @@ actionban = /sbin/pfctl -t <tablename> -T add <ip>/32
# Values: CMD
#
# note -r option used to remove matching rule
actionunban = /sbin/pfctl -t <tablename> -T delete <ip>/32
actionunban = <pfctl> -t <tablename>-<name> -T delete <ip>
# Option: pfctl
#
# Use anchor as jailname to manipulate affected rulesets only.
# If more parameter expected it can be extended with `pf[pfctl="<known/pfctl> ..."]`
#
pfctl = pfctl -a f2b/<name>
[Init]
# Option: tablename
# Notes.: The pf table name.
# Values: [ STRING ]
#
tablename = fail2ban
tablename = f2b
# Option: block
#
# The action you want pf to take.
# Probably, you want "block quick", but adjust as needed.
block = block quick
# Option: protocol
# Notes.: internally used by config reader for interpolations.
# Values: [ tcp | udp | icmp | ipv6-icmp ] Default: tcp
#
protocol = tcp
# Option: actiontype
# Notes.: defines additions to the blocking rule
# Values: leave empty to block all attempts from the host
# Default: Value of the multiport
actiontype = <multiport>
# Option: allports
# Notes.: default addition to block all ports
# Usage.: use in jail config: "banaction = pf[actiontype=<allports>]"
allports = any
# Option: multiport
# Notes.: addition to block access only to specific ports
# Usage.: use in jail config: "banaction = pf[actiontype=<multiport>]"
multiport = any port $port
+3
View File
@@ -17,6 +17,9 @@
[Definition]
actionban = ip route add <blocktype> <ip>
actionunban = ip route del <blocktype> <ip>
actioncheck =
actionstart =
actionstop =
[Init]
+13 -10
View File
@@ -10,41 +10,44 @@ before = sendmail-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Subject: [Fail2Ban] <name>: started on `uname -n`
actionstart = printf %%b "Subject: [Fail2Ban] <name>: started on <fq-hostname>
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The jail <name> has been started successfully.\n
Output will be buffered until <lines> lines are available.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = if [ -f <tmpfile> ]; then
printf %%b "Subject: [Fail2Ban] <name>: summary from `uname -n`
printf %%b "Subject: [Fail2Ban] <name>: summary from <fq-hostname>
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
These hosts have been banned by Fail2Ban.\n
`cat <tmpfile>`
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
rm <tmpfile>
fi
printf %%b "Subject: [Fail2Ban] <name>: stopped on `uname -n`
printf %%b "Subject: [Fail2Ban] <name>: stopped on <fq-hostname>
From: Fail2Ban <<sender>>
To: <dest>\n
Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
# Option: actioncheck
# Notes.: command executed once before each actionban command
@@ -61,14 +64,14 @@ actioncheck =
actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
LINE=$( wc -l <tmpfile> | awk '{ print $1 }' )
if [ $LINE -ge <lines> ]; then
printf %%b "Subject: [Fail2Ban] <name>: summary from `uname -n`
printf %%b "Subject: [Fail2Ban] <name>: summary from <fq-hostname>
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
These hosts have been banned by Fail2Ban.\n
`cat <tmpfile>`
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
rm <tmpfile>
fi
+15 -11
View File
@@ -11,36 +11,36 @@ after = sendmail-common.local
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = printf %%b "Subject: [Fail2Ban] <name>: started on `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionstart = printf %%b "Subject: [Fail2Ban] <name>: started on <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The jail <name> has been started successfully.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = printf %%b "Subject: [Fail2Ban] <name>: stopped on `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionstop = printf %%b "Subject: [Fail2Ban] <name>: stopped on <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The jail <name> has been stopped.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
actioncheck =
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
@@ -48,7 +48,7 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban =
actionban =
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -56,10 +56,14 @@ actionban =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban =
actionunban =
[Init]
# Your system mail command
#
mailcmd = /usr/sbin/sendmail -f "<sender>" "<dest>"
# Recipient mail address
#
dest = root
+59
View File
@@ -0,0 +1,59 @@
# Fail2Ban configuration file
#
# Author: Viktor Szépe
#
#
[INCLUDES]
before = sendmail-common.conf
helpers-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: Command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# You need to install geoiplookup and the GeoLite or GeoIP databases.
# (geoip-bin and geoip-database in Debian)
# The host command comes from bind9-host package.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = ( printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here is more information about <ip> :\n
http://bgp.he.net/ip/<ip>
http://www.projecthoneypot.org/ip_<ip>
http://whois.domaintools.com/<ip>\n\n
Country:`geoiplookup -f /usr/share/GeoIP/GeoIP.dat "<ip>" | cut -d':' -f2-`
AS:`geoiplookup -f /usr/share/GeoIP/GeoIPASNum.dat "<ip>" | cut -d':' -f2-`
hostname: <ip-host>\n\n
Lines containing failures of <ip> (max <grepmax>)\n";
%(_grep_logs)s;
printf %%b "\n
Regards,\n
Fail2Ban" ) | <mailcmd>
[Init]
# Default name of the chain
#
name = default
# Path to the log files which contain relevant lines for the abuser IP
#
logpath = /dev/null
# Number of log lines to include in the email
#
#grepmax = 1000
#grepopts = -m <grepmax>
@@ -7,28 +7,32 @@
[INCLUDES]
before = sendmail-common.conf
mail-whois-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here are more information about <ip>:\n
`/usr/bin/whois <ip>`\n\n
Here is more information about <ip> :\n
`%(_whois_command)s`\n\n
Matches for <name> with <ipjailfailures> failures IP:<ip>\n
<ipjailmatches>\n\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
[Init]
@@ -7,28 +7,32 @@
[INCLUDES]
before = sendmail-common.conf
mail-whois-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here are more information about <ip>:\n
`/usr/bin/whois <ip>`\n\n
Here is more information about <ip> :\n
`%(_whois_command)s`\n\n
Matches with <ipfailures> failures IP:<ip>\n
<ipmatches>\n\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
[Init]
+17 -7
View File
@@ -7,28 +7,34 @@
[INCLUDES]
before = sendmail-common.conf
mail-whois-common.conf
helpers-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = ( printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here is more information about <ip>:\n
`/usr/bin/whois <ip> || echo missing whois program`\n\n
Lines containing IP:<ip> in <logpath>\n
`grep '[^0-9]<ip>[^0-9]' <logpath>`\n\n
Here is more information about <ip> :\n"
%(_whois_command)s;
printf %%b "\nLines containing failures of <ip> (max <grepmax>)\n";
%(_grep_logs)s;
printf %%b "\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" ) | <mailcmd>
[Init]
@@ -40,3 +46,7 @@ name = default
#
logpath = /dev/null
# Number of log lines to include in the email
#
#grepmax = 1000
#grepopts = -m <grepmax>
+9 -5
View File
@@ -7,28 +7,32 @@
[INCLUDES]
before = sendmail-common.conf
mail-whois-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here are more information about <ip>:\n
`/usr/bin/whois <ip>`\n\n
Here is more information about <ip> :\n
`%(_whois_command)s`\n\n
Matches:\n
<matches>\n\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
[Init]
+9 -5
View File
@@ -7,26 +7,30 @@
[INCLUDES]
before = sendmail-common.conf
mail-whois-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n\n
Here is more information about <ip>:\n
`/usr/bin/whois <ip> || echo missing whois program`\n
Here is more information about <ip> :\n
`%(_whois_command)s`\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
[Init]
+6 -3
View File
@@ -10,21 +10,24 @@ before = sendmail-common.conf
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
Date: `LC_TIME=C date -u +"%%a, %%d %%h %%Y %%T +0000"`
actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from <fq-hostname>
Date: `LC_ALL=C date +"%%a, %%d %%h %%Y %%T %%z"`
From: <sendername> <<sender>>
To: <dest>\n
Hi,\n
The IP <ip> has just been banned by Fail2Ban after
<failures> attempts against <name>.\n
Regards,\n
Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
Fail2Ban" | <mailcmd>
[Init]
@@ -0,0 +1,85 @@
# Fail2Ban configuration file
#
# Author: Eduardo Diaz
#
# This is for ipset protocol 6 (and hopefully later) (ipset v6.14).
# for shorewall
#
# Use this setting in jail.conf to modify use this action instead of a
# default one
#
# banaction = shorewall-ipset-proto6
#
# This requires the program ipset which is normally in package called ipset.
#
# IPset was a feature introduced in the linux kernel 2.6.39 and 3.0.0
# kernels, and you need Shorewall >= 4.5.5 to use this action.
#
# The default Shorewall configuration is with "BLACKLISTNEWONLY=Yes" (see
# file /etc/shorewall/shorewall.conf). This means that when Fail2ban adds a
# new shorewall rule to ban an IP address, that rule will affect only new
# connections. So if the attacker goes on trying using the same connection
# he could even log in. In order to get the same behavior of the iptable
# action (so that the ban is immediate) the /etc/shorewall/shorewall.conf
# file should me modified with "BLACKLISTNEWONLY=No".
#
#
# Enable shorewall to use a blacklist using iptables creating a file
# /etc/shorewall/blrules and adding "DROP net:+f2b-ssh all" and
# similar lines for every jail. To enable restoring you ipset you
# must set SAVE_IPSETS=Yes in shorewall.conf . You can read more
# about ipsets handling in Shorewall at http://shorewall.net/ipsets.html
#
# To force creation of the ipset in the case that somebody deletes the
# ipset create a file /etc/shorewall/initdone and add one line for
# every ipset (this files are in Perl) and add 1 at the end of the file.
# The example:
# system("/usr/sbin/ipset -quiet -exist create f2b-ssh hash:ip timeout 600 ");
# 1;
#
# To destroy the ipset in shorewall you must add to the file /etc/shorewall/stopped
# # One line of every ipset
# system("/usr/sbin/ipset -quiet destroy f2b-ssh ");
# 1; # This must go to the end of the file if not shorewall compilation fails
#
[Definition]
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart = if ! ipset -quiet -name list f2b-<name> >/dev/null;
then ipset -quiet -exist create f2b-<name> hash:ip timeout <default-timeout>;
fi
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop = ipset flush f2b-<name>
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
actionprolong = %(actionban)s
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = ipset del f2b-<name> <ip> -exist
# Option: default-timeout
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
# Values: [ NUM ] Default: 600
default-timeout = 600
+19 -5
View File
@@ -9,7 +9,7 @@
# connections. So if the attempter goes on trying using the same connection
# he could even log in. In order to get the same behavior of the iptable
# action (so that the ban is immediate) the /etc/shorewall/shorewall.conf
# file should me modified with "BLACKLISTNEWONLY=No". Note that as of
# file should be modified with "BLACKLISTNEWONLY=No". Note that as of
# Shorewall 4.5.13 BLACKLISTNEWONLY is deprecated; however the equivalent
# of BLACKLISTNEWONLY=No can now be achieved by setting BLACKLIST="ALL".
#
@@ -17,13 +17,13 @@
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -40,7 +40,7 @@ actioncheck =
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionban = shorewall <blocktype> <ip>
actionban = shorewall<family> <blocktype> <ip>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
@@ -48,12 +48,26 @@ actionban = shorewall <blocktype> <ip>
# Tags: See jail.conf(5) man page
# Values: CMD
#
actionunban = shorewall allow <ip>
actionunban = shorewall<family> allow <ip>
[Init]
# Option: family
# Note: Control which version of command is executed
# Values: Empty or 6 in case of IPv6
family =
# Option: blocktype
# Note: This is what the action does with rules.
# See man page of shorewall for options that include drop, logdrop, reject, or logreject
# Values: STRING
blocktype = reject
[Init?family=inet6]
# Option: family
# Note: Control which version of command is executed
# Values: Empty or 6 in case of IPv6
family = 6
+13 -7
View File
@@ -68,6 +68,7 @@ Matches for %(ip)s for jail %(jailname)s:
%(ipjailmatches)s
"""
class SMTPAction(ActionBase):
"""Fail2Ban action which sends emails to inform on jail starting,
stopping and bans.
@@ -122,9 +123,12 @@ class SMTPAction(ActionBase):
self.message_values = CallingMap(
jailname = self._jail.name,
hostname = socket.gethostname,
bantime = self._jail.actions.getBanTime,
bantime = lambda: self._jail.actions.getBanTime(),
)
# bypass ban/unban for restored tickets
self.norestored = 1
def _sendMessage(self, subject, text):
"""Sends message based on arguments and instance's properties.
@@ -155,25 +159,25 @@ class SMTPAction(ActionBase):
try:
self._logSys.debug("Connected to SMTP '%s', response: %i: %s",
self.host, *smtp.connect(self.host))
if self.user and self.password:
if self.user and self.password: # pragma: no cover (ATM no tests covering that)
smtp.login(self.user, self.password)
failed_recipients = smtp.sendmail(
self.fromaddr, self.toaddr.split(", "), msg.as_string())
except smtplib.SMTPConnectError:
except smtplib.SMTPConnectError: # pragma: no cover
self._logSys.error("Error connecting to host '%s'", self.host)
raise
except smtplib.SMTPAuthenticationError:
except smtplib.SMTPAuthenticationError: # pragma: no cover
self._logSys.error(
"Failed to authenticate with host '%s' user '%s'",
self.host, self.user)
raise
except smtplib.SMTPException:
except smtplib.SMTPException: # pragma: no cover
self._logSys.error(
"Error sending mail to host '%s' from '%s' to '%s'",
self.host, self.fromaddr, self.toaddr)
raise
else:
if failed_recipients:
if failed_recipients: # pragma: no cover
self._logSys.warning(
"Email to '%s' failed to following recipients: %r",
self.toaddr, failed_recipients)
@@ -182,7 +186,7 @@ class SMTPAction(ActionBase):
try:
self._logSys.debug("Disconnected from '%s', response %i: %s",
self.host, *smtp.quit())
except smtplib.SMTPServerDisconnected:
except smtplib.SMTPServerDisconnected: # pragma: no cover
pass # Not connected
def start(self):
@@ -210,6 +214,8 @@ class SMTPAction(ActionBase):
Dictionary which includes information in relation to
the ban.
"""
if aInfo.get('restored'):
return
aInfo.update(self.message_values)
message = "".join([
messages['ban']['head'],
@@ -3,17 +3,20 @@
# Author: Yaroslav Halchenko
#
[INCLUDES]
before = iptables-common.conf
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
@@ -22,21 +25,21 @@ actionstop =
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck = iptables -n -L <chain>
actioncheck = <iptables> -n -L <chain>
# Option: actionban
# Notes.: command executed when banning an IP.
# Values: CMD
#
actionban = echo 'all' >| /etc/symbiosis/firewall/blacklist.d/<ip>.auto
iptables -I <chain> 1 -s <ip> -j <blocktype>
<iptables> -I <chain> 1 -s <ip> -j <blocktype>
# Option: actionunban
# Notes.: command executed when unbanning an IP.
# Values: CMD
#
actionunban = rm -f /etc/symbiosis/firewall/blacklist.d/<ip>.auto
iptables -D <chain> -s <ip> -j <blocktype> || :
<iptables> -D <chain> -s <ip> -j <blocktype> || :
[Init]
+4 -2
View File
@@ -13,9 +13,11 @@ actionstop =
actioncheck =
actionban = [ -n "<application>" ] && app="app <application>" ; ufw insert <insertpos> <blocktype> from <ip> to <destination> $app
actionban = [ -n "<application>" ] && app="app <application>"
ufw insert <insertpos> <blocktype> from <ip> to <destination> $app
actionunban = [ -n "<application>" ] && app="app <application>" ; ufw delete <blocktype> from <ip> to <destination> $app
actionunban = [ -n "<application>" ] && app="app <application>"
ufw delete <blocktype> from <ip> to <destination> $app
[Init]
# Option: insertpos
+34 -15
View File
@@ -1,7 +1,7 @@
# Fail2Ban action for sending xarf Login-Attack messages to IP owner
#
# IMPORTANT:
#
# IMPORTANT:
#
# Emailing a IP owner of abuse is a serious complain. Make sure that it is
# serious. Fail2ban developers and network owners recommend you only use this
# action for:
@@ -22,7 +22,7 @@
# Login-Attack, Malware-Attack, Fraud (Phishing, etc.), Info DNSBL
#
# For details see:
# https://github.com/abusix/xarf-specification
# https://github.com/xarf/xarf-specification
# http://www.x-arf.org/schemata.html
#
# Author: Daniel Black
@@ -32,45 +32,64 @@
[Definition]
# bypass ban/unban for restored tickets
norestored = 1
actionstart =
actionstop =
actioncheck =
actionban = oifs=${IFS}; IFS=.;SEP_IP=( <ip> ); set -- ${SEP_IP}; ADDRESSES=$(dig +short -t txt -q $4.$3.$2.$1.abuse-contacts.abusix.org); IFS=${oifs}
actionban = oifs=${IFS};
RESOLVER_ADDR="%(addr_resolver)s"
if [ "<debug>" -gt 0 ]; then echo "try to resolve $RESOLVER_ADDR"; fi
ADDRESSES=$(dig +short -t txt -q $RESOLVER_ADDR | tr -d '"')
IFS=,; ADDRESSES=$(echo $ADDRESSES)
IFS=${oifs}
IP=<ip>
FROM=<sender>
SERVICE=<service>
FAILURES=<failures>
REPORTID=<time>@`uname -n`
REPORTID=<time>@<fq-hostname>
TLP=<tlp>
PORT=<port>
DATE=`LC_TIME=C date -u --date=@<time> +"%%a, %%d %%h %%Y %%T +0000"`
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
if [ ! -z "$ADDRESSES" ]; then
(printf -- %%b "<header>\n<message>\n<report>\n";
oifs=${IFS}; IFS=,; ADDRESSES=$(echo $ADDRESSES)
IFS=${oifs}
(printf -- %%b "<header>\n<message>\n<report>\n\n";
date '+Note: Local timezone is %%z (%%Z)';
printf -- %%b "<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> ${ADDRESSES//,/\" \"}
printf -- %%b "\n<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> $ADDRESSES
fi
actionunban =
[Init]
# Server as resolver used in dig command
#
addr_resolver = <ip-rev>abuse-contacts.abusix.org
# Option: boundary
# Notes: This can be overwritten to be safe for possible predictions
boundary = bfbb0f920793ac03cb8634bde14d8a1e
_boundary = Abuse<time>-<boundary>
# Option: header
# Notes: This is really a fixed value
header = Subject: abuse report about $IP - $DATE\nAuto-Submitted: auto-generated\nX-XARF: PLAIN\nContent-Transfer-Encoding: 7bit\nContent-Type: multipart/mixed; charset=utf8;\n boundary=Abuse-bfbb0f920793ac03cb8634bde14d8a1e;\n\n--Abuse-bfbb0f920793ac03cb8634bde14d8a1e\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf-8;\n
header = Subject: abuse report about $IP - $DATE\nAuto-Submitted: auto-generated\nX-XARF: PLAIN\nContent-Transfer-Encoding: 7bit\nContent-Type: multipart/mixed; charset=utf8;\n boundary=%(_boundary)s;\n\n--%(_boundary)s\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf-8;\n
# Option: footer
# Notes: This is really a fixed value and needs to match the report and header
# mime delimiters
footer = \n\n--Abuse-bfbb0f920793ac03cb8634bde14d8a1e--
footer = \n\n--%(_boundary)s--
# Option: report
# Notes: Intended to be fixed
report = --Abuse-bfbb0f920793ac03cb8634bde14d8a1e\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf-8; name=\"report.txt\";\n\n---\nReported-From: $FROM\nCategory: abuse\nReport-ID: $REPORTID\nReport-Type: login-attack\nService: $SERVICE\nVersion: 0.2\nUser-Agent: Fail2ban v0.9\nDate: $DATE\nSource-Type: ip-address\nSource: $IP\nPort: $PORT\nSchema-URL: http://www.x-arf.org/schema/abuse_login-attack_0.1.2.json\nAttachment: text/plain\nOccurances: $FAILURES\nTLP: $TLP\n\n\n--Abuse-bfbb0f920793ac03cb8634bde14d8a1e\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf8; name=\"logfile.log\";
report = --%(_boundary)s\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf-8; name=\"report.txt\";\n\n---\nReported-From: $FROM\nCategory: abuse\nReport-ID: $REPORTID\nReport-Type: login-attack\nService: $SERVICE\nVersion: 0.2\nUser-Agent: Fail2ban v0.9\nDate: $DATE\nSource-Type: ip-address\nSource: $IP\nPort: $PORT\nSchema-URL: http://www.x-arf.org/schema/abuse_login-attack_0.1.2.json\nAttachment: text/plain\nOccurances: $FAILURES\nTLP: $TLP\n\n\n--%(_boundary)s\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-Type: text/plain; charset=utf8; name=\"logfile.log\";
# Option: Message
# Notes: This can be modified by the users
# Notes: This can be modified by the users
message = Dear Sir/Madam,\n\nWe have detected abuse from the IP address $IP, which according to abusix.com is on your network. We would appreciate if you would investigate and take action as appropriate.\n\nLog lines are given below, but please ask if you require any further information.\n\n(If you are not the correct person to contact about this please accept our apologies - your e-mail address was extracted from the whois record by an automated process.)\n\n This mail was generated by Fail2Ban in a X-ARF format! You can find more information about x-arf at http://www.x-arf.org/specification.html.\n\nThe recipient address of this report was provided by the Abuse Contact DB by abusix.com. abusix.com does not maintain the content of the database. All information which we pass out, derives from the RIR databases and is processed for ease of use. If you want to change or report non working abuse contacts please contact the appropriate RIR. If you have any further question, contact abusix.com directly via email (info@abusix.com). Information about the Abuse Contact Database can be found here: https://abusix.com/global-reporting/abuse-contact-db\nabusix.com is neither responsible nor liable for the content or accuracy of this message.\n
# Option: loglines
@@ -97,7 +116,7 @@ mailargs = -f <sender>
# Option: tlp
# Notes.: Traffic light protocol defining the sharing of this information.
# http://www.trusted-introducer.org/ISTLPv11.pdf
# green is share to those involved in network security but it is not
# green is share to those involved in network security but it is not
# to be released to the public.
tlp = green
@@ -116,7 +135,7 @@ logpath = /dev/null
# Option: sender
# Notes.: This is the sender that is included in the XARF report
sender = fail2ban@`uname -n`
sender = fail2ban@<fq-hostname>
# Option: port
# Notes.: This is the port number that received the login-attack
+27 -4
View File
@@ -5,11 +5,11 @@
# Changes: in most of the cases you should not modify this
# file, but provide customizations in fail2ban.local file, e.g.:
#
# [Definition]
# [DEFAULT]
# loglevel = DEBUG
#
[Definition]
[DEFAULT]
# Option: loglevel
# Notes.: Set the log level output.
@@ -30,10 +30,16 @@ loglevel = INFO
# using logrotate -- also adjust or disable rotation in the
# corresponding configuration file
# (e.g. /etc/logrotate.d/fail2ban on Debian systems)
# Values: [ STDOUT | STDERR | SYSLOG | FILE ] Default: STDERR
# Values: [ STDOUT | STDERR | SYSLOG | SYSOUT | FILE ] Default: STDERR
#
logtarget = /var/log/fail2ban.log
# Option: syslogsocket
# Notes: Set the syslog socket file. Only used when logtarget is SYSLOG
# auto uses platform.system() to determine predefined paths
# Values: [ auto | FILE ] Default: auto
syslogsocket = auto
# Option: socket
# Notes.: Set the socket file. This is used to communicate with the daemon. Do
# not remove this file when Fail2ban runs. It will not be possible to
@@ -60,4 +66,21 @@ dbfile = /var/lib/fail2ban/fail2ban.sqlite3
# Options: dbpurgeage
# Notes.: Sets age at which bans should be purged from the database
# Values: [ SECONDS ] Default: 86400 (24hours)
dbpurgeage = 86400
dbpurgeage = 1d
# Options: dbmaxmatches
# Notes.: Number of matches stored in database per ticket (resolvable via
# tags <ipmatches>/<ipjailmatches> in actions)
# Values: [ INT ] Default: 10
dbmaxmatches = 10
[Definition]
[Thread]
# Options: stacksize
# Notes.: Specifies the stack size (in KiB) to be used for subsequently created threads,
# and must be 0 or a positive integer value of at least 32.
# Values: [ SIZE ] Default: 0 (use platform or configured default)
#stacksize = 0
+2
View File
@@ -9,6 +9,8 @@ failregex = ^\s[+-]\d{4} \S+ \d{3}0[1-9] \S+ <HOST>:\d+ [\d.]+:\d+ \d+ \d+ \d+\s
ignoreregex =
datepattern = {^LN-BEG}
# DEV Notes:
# http://www.3proxy.ru/howtoe.asp#ERRORS indicates that 01-09 are
# all authentication problems (%E field)
+33 -18
View File
@@ -9,20 +9,32 @@ before = apache-common.conf
[Definition]
# Mode for filter: normal (default) and aggressive (allows DDoS & brute force detection of mod_evasive)
mode = normal
failregex = ^%(_apache_error_client)s (AH01797: )?client denied by server configuration: (uri )?\S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01617: )?user .*? authentication failure for "\S*": Password Mismatch(, referer: \S+)?$
^%(_apache_error_client)s (AH01618: )?user .*? not found(: )?\S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01614: )?client used wrong authentication scheme: \S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH\d+: )?Authorization of user \S+ to access \S* failed, reason: .*$
^%(_apache_error_client)s (AH0179[24]: )?(Digest: )?user .*?: password mismatch: \S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH0179[01]: |Digest: )user `.*?' in realm `.+' (not found|denied by provider): \S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01631: )?user .*?: authorization failure for "\S*":(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01775: )?(Digest: )?invalid nonce .* received - length is not \S+(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01788: )?(Digest: )?realm mismatch - got `.*?' but expected `.+'(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01789: )?(Digest: )?unknown algorithm `.*?' received: \S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01793: )?invalid qop `.*?' received: \S*(, referer: \S+)?\s*$
^%(_apache_error_client)s (AH01777: )?(Digest: )?invalid nonce .*? received - user attempted time travel(, referer: \S+)?\s*$
# ignore messages of mod_evasive module:
apache-pref-ign-normal = (?!evasive)
# allow "denied by server configuration" from all modules:
apache-pref-ign-aggressive =
# mode related ignore prefix for common _apache_error_client substitution:
apache-pref-ignore = <apache-pref-ign-<mode>>
prefregex = ^%(_apache_error_client)s (?:AH\d+: )?<F-CONTENT>.+</F-CONTENT>$
# auth_type = ((?:Digest|Basic): )?
auth_type = ([A-Z]\w+: )?
failregex = ^client (?:denied by server configuration|used wrong authentication scheme)\b
^user (?!`)<F-USER>(?:\S*|.*?)</F-USER> (?:auth(?:oriz|entic)ation failure|not found|denied by provider)\b
^Authorization of user <F-USER>(?:\S*|.*?)</F-USER> to access .*? failed\b
^%(auth_type)suser <F-USER>(?:\S*|.*?)</F-USER>: password mismatch\b
^%(auth_type)suser `<F-USER>(?:[^']*|.*?)</F-USER>' in realm `.+' (auth(?:oriz|entic)ation failure|not found|denied by provider)\b
^%(auth_type)sinvalid nonce .* received - length is not\b
^%(auth_type)srealm mismatch - got `(?:[^']*|.*?)' but expected\b
^%(auth_type)sunknown algorithm `(?:[^']*|.*?)' received\b
^invalid qop `(?:[^']*|.*?)' received\b
^%(auth_type)sinvalid nonce .*? received - user attempted time travel\b
^(?:No h|H)ostname \S+ provided via SNI(?:, but no hostname provided| and hostname \S+ provided| for a name based virtual host)\b
ignoreregex =
@@ -43,14 +55,17 @@ ignoreregex =
# all of these expressions. Lots of submodules like mod_authz_* return back to mod_authz_core
# to return the actual failure.
#
# Note that URI can contain spaces.
#
# See also: http://wiki.apache.org/httpd/ListOfErrors
# Expressions that don't have tests and aren't common.
# more be added with https://issues.apache.org/bugzilla/show_bug.cgi?id=55284
# ^%(_apache_error_client)s (AH01778: )?user .*: nonce expired \([\d.]+ seconds old - max lifetime [\d.]+\) - sending new nonce\s*$
# ^%(_apache_error_client)s (AH01779: )?user .*: one-time-nonce mismatch - sending new nonce\s*$
# ^%(_apache_error_client)s (AH02486: )?realm mismatch - got `.*' but no realm specified\s*$
# ^user .*: nonce expired \([\d.]+ seconds old - max lifetime [\d.]+\) - sending new nonce\s*$
# ^user .*: one-time-nonce mismatch - sending new nonce\s*$
# ^realm mismatch - got `(?:[^']*|.*?)' but no realm specified\s*$
#
# referer is always in error log messages if it exists added as per the log_error_core function in server/log.c
# Because url/referer are foreign input, short form of regex used if long enough to idetify failure.
#
# Author: Cyril Jaquier
# Major edits by Daniel Black
# Major edits by Daniel Black and Ben Rubson.
# Rewritten for v.0.10 by Sergey Brester (sebres).
+6 -3
View File
@@ -7,13 +7,16 @@
[Definition]
badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider
badbots = Atomic_Email_Hunter/4\.0|atSpider/1\.0|autoemailspider|bwh3_user_agent|China Local Browse 2\.6|ContactBot/0\.2|ContentSmartz|DataCha0s/2\.0|DBrowse 1\.4b|DBrowse 1\.4d|Demo Bot DOT 16b|Demo Bot Z 16b|DSurf15a 01|DSurf15a 71|DSurf15a 81|DSurf15a VA|EBrowse 1\.4b|Educate Search VxB|EmailSiphon|EmailSpider|EmailWolf 1\.00|ESurf15a 15|ExtractorPro|Franklin Locator 1\.8|FSurf15a 01|Full Web Bot 0416B|Full Web Bot 0516B|Full Web Bot 2816B|Guestbook Auto Submitter|Industry Program 1\.0\.x|ISC Systems iRc Search 2\.1|IUPUI Research Bot v 1\.9a|LARBIN-EXPERIMENTAL \(efp@gmx\.net\)|LetsCrawl\.com/1\.0 +http\://letscrawl\.com/|Lincoln State Web Browser|LMQueueBot/0\.2|LWP\:\:Simple/5\.803|Mac Finder 1\.0\.xx|MFC Foundation Class Library 4\.0|Microsoft URL Control - 6\.00\.8xxx|Missauga Locate 1\.0\.0|Missigua Locator 1\.9|Missouri College Browse|Mizzu Labs 2\.2|Mo College 1\.9|MVAClient|Mozilla/2\.0 \(compatible; NEWT ActiveX; Win32\)|Mozilla/3\.0 \(compatible; Indy Library\)|Mozilla/3\.0 \(compatible; scan4mail \(advanced version\) http\://www\.peterspages\.net/?scan4mail\)|Mozilla/4\.0 \(compatible; Advanced Email Extractor v2\.xx\)|Mozilla/4\.0 \(compatible; Iplexx Spider/1\.0 http\://www\.iplexx\.at\)|Mozilla/4\.0 \(compatible; MSIE 5\.0; Windows NT; DigExt; DTS Agent|Mozilla/4\.0 efp@gmx\.net|Mozilla/5\.0 \(Version\: xxxx Type\:xx\)|NameOfAgent \(CMS Spider\)|NASA Search 1\.0|Nsauditor/1\.x|PBrowse 1\.4b|PEval 1\.4b|Poirot|Port Huron Labs|Production Bot 0116B|Production Bot 2016B|Production Bot DOT 3016B|Program Shareware 1\.0\.2|PSurf15a 11|PSurf15a 51|PSurf15a VA|psycheclone|RSurf15a 41|RSurf15a 51|RSurf15a 81|searchbot admin@google\.com|ShablastBot 1\.0|snap\.com beta crawler v0|Snapbot/1\.0|Snapbot/1\.0 \(Snap Shots&#44; +http\://www\.snap\.com\)|sogou develop spider|Sogou Orion spider/3\.0\(+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sogou spider|Sogou web spider/3\.0\(+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sohu agent|SSurf15a 11 |TSurf15a 11|Under the Rainbow 2\.2|User-Agent\: Mozilla/4\.0 \(compatible; MSIE 6\.0; Windows NT 5\.1\)|VadixBot|WebVulnCrawl\.unknown/1\.0 libwww-perl/5\.803|Wells Search II|WEP Search 00
badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider|(?:Mozilla/\d+\.\d+ )?Jorgee
badbots = Atomic_Email_Hunter/4\.0|atSpider/1\.0|autoemailspider|bwh3_user_agent|China Local Browse 2\.6|ContactBot/0\.2|ContentSmartz|DataCha0s/2\.0|DBrowse 1\.4b|DBrowse 1\.4d|Demo Bot DOT 16b|Demo Bot Z 16b|DSurf15a 01|DSurf15a 71|DSurf15a 81|DSurf15a VA|EBrowse 1\.4b|Educate Search VxB|EmailSiphon|EmailSpider|EmailWolf 1\.00|ESurf15a 15|ExtractorPro|Franklin Locator 1\.8|FSurf15a 01|Full Web Bot 0416B|Full Web Bot 0516B|Full Web Bot 2816B|Guestbook Auto Submitter|Industry Program 1\.0\.x|ISC Systems iRc Search 2\.1|IUPUI Research Bot v 1\.9a|LARBIN-EXPERIMENTAL \(efp@gmx\.net\)|LetsCrawl\.com/1\.0 \+http\://letscrawl\.com/|Lincoln State Web Browser|LMQueueBot/0\.2|LWP\:\:Simple/5\.803|Mac Finder 1\.0\.xx|MFC Foundation Class Library 4\.0|Microsoft URL Control - 6\.00\.8xxx|Missauga Locate 1\.0\.0|Missigua Locator 1\.9|Missouri College Browse|Mizzu Labs 2\.2|Mo College 1\.9|MVAClient|Mozilla/2\.0 \(compatible; NEWT ActiveX; Win32\)|Mozilla/3\.0 \(compatible; Indy Library\)|Mozilla/3\.0 \(compatible; scan4mail \(advanced version\) http\://www\.peterspages\.net/?scan4mail\)|Mozilla/4\.0 \(compatible; Advanced Email Extractor v2\.xx\)|Mozilla/4\.0 \(compatible; Iplexx Spider/1\.0 http\://www\.iplexx\.at\)|Mozilla/4\.0 \(compatible; MSIE 5\.0; Windows NT; DigExt; DTS Agent|Mozilla/4\.0 efp@gmx\.net|Mozilla/5\.0 \(Version\: xxxx Type\:xx\)|NameOfAgent \(CMS Spider\)|NASA Search 1\.0|Nsauditor/1\.x|PBrowse 1\.4b|PEval 1\.4b|Poirot|Port Huron Labs|Production Bot 0116B|Production Bot 2016B|Production Bot DOT 3016B|Program Shareware 1\.0\.2|PSurf15a 11|PSurf15a 51|PSurf15a VA|psycheclone|RSurf15a 41|RSurf15a 51|RSurf15a 81|searchbot admin@google\.com|ShablastBot 1\.0|snap\.com beta crawler v0|Snapbot/1\.0|Snapbot/1\.0 \(Snap Shots&#44; \+http\://www\.snap\.com\)|sogou develop spider|Sogou Orion spider/3\.0\(\+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sogou spider|Sogou web spider/3\.0\(\+http\://www\.sogou\.com/docs/help/webmasters\.htm#07\)|sohu agent|SSurf15a 11 |TSurf15a 11|Under the Rainbow 2\.2|User-Agent\: Mozilla/4\.0 \(compatible; MSIE 6\.0; Windows NT 5\.1\)|VadixBot|WebVulnCrawl\.unknown/1\.0 libwww-perl/5\.803|Wells Search II|WEP Search 00
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"(?:%(badbots)s|%(badbotscustom)s)"$
failregex = ^<HOST> -.*"(GET|POST|HEAD).*HTTP.*"(?:%(badbots)s|%(badbotscustom)s)"$
ignoreregex =
datepattern = ^[^\[]*\[({DATE})
{^LN-BEG}
# DEV Notes:
# List of bad bots fetched from http://www.user-agents.org
# Generated on Thu Nov 7 14:23:35 PST 2013 by files/gen_badbots.
+7 -16
View File
@@ -3,7 +3,7 @@
# This filter is aimed at blocking specific URLs that don't exist. This
# could be a set of URLs places in a Disallow: directive in robots.txt or
# just some web services that don't exist caused bots are searching for
# exploitable content. This filter is designed to have a low false postitive
# exploitable content. This filter is designed to have a low false positive
# rate due.
#
# An alternative to this is the apache-noscript filter which blocks all
@@ -17,30 +17,21 @@
[INCLUDES]
# overwrite with apache-common.local if _apache_error_client is incorrect.
# Load regexes for filtering from botsearch-common.conf
before = apache-common.conf
botsearch-common.conf
[Definition]
failregex = ^%(_apache_error_client)s ((AH001(28|30): )?File does not exist|(AH01264: )?script not found or unable to stat): <webroot><block>(, referer: \S+)?\s*$
^%(_apache_error_client)s script '<webroot><block>' not found or unable to stat(, referer: \S+)?\s*$
prefregex = ^%(_apache_error_client)s (?:AH\d+: )?<F-CONTENT>.+</F-CONTENT>$
failregex = ^(?:File does not exist|script not found or unable to stat): <webroot><block>(, referer: \S+)?\s*$
^script '<webroot><block>' not found or unable to stat(, referer: \S+)?\s*$
ignoreregex =
[Init]
# Webroot represents the webroot on which all other files are based
webroot = /var/www/
# Block is the actual non-found directories to block
block = (<webmail>|<phpmyadmin>|<wordpress>)[^,]*
# These are just convient definitions that assist the blocking of stuff that
# isn't installed
webmail = roundcube|(ext)?mail|horde|(v-?)?webmail
phpmyadmin = (typo3/|xampp/|admin/|)(pma|(php)?[Mm]y[Aa]dmin)
wordpress = wp-(login|signup)\.php
# DEV Notes:
+24 -1
View File
@@ -3,12 +3,35 @@
[INCLUDES]
before = common.conf
# Load customizations if any available
after = apache-common.local
[DEFAULT]
_apache_error_client = \[\] \[(:?error|\S+:\S+)\]( \[pid \d+(:\S+ \d+)?\])? \[client <HOST>(:\d{1,5})?\]
# Apache logging mode:
# all - universal prefix (logfile, syslog)
# logfile - logfile only
# syslog - syslog only
# Use `filter = apache-auth[logging=syslog]` to get more precise regex if apache logs into syslog (ErrorLog syslog).
# Use `filter = apache-auth[logging=all]` to get universal regex matches both logging variants.
logging = logfile
# Apache logging prefixes (date-pattern prefix, server, process etc.):
apache-prefix-syslog = %(__prefix_line)s
apache-prefix-logfile = \[\]\s
apache-prefix-all = (?:%(apache-prefix-logfile)s|%(apache-prefix-syslog)s)?
# Setting for __prefix_line (only `logging=syslog`):
_daemon = (?:apache\d*|httpd(?:/\w+)?)
apache-prefix = <apache-prefix-<logging>>
apache-pref-ignore =
_apache_error_client = <apache-prefix>\[(:?error|<apache-pref-ignore>\S+:\S+)\]( \[pid \d+(:\S+ \d+)?\])? \[client <HOST>(:\d{1,5})?\]
datepattern = {^LN-BEG}
# Common prefix for [error] apache messages which also would include <HOST>
# Depending on the version it could be
+16
View File
@@ -0,0 +1,16 @@
# Fail2Ban filter for fake Googlebot User Agents
[Definition]
failregex = ^<HOST> .*Googlebot.*$
ignoreregex =
datepattern = ^[^\[]*\[({DATE})
{^LN-BEG}
# DEV Notes:
#
# Author: Lee Clemens
# Thanks: Johannes B. Ullrich, Ph.D.
# Reference: https://isc.sans.edu/forums/diary/When+Google+isnt+Google/15968/
+2 -1
View File
@@ -10,9 +10,10 @@ before = apache-common.conf
[Definition]
failregex = ^%(_apache_error_client)s ModSecurity: (\[.*?\] )*Access denied with code [45]\d\d.*$
failregex = ^%(_apache_error_client)s(?: \[client [^\]]+\])? ModSecurity:\s+(?:\[(?:\w+ \"[^\"]*\"|[^\]]*)\]\s*)*Access denied with code [45]\d\d
ignoreregex =
# https://github.com/SpiderLabs/ModSecurity/wiki/ModSecurity-2-Data-Formats
# Author: Daniel Black
# Sergey G. Brester aka sebres (review, optimization)
+7 -2
View File
@@ -17,8 +17,13 @@ before = apache-common.conf
[Definition]
failregex = ^%(_apache_error_client)s ((AH001(28|30): )?File does not exist|(AH01264: )?script not found or unable to stat): /\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)(, referer: \S+)?\s*$
^%(_apache_error_client)s script '/\S*(php([45]|[.-]cgi)?|\.asp|\.exe|\.pl)\S*' not found or unable to stat(, referer: \S+)?\s*$
script = /\S*(?:php(?:[45]|[.-]cgi)?|\.asp|\.exe|\.pl)
prefregex = ^%(_apache_error_client)s (?:AH0(?:01(?:28|30)|1(?:264|071)): )?(?:(?:[Ff]ile|script|[Gg]ot) )<F-CONTENT>.+</F-CONTENT>$
failregex = ^(?:does not exist|not found or unable to stat): <script>\b
^'<script>\S*' not found or unable to stat
^error '[Pp]rimary script unknown(?:\\n)?'
ignoreregex =
+5 -1
View File
@@ -8,11 +8,15 @@ before = apache-common.conf
[Definition]
failregex = ^%(_apache_error_client)s ((AH0013[456]: )?Invalid (method|URI) in request .*( - possible attempt to establish SSL connection on non-SSL port)?|(AH00565: )?request failed: URI too long \(longer than \d+\)|request failed: erroneous characters after protocol string: .*|AH00566: request failed: invalid characters in URI)(, referer: \S+)?$
failregex = ^%(_apache_error_client)s (?:(?:AH0013[456]: )?Invalid (method|URI) in request\b|(?:AH00565: )?request failed: URI too long \(longer than \d+\)|request failed: erroneous characters after protocol string:|(?:AH00566: )?request failed: invalid characters in URI\b)
ignoreregex =
# DEV Notes:
#
# [sebres] Because this 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). Thus rewritten without end-anchor ($).
#
# fgrep -r 'URI too long' httpd-2.*
# httpd-2.2.25/server/protocol.c: "request failed: URI too long (longer than %d)", r->server->limit_req_line);
+19
View File
@@ -0,0 +1,19 @@
# Fail2Ban Apache pass filter
# This filter is for access.log, NOT for error.log
#
# The knocking request must have a referer.
[Definition]
failregex = ^<HOST> - \w+ \[\] "GET <knocking_url> HTTP/1\.[01]" 200 \d+ ".*" "[^-].*"$
ignoreregex =
datepattern = ^[^\[]*\[({DATE})
{^LN-BEG}
[Init]
knocking_url = /knocking/
# Author: Viktor Szépe
+28
View File
@@ -0,0 +1,28 @@
# Fail2Ban filter to block web requests containing custom headers attempting to exploit the shellshock bug
#
#
[INCLUDES]
# overwrite with apache-common.local if _apache_error_client is incorrect.
before = apache-common.conf
[Definition]
prefregex = ^%(_apache_error_client)s (AH01215: )?/bin/([bd]a)?sh: <F-CONTENT>.+</F-CONTENT>$
failregex = ^warning: HTTP_[^:]+: ignoring function definition attempt(, referer: \S+)?\s*$
^error importing function definition for `HTTP_[^']+'(, referer: \S+)?\s*$
ignoreregex =
# DEV Notes:
#
# https://wiki.apache.org/httpd/ListOfErrors for apache error IDs
#
# example log lines:
# [Thu Sep 25 09:27:18.813902 2014] [cgi:error] [pid 16860] [client 89.207.132.76:59635] AH01215: /bin/bash: warning: HTTP_TEST: ignoring function definition attempt
# [Thu Sep 25 09:29:56.141832 2014] [cgi:error] [pid 16864] [client 162.247.73.206:41273] AH01215: /bin/bash: error importing function definition for `HTTP_TEST'
#
# Author: Eugene Hopkinson (e.hopkinson@gmail.com)
+29 -7
View File
@@ -1,24 +1,46 @@
# Fail2Ban filter for Anti-Spam SMTP Proxy Server also known as ASSP
#
# Honmepage: http://www.magicvillage.de/~Fritz_Borgstedt/assp/0003D91C-8000001C/
# ProjektSite: http://sourceforge.net/projects/assp/?source=directory
# Fail2Ban filter for Anti-Spam SMTP Proxy Server (ASSP)
# Filter works in theory for both ASSP V1 and V2. Recommended ASSP is V2.5.1 or later.
# Support for ASSP V1 ended in 2014 so if you are still running ASSP V1 an immediate upgrade is recommended.
#
# Homepage: http://sourceforge.net/projects/assp/
# ProjectSite: http://sourceforge.net/projects/assp/?source=directory
#
#
[Definition]
# Note: First three failregex matches below are for ASSP V1 with the remaining being designed for V2. Deleting the V1 regex is recommended but I left it in for compatibility reasons.
__assp_actions = (?:dropping|refusing)
failregex = ^(:? \[SSL-out\])? <HOST> max sender authentication errors \(\d{,3}\) exceeded -- %(__assp_actions)s connection - after reply: \d{3} \d{1}\.\d{1}.\d{1} Error: authentication failed: \w+;$
^(?: \[SSL-out\])? <HOST> SSL negotiation with client failed: SSL accept attempt failed with unknown error.*:unknown protocol;$
^ Blocking <HOST> - too much AUTH errors \(\d{,3}\);$
^\s*(?:[\w\-]+\s+)*(?:\[\S+\]\s+)*<HOST> (?:\<\S+@\S+\.\S+\> )*(?:to: \S+@\S+\.\S+ )*relay attempt blocked for(?: \(parsing\))?: \S+$
^\s*(?:[\w\-]+\s+)*(?:\[\S+\]\s+)*<HOST> \[SMTP Error\] 535 5\.7\.8 Error: authentication failed:\s+(?:\S+|Connection lost to authentication server|Invalid authentication mechanism|Invalid base64 data in continued response)?$
ignoreregex =
datepattern = {^LN-BEG}%%b-%%d-%%Exy %%H:%%M:%%S
{^LN-BEG}
# DEV Notes:
# V1 Examples matches:
# Apr-27-13 02:33:09 Blocking 217.194.197.97 - too much AUTH errors (41);
# Dec-29-12 17:10:31 [SSL-out] 200.247.87.82 SSL negotiation with client failed: SSL accept attempt failed with unknown errorerror:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol;
# Dec-30-12 04:01:47 [SSL-out] 81.82.232.66 max sender authentication errors (5) exceeded
#
# Examples: Apr-27-13 02:33:09 Blocking 217.194.197.97 - too much AUTH errors (41);
# Dec-29-12 17:10:31 [SSL-out] 200.247.87.82 SSL negotiation with client failed: SSL accept attempt failed with unknown errorerror:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol;
# Dec-30-12 04:01:47 [SSL-out] 81.82.232.66 max sender authentication errors (5) exceeded
# V2 Examples matches:
# Jul-29-16 16:49:52 m1-25391-06124 [Worker_1] [TLS-out] [RelayAttempt] 0.0.0.0 <user@example.com> to: user@example.org relay attempt blocked for: someone@example.org
# Jul-30-16 16:59:42 [Worker_1] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
# Jul-30-16 00:15:36 m1-52131-09651 [Worker_1] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
# Jul-31-16 06:45:59 [Worker_1] [TLS-in] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed:
# Jan-05-16 08:38:49 m1-01129-09140 [Worker_1] [TLS-in] [TLS-out] [RelayAttempt] 0.0.0.0 <user@example.com> relay attempt blocked for (parsing): <user2@example>
# Jun-12-16 16:43:37 m1-64217-12013 [Worker_1] [TLS-in] [TLS-out] [RelayAttempt] 0.0.0.0 <user@example.com> to: user2@example.com relay attempt blocked for (parsing): <a.notheruser69@example.c>
# Jan-22-16 22:25:51 [Worker_1] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: Invalid authentication mechanism
# Mar-19-16 13:42:20 [Worker_1] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: Invalid base64 data in continued response
# Jul-18-16 16:54:21 [Worker_2] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: Connection lost to authentication server
# Jul-18-16 17:14:23 m1-76453-02949 [Worker_1] [TLS-out] 0.0.0.0 [SMTP Error] 535 5.7.8 Error: authentication failed: Connection lost to authentication server
#
# Author: Enrico Labedzki (enrico.labedzki@deiwos.de)
# V2 Filters: Robert Hardy (rhardy@webcon.ca)
+27 -11
View File
@@ -11,23 +11,30 @@ before = common.conf
_daemon = asterisk
__pid_re = (?:\[\d+\])
__pid_re = (?:\s*\[\d+\])
iso8601 = \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+[+-]\d{4}
# All Asterisk log messages begin like this:
log_prefix= (?:NOTICE|SECURITY)%(__pid_re)s:?(?:\[C-[\da-f]*\])? \S+:\d*( in \w+:)?
log_prefix= (?:NOTICE|SECURITY|WARNING)%(__pid_re)s:?(?:\[C-[\da-f]*\])?:? [^:]+:\d*(?:(?: in)? [^:]+:)?
failregex = ^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s Registration from '[^']*' failed for '<HOST>(:\d+)?' - (Wrong password|Username/auth name mismatch|No matching peer found|Not a local domain|Device does not match ACL|Peer is not supposed to register|ACL error \(permit/deny\)|Not a local domain)$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s Call from '[^']*' \(<HOST>:\d+\) to extension '\d+' rejected because extension not found in context 'default'\.$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s Host <HOST> failed to authenticate as '[^']*'$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s No registration for peer '[^']*' \(from <HOST>\)$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s Host <HOST> failed MD5 authentication for '[^']*' \([^)]+\)$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s Failed to authenticate (user|device) [^@]+@<HOST>\S*$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s (?:handle_request_subscribe: )?Sending fake auth rejection for (device|user) \d*<sip:[^@]+@<HOST>>;tag=\w+\S*$
^(%(__prefix_line)s|\[\]\s*)%(log_prefix)s SecurityEvent="(FailedACL|InvalidAccountID|ChallengeResponseFailed|InvalidPassword)",EventTV="[\d-]+",Severity="[\w]+",Service="[\w]+",EventVersion="\d+",AccountID="\d*",SessionID="0x[\da-f]+",LocalAddress="IPV[46]/(UD|TC)P/[\da-fA-F:.]+/\d+",RemoteAddress="IPV[46]/(UD|TC)P/<HOST>/\d+"(,Challenge="\w+",ReceivedChallenge="\w+")?(,ReceivedHash="[\da-f]+")?(,ACLName="\w+")?$
^(%(__prefix_line)s|\[\]\s*WARNING%(__pid_re)s:?(?:\[C-[\da-f]*\])? )Ext\. s: "Rejecting unknown SIP connection from <HOST>"$
prefregex = ^%(__prefix_line)s%(log_prefix)s <F-CONTENT>.+</F-CONTENT>$
failregex = ^Registration from '[^']*' failed for '<HOST>(:\d+)?' - (?:Wrong password|Username/auth name mismatch|No matching peer found|Not a local domain|Device does not match ACL|Peer is not supposed to register|ACL error \(permit/deny\)|Not a local domain)$
^Call from '[^']*' \(<HOST>:\d+\) to extension '[^']*' rejected because extension not found in context
^(?:Host )?<HOST> (?:failed (?:to authenticate\b|MD5 authentication\b)|tried to authenticate with nonexistent user\b)
^No registration for peer '[^']*' \(from <HOST>\)$
^hacking attempt detected '<HOST>'$
^SecurityEvent="(?:FailedACL|InvalidAccountID|ChallengeResponseFailed|InvalidPassword)"(?:(?:,(?!RemoteAddress=)\w+="[^"]*")*|.*?),RemoteAddress="IPV[46]/[^/"]+/<HOST>/\d+"(?:,(?!RemoteAddress=)\w+="[^"]*")*$
^"Rejecting unknown SIP connection from <HOST>(?::\d+)?"$
^Request (?:'[^']*' )?from '(?:[^']*|.*?)' failed for '<HOST>(?::\d+)?'\s\(callid: [^\)]*\) - (?:No matching endpoint found|Not match Endpoint(?: Contact)? ACL|(?:Failed|Error) to authenticate)\s*$
# FreePBX (todo: make optional in v.0.10):
# ^(%(__prefix_line)s|\[\]\s*WARNING%(__pid_re)s:?(?:\[C-[\da-f]*\])? )[^:]+: Friendly Scanner from <HOST>$
ignoreregex =
datepattern = {^LN-BEG}
# Author: Xavier Devlamynck / Daniel Black
#
@@ -37,3 +44,12 @@ ignoreregex =
# First regex: channels/chan_sip.c
#
# main/logger.c:ast_log_vsyslog - "in {functionname}:" only occurs in syslog
journalmatch = _SYSTEMD_UNIT=asterisk.service
[lt_journal]
# asterisk can log timestamp if logs into systemd-journal (optional part matching this timestamp, gh-2383):
__extra_timestamp = (?:\[[^\]]+\]\s+)?
__prefix_line = %(known/__prefix_line)s%(__extra_timestamp)s
+6
View File
@@ -0,0 +1,6 @@
# Fail2Ban filter for Bitwarden
# Detecting failed login attempts
# Logged in bwdata/logs/identity/Identity/log.txt
[Definition]
failregex = ^\s*\[WRN\]\s+Failed login attempt(?:, 2FA invalid)?\. <HOST>$
+19
View File
@@ -0,0 +1,19 @@
# Generic configuration file for -botsearch filters
[Init]
# Block is the actual non-found directories to block
block = \/?(<webmail>|<phpmyadmin>|<wordpress>|cgi-bin|mysqladmin)[^,]*
# These are just convenient definitions that assist the blocking of stuff that
# isn't installed
webmail = roundcube|(ext)?mail|horde|(v-?)?webmail
phpmyadmin = (typo3/|xampp/|admin/|)(pma|(php)?[Mm]y[Aa]dmin)
wordpress = wp-(login|signup|admin)\.php
# DEV Notes:
# Taken from apache-botsearch filter
#
# Author: Frantisek Sumsal

Some files were not shown because too many files have changed in this diff Show More