Commit Graph

1971 Commits (8faff41d40b5382f9871aa256a858d17f9588c7f)

Author SHA1 Message Date
Yaroslav Halchenko 8faff41d40 DOC: changelog entry on leaky file descriptors 2014-04-16 08:48:52 -04:00
Yaroslav Halchenko 6eb67899a5 BF: overcome problem with failed *_movefile test if file gets properly closed
Discussion is in the comments on 7260403fdd
and fix consists of skipping first 3 lines while creating a "new" log file.
This should be sufficient to make fail2ban detect "log rotation" and thus
function properly
2014-04-16 08:43:54 -04:00
Yaroslav Halchenko dfc7dd6dc9 ENH: use unique filename in LogFileFilterPoll on every setUp call 2014-04-16 08:26:39 -04:00
Yaroslav Halchenko e19f9e1697 BF(?): stop/join notifier only if defined
Somehow on that elderly squeeze Debian sparc box, I got error that self.__notifier
was not defined.  So first I did define it now in the constructor, but mystery remains
how come it was not defined -- wasn"t run() then run (where it is defined)?

Anyways -- conditioning on it being defined might be safer may be?
Not sure (need to go to sleep) if with this change but on this box I also run from time
to time either into stalling of fail2ban-testcases and refusing to exit normally or

======================================================================
ERROR: test_move_into_file_after_removed (testcases.filtertestcase.MonitorFailures<FilterPyinotify>(/tmp/monitorfailures_FilterPyinotifypcHmMJfail2ban))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yoh/deb/gits/fail2ban/testcases/filtertestcase.py", line 473, in tearDown
    self.filter.stop()
  File "/home/yoh/deb/gits/fail2ban/server/filterpyinotify.py", line 196, in stop
    self.__notifier.stop()
  File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1315, in stop
    threading.Thread.join(self)
  File "/usr/lib/python2.6/threading.py", line 633, in join
    raise RuntimeError("cannot join thread before it is started")
RuntimeError: cannot join thread before it is started

that is with pyinotify 0.8.9-1 so could quite be "related" to its age.
2014-04-16 08:26:38 -04:00
Yaroslav Halchenko cb9cbd754e DOC: minor wording fix 2014-04-16 08:26:38 -04:00
Yaroslav Halchenko f206c3d493 BF: give a custom prefix to a tempfile and close it upon tearDown in ExecuteActions tests 2014-04-16 08:26:38 -04:00
Yaroslav Halchenko 8cb6ec54ac Merge pull request #691 from yarikoptic/enh/travis_multiple_log_levels
ENH: run travis with both 'error' and 'heavydebug' levels to ease troubleshooting of failures
2014-04-16 00:50:54 -04:00
Yaroslav Halchenko a45467ac91 ENH: run travis with both 'error' and 'heavydebug' levels to ease troubleshooting of failures 2014-04-15 23:40:09 -04:00
Steven Hiscocks 5c2730d7be DOC: Update ChangeLog 2014-04-03 19:03:05 +01:00
Steven Hiscocks 7260403fdd TST: Close file to allow proper removal in MonitorFailures 2014-03-31 19:02:28 +01:00
Daniel Black 2a31d45582 Merge pull request #669 from kwirk/inotify-watch-auto-remove
BF: Handle case when inotify watch is auto deleted on file deletion
2014-03-31 18:37:01 +11:00
Steven Hiscocks fdcded262d BF: Handle case when inotify watch is auto deleted on file deletion
When a file is deleted, the watcher for it is automatically removed.
FilterPyinotify is detecting a new file being created with the same
name, and in turn attempts to remove the watch for the deleted file
(which has already been removed automatically).

Also, IN_IGNORED events are generated when a file is deleted, but these
weren't being caught, causing an non-existent file path to be passed to
FilterPyinotify._process_file (which caught the exceptions in
Filter.getFailures).
2014-03-29 16:38:39 +00:00
Daniel Black dfac2f700a Merge pull request #647 from yarikoptic/0.8
Minor fixes for claimed compatibility with 2.4 and 2.5 -- not to be "merged" into 0.9
2014-03-17 08:36:59 +11:00
Yaroslav Halchenko bb2d981bf8 Changelog entry 2014-03-16 11:25:12 -04:00
Yaroslav Halchenko 18b476a93e BF(PY2.4,2.5): provide bin() function (introduced in 2.6) 2014-03-16 11:15:00 -04:00
Yaroslav Halchenko 9cbb472478 BF: python 2.4 and 2.5 compatibility -- no "except ... as ..." yet 2014-03-16 10:35:58 -04:00
Daniel Black a8d0cc9af8 DOC: remove duplicate update of Fail2ban_Version 2014-03-15 21:59:22 +11:00
Daniel Black eb66edd338 DOC: DEVELOP release note changes 2014-03-15 19:14:36 +11:00
Daniel Black cee3414029 PKG: version release 2014-03-15 19:06:37 +11:00
Daniel Black 0601a07961 PKG: include nagios filter/log 2014-03-15 19:06:18 +11:00
Daniel Black 123791c94c DOC/ENH: update man pages for release 2014-03-15 18:52:18 +11:00
Daniel Black 77fda9498c ENH: pull asterisk filter change to support syslog from 0.9 branch 2014-03-14 23:15:46 +11:00
Daniel Black c3a2e8fbac Merge pull request #644 from hlein/master
ENH: Changes to --print-* options and memory use for fail2ban-regex
2014-03-14 22:32:41 +11:00
Hank Leininger 2deb1b71a1
Sanity-check print-all-* vs print-no-* options.
Also, fixed a trivial whitespace issue.
2014-03-14 02:10:00 -04:00
Hank Leininger d4fb48fd14
Add --print-no-{missed,ignored} and restore -all.
Realized --print-all-{missed,ignored} aren't meant to be simple on/off,
but are meant to enable printing all lines even when there are more
than 20.

