Steven Hiscocks
8ddc9de928
BF: Handle expected errors for python3.{0,1} when changing log target
2013-03-23 19:04:58 +00:00
Steven Hiscocks
66367876bb
Add ability to set log encoding for jail
2013-02-27 18:09:55 +00:00
Steven Hiscocks
d23d365be2
Move handling of unicode decoding to FileContainer readline
...
Also print warning for unicode decode failure, leaving as str in python2
and ignoring erroneous characters in python3
2013-02-25 22:45:16 +00:00
Steven Hiscocks
184e0eccb6
Remove redundant reassignment of variable
2013-02-24 19:28:41 +00:00
Steven Hiscocks
3a3d07ef39
Undo removal of unicode prefix in server/datetemplate.py
2013-02-24 19:22:50 +00:00
Steven Hiscocks
c8c9ed4dfc
Fix DNSUtils dnsToIp not catching general socket.error exception
2013-02-24 18:13:48 +00:00
Steven Hiscocks
0dd3a81ba2
Fix use of python3 bytes in client/server socket for python2.5
2013-02-24 18:04:40 +00:00
Steven Hiscocks
46a2b6e428
Fix up for client/server socket for python3
2013-02-24 10:10:15 +00:00
Steven Hiscocks
df255063ae
python3: Default open encoding for files to UTF-8
...
Also tidy up unicode check in processLine, which is handled by `2to3`
2013-02-23 22:20:55 +00:00
Steven Hiscocks
5d0d362e3f
Ensure jail names return in alphabetical order in status
...
Primarily to support testing as order can switch
2013-02-23 22:06:16 +00:00
Steven Hiscocks
2bb3469644
Change filter to ignore unicode errors in python3
...
Also do not try to convert unicode to unicode again for python3 and
python2
2013-02-23 21:03:51 +00:00
Steven Hiscocks
ad7119a3fe
time.mktime argument should be tuple
2013-02-23 21:01:39 +00:00
Steven Hiscocks
2ecf34540e
Change sort in datedetector to use key based comparison
2013-02-23 19:34:05 +00:00
Steven Hiscocks
99c92a56ca
Check for unicode and encode before md5sum in filter
2013-02-23 18:52:10 +00:00
Steven Hiscocks
c926c88ea1
Remove spurious space at start of line
2013-02-23 18:42:50 +00:00
Yaroslav Halchenko
154aa38e3f
BF: do not shutdown logging until all jails stop -- so move into Server.quit()
...
Together with previous commit it should resolve failures with the server tests on python < 2.6
2013-02-21 20:59:46 -05:00
Yaroslav Halchenko
012264dce1
BF: safeguard closing of log handlers + close in reverse order
...
otherwise there might be "stuck" handler in the queue. and closing
exceptions can occur -- even stock logging guards in recent versions
2013-02-21 20:58:27 -05:00
Steven Hiscocks
b36835f6f0
Added transmitter get cinfo option for action
2013-02-20 23:33:39 +00:00
Steven Hiscocks
b6a68f5138
Fix for missing value in transmitter delaction
2013-02-20 23:24:46 +00:00
Steven Hiscocks
ce3ab34dd8
Added ability to specify PID file
2013-02-17 22:14:01 +00:00
Yaroslav Halchenko
f8983872ad
BF: return str(host) to avoid spurious characters in the logs (Close gh-113)
...
thanks to opoplawski@github
2013-02-01 16:24:04 -05:00
Yaroslav Halchenko
acab23bdfe
RF: move exceptions used by both client and server into common/exceptions.py
...
this prevents importing of server while operating with client only
2013-01-28 09:46:50 -05:00
Yaroslav Halchenko
6b2e76ba7f
BF: pyinotify - use bitwise op on masks and do not try tracking newly created directories
2013-01-25 16:06:41 -05:00
blotus
96eb8986cc
Escape ' and " in matches tag
2013-01-25 13:37:22 +01:00
Daniel Black
fd7929863b
name -> IP is a normal DNS lookup not a reverse
2012-12-12 21:59:01 +11:00
Yaroslav Halchenko
67145d8b78
ENH: assure that all date templates have unique names
2012-12-11 11:18:52 -05:00
Yaroslav Halchenko
d1625253eb
ENH: debug msgs on which template was taken (+ use "is" for None comparisons)
2012-12-11 11:18:52 -05:00
Yaroslav Halchenko
2b6366656f
BF: make sorting of date templates stable
...
Before, it would first do stable sort followed with explicit reverse.
Now reverse is given as an argument to sort, and it results in actually
preserving the order in case of e.g. no sorting needed
2012-12-11 11:18:52 -05:00
Yaroslav Halchenko
37a2e59d69
BF: guarantee that IP is stored as a base, non-unicode str (Closes gh-91)
...
Otherwise it might lead to spurious characters dumped into the
terminal at few places, unless casted upon every use in the logs. To
prevent those issues in the source, store IP as a basic string if it
is a string at all
2012-11-26 12:01:42 -05:00
Yaroslav Halchenko
f10537941b
ENH: To help with gh-87 added hints into the log on some failure return codes (e.g. 0x7f00 for this one)
2012-11-07 11:33:17 -05:00
Yaroslav Halchenko
b159eabb51
BF: do not enable pyinotify backend if pyinotify is too old (Closes gh-80)
2012-11-06 13:14:42 -05:00
Yaroslav Halchenko
f52ba9923a
ENH: downgrade "already banned" from WARN to INFO level (Closes gh-79)
...
Most of the time it is a benign latency effect so nothing to warn about.
2012-11-05 21:30:07 -05:00
David Engeset
2d672d1c81
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.
2012-11-05 20:38:40 -05:00
Yaroslav Halchenko
f14c7ae401
ENH: refactored previous commit to make it more Pythonic (With prev commit closes gh-86, gh-81)
2012-11-05 20:37:06 -05:00
David Engeset
6288ec2757
Added in command option to unban and IP, just like using 'banip'. Command looks like: fail2ban-client set <jail name> unbanip <ip>
2012-11-05 20:11:28 -05:00
Yaroslav Halchenko
8e64c281dd
BF: in code we should use MyTime wrapper instead of time module directly
...
to allow for some tests to work correctly
2012-11-05 20:09:15 -05:00
Yaroslav Halchenko
09355663f7
BF: (python 2.4) -- access to staticmethod should go via Class
...
TODO: get away from using all those staticmethods in f2b
2012-11-05 16:54:19 -05:00
Yaroslav Halchenko
5becaf8ef2
BF: (python 2.[45]) store backends names in a list to use .index later on (Closes gh-83)
...
.index() got into tuple's API only in 2.6
2012-11-01 15:34:20 -04:00
Yaroslav Halchenko
83109bce14
BF: escape the content of <matches> since its value could contain arbitrary symbols
2012-10-08 22:14:51 -04:00
Yaroslav Halchenko
2d66f31ef5
ENH: instead of "Invalid command" warning log exception why command failed
2012-08-02 19:48:59 -04:00
Yaroslav Halchenko
c6f5d854d3
ENH+BF: filtergamin -- to be more inline with current design of filterinotify
2012-07-19 23:07:43 -04:00
Yaroslav Halchenko
d9248a6cf8
BF+RF: pyinotify refreshes watcher upon CREATE, unified/simplified *(add|del)LogPath among *Filters
...
* all of the *Filters had too much of common logic in their *LogPath
methods, which is now handled by FileFilter and derived classes only
add custom actions in corresponding _(add|del)LogPath methods
pyinotify:
* upon CREATE event:
- unknown files should not be handled at all
- "watcher" for the monitored files should be recreated.
Lead to adding _(add|del)FileWatcher helper methods
* callback now obtains full event to judge what to do
2012-07-19 17:26:09 -04:00
Yaroslav Halchenko
3c95121a8b
BF: pyinotify -- monitor the parent directory for IN_CREATE + process freshly added file (Closes gh-44)
2012-07-19 13:28:48 -04:00
Yaroslav Halchenko
baa09098f0
RF/BF: just use pyinotify.ThreadedNotifier thread in filterpyinotify
...
that seems also to overcome the problem of often locking upon stop()
2012-07-19 01:14:02 -04:00
Yaroslav Halchenko
25674a95f8
RF: filter.py -- single readline in a loop
2012-07-19 01:10:59 -04:00
Yaroslav Halchenko
b3614d4ea2
ENH: FilterPoll -- adjusted some msgs + allowed to operate without jail (for testing)
2012-07-19 01:08:34 -04:00
Yaroslav Halchenko
9b360bb12d
ENH: minor, just trailing spaces/tabs + reformated a string
2012-06-29 12:58:53 -04:00
Yaroslav Halchenko
3989d24967
BF: usedns=no was not working at all
...
it was not adding any detected address, IP or not to the list of failed attempts
This commit also adds appropriate unittest
2012-06-15 23:43:11 -04:00
Chris Reffett
a018a26133
Fixed addBannedIP to add enough failures to trigger a ban, rather than
...
just one failure.
2012-05-01 17:13:21 -04:00
Yaroslav Halchenko
2245ff5b41
ENH: rudimentary __repr__ for Filter and Jail + moved usedns into set method
...
otherwise usedns is way too noisy, especially within fail2ban-regex
2012-02-10 21:59:26 -05:00