This restores the behavior of --print-all-*, but preserves the
memory-savings when --print-all-* are not specified.

Also adds --print-no-{missed,ignored} which can be used to suppress
printing of a line type entirely.
2014-03-14 01:57:55 -04:00
Hank Leininger aa7af6f9c2
Only remember log lines we need to print later.
When testing proccessing a large logfile (430 MB, 2M lines) without
--print-all-missed or --print-all-ignored, fail2ban-regex consumes
just over 2 GB of RAM before completing.  Even though it does not need
to retain any of the missed or ignored log lines, it does anyway.

With this patch, memory use never grows beyond about 11 MB (unless
--print-all-* are enabled).
2014-03-13 23:18:08 -04:00
Hank Leininger 27dafea281
Fix the --print-all-{missed,ignored} options.
Previously, fail2ban-regex always printed both regardless of whether
those options were present or not.

This commit duplicates the patch I submitted at
https://sourceforge.net/p/fail2ban/patches/25/
2014-03-13 22:47:28 -04:00
Daniel Black 415f187644 ENH: sendmail-reject for all smtp ports. 2014-03-14 07:12:12 +11:00
Daniel Black 11fc7941f5 Merge pull request #633 from grooverdan/sendmail
MRG: Sendmail filter
2014-03-02 14:25:26 +11:00
Daniel Black 853bed8e4f ENH: more sendmail-reject filter items thanks to fab23 2014-03-02 14:04:27 +11:00
Daniel Black d0ec09a3b5 BF: move to right location 2014-03-01 15:50:30 +11:00
Daniel Black c10cc20928 ENH: rename sendmail-spam to sendmail-reject 2014-02-28 08:41:04 +11:00
Daniel Black d34569fb8d BF: email address as arg1 in sendmail filters 2014-02-27 11:38:23 +11:00
Daniel Black 72c84fe9b0 ENH: wider regex for RBL and sendmail-spam 2014-02-27 10:02:34 +11:00
Steven Hiscocks 75599fc7a0 DOC: Add reference to action argument values which contain ","
Closes gh-632
2014-02-26 22:15:59 +00:00
Steven Hiscocks 9b877928db Merge pull request #631 from grooverdan/sendmail
ENH: add filter for sendmail-{auth,spam}. Closes gh-20
2014-02-26 18:38:18 +00:00
Daniel Black fe1725c603 BF: add jail.conf definitions for sendmail* filters 2014-02-26 19:31:09 +11:00
Daniel Black 3d776afbb0 ENH: add filter for sendmail-{auth,spam}. Closes gh-20 2014-02-26 19:16:49 +11:00
Daniel Black 9be22a96a6 Merge pull request #614 from kwirk/complain-abusix
BF: Use abusix Abuse Contact DB to get more accurate abuse addresses
2014-02-20 09:17:23 +11:00
Daniel Black a90be951e9 Merge pull request #624 from kwirk/ignoreip-netmask
ENH: Allow 255.255.255.0 style mask for ignoreip
2014-02-20 07:23:46 +11:00
Steven Hiscocks 9928f1df96 ENH: Allow 255.255.255.0 style mask for ignoreip 2014-02-19 17:51:08 +00:00
Steven Hiscocks 997729e274 BF: Fix complain action for multiple recipients and misplaced ";" 2014-02-18 15:05:06 +00:00
Daniel Black 350d2dfd8e Merge pull request #618 from kwirk/xt_recent-tweaks
ENH: Add root user check in xt_recent, and add missing actionstop
2014-02-18 08:15:22 +11:00
Steven Hiscocks 4102f4f8c7 TST: Fix TravisCI build, install of coveralls from pip 2014-02-16 23:08:49 +00:00
Steven Hiscocks 7c76f7f204 BF: $EUID not avilable in all shells, replaced with `id -u` in xt_recent 2014-02-16 17:56:06 +00:00
Steven Hiscocks 2a37ee2fb7 ENH: Add root user check in xt_recent, and add missing actionstop
Thanks to Helmut Grohne on IRC for suggestion
2014-02-16 16:52:30 +00:00
Steven Hiscocks 31f4ea59cb BF: Use abusix Abuse Contact DB to get more accurate abuse addresses
Taken from xarf-login-attack action from 0.9 branch by Daniel Black
2014-02-13 22:00:33 +00:00
Steven Hiscocks 9bfc77c320 BF: fail2ban-client processCmd ret was being overwritten each loop 2014-02-13 20:03:45 +00:00
Steven Hiscocks 1e9910fcb0 ENH: Added traceback for error log on pyinotify callback when in debug
Thanks to Helmut Grohne for idea on #fail2ban IRC
2014-02-12 22:18:09 +00:00
Steven Hiscocks bda9b7d725 BF: Add handling of exception in pyinotify callback
If error isn't handled, no error messages are printed and the jail
ceases to function.
2014-02-12 18:07:31 +00:00