Compare commits

...
102 Commits
Author SHA1 Message Date
Yaroslav Halchenko 68e22af143 Imported Upstream version 0.8.3 2008-07-21 10:13:13 -04: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
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 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
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 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
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
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
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
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
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
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
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
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
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
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
101 changed files with 524 additions and 1656 deletions
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fail2ban-unstable</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
-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>
+29
View File
@@ -1,3 +1,7 @@
The following copyright applies to all files present in the Fail2ban package,
except if a different copyright is explicitly defined in this file.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
@@ -337,3 +341,28 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
---------------------------------
The file server/iso8601.py is licensed under the following terms.
Copyright (c) 2007 Michael Twomey
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+24 -1
View File
@@ -4,9 +4,32 @@
|_| \__,_|_|_/___|_.__/\__,_|_||_|
=============================================================
Fail2Ban (version 0.8.2) 2008/03/06
Fail2Ban (version 0.8.3) 2008/07/17
=============================================================
ver. 0.8.3 (2008/07/17) - stable
----------
- Process failtickets as long as failmanager is not empty.
- Added "pam-generic" filter and more configuration fixes.
Thanks to Yaroslav Halchenko.
- Fixed socket path in redhat and suse init script. Thanks to
Jim Wight.
- Fixed PID file while started in daemon mode. Thanks to
Christian Jobic who submitted a similar patch.
- Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
- Added gssftpd filter. Thanks to Kevin Zembower.
- Added "Day/Month/Year Hour:Minute:Second" date template.
Thanks to Dennis Winter.
- Fixed ignoreregex processing in fail2ban-client. Thanks to
René Berber.
- Added ISO 8601 date/time format.
- Added and changed some logging level and messages.
- Added missing ignoreregex to filters. Thanks to Klaus
Lehmann.
- Use poll instead of select in asyncore.loop. This should
solve the "Unknown error 514". Thanks to Michael Geiger and
Klaus Lehmann.
ver. 0.8.2 (2008/03/06) - stable
----------
- Fixed named filter. Thanks to Yaroslav Halchenko
-111
View File
@@ -1,111 +0,0 @@
README
ChangeLog
TODO
COPYING
fail2ban-client
fail2ban-server
fail2ban-testcases
fail2ban-regex
client/configreader.py
client/configparserinc.py
client/jailreader.py
client/fail2banreader.py
client/jailsreader.py
client/beautifier.py
client/filterreader.py
client/actionreader.py
client/__init__.py
client/configurator.py
client/csocket.py
server/asyncserver.py
server/filter.py
server/filtergamin.py
server/filterpoll.py
server/server.py
server/actions.py
server/faildata.py
server/failmanager.py
server/datedetector.py
server/jailthread.py
server/transmitter.py
server/action.py
server/ticket.py
server/jail.py
server/jails.py
server/__init__.py
server/banmanager.py
server/datetemplate.py
server/mytime.py
server/failregex.py
testcases/banmanagertestcase.py
testcases/failmanagertestcase.py
testcases/clientreadertestcase.py
testcases/filtertestcase.py
testcases/__init__.py
testcases/datedetectortestcase.py
testcases/actiontestcase.py
testcases/servertestcase.py
testcases/files/testcase01.log
testcases/files/testcase02.log
testcases/files/testcase03.log
testcases/files/testcase04.log
setup.py
setup.cfg
common/__init__.py
common/version.py
common/protocol.py
config/jail.conf
config/filter.d/common.conf
config/filter.d/apache-auth.conf
config/filter.d/apache-badbots.conf
config/filter.d/apache-noscript.conf
config/filter.d/apache-overflows.conf
config/filter.d/courierlogin.conf
config/filter.d/couriersmtp.conf
config/filter.d/exim.conf
config/filter.d/named-refused.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/sasl.conf
config/filter.d/sshd.conf
config/filter.d/sshd-ddos.conf
config/filter.d/vsftpd.conf
config/filter.d/webmin-auth.conf
config/filter.d/wuftpd.conf
config/filter.d/xinetd-fail.conf
config/action.d/hostsdeny.conf
config/action.d/ipfw.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/sendmail.conf
config/action.d/sendmail-buffered.conf
config/action.d/sendmail-whois.conf
config/action.d/sendmail-whois-lines.conf
config/action.d/shorewall.conf
config/fail2ban.conf
man/fail2ban-client.1
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/gentoo-confd
files/redhat-initd
files/macosx-initd
files/solaris-fail2ban.xml
files/solaris-svc-fail2ban
files/suse-initd
files/cacti/fail2ban_stats.sh
files/cacti/cacti_host_template_fail2ban.xml
files/cacti/README
+15
View File
@@ -0,0 +1,15 @@
Metadata-Version: 1.0
Name: fail2ban
Version: 0.8.3
Summary: Ban IPs that make too many password failure
Home-page: http://www.fail2ban.org
Author: Cyril Jaquier
Author-email: cyril.jaquier@fail2ban.org
License: GPL
Description:
Fail2Ban scans log files like /var/log/pwdfail or
/var/log/apache/error_log and bans IP that makes
too many password failures. It updates firewall rules
to reject the IP address or executes user defined
commands.
Platform: Posix
+3 -3
View File
@@ -4,7 +4,7 @@
|_| \__,_|_|_/___|_.__/\__,_|_||_|
=============================================================
Fail2Ban (version 0.8.2) 2008/03/06
Fail2Ban (version 0.8.3) 2008/07/17
=============================================================
Fail2Ban scans log files like /var/log/pwdfail and bans IP
@@ -28,8 +28,8 @@ Optional:
To install, just do:
> tar xvfj fail2ban-0.8.2.tar.bz2
> cd fail2ban-0.8.2
> tar xvfj fail2ban-0.8.3.tar.bz2
> cd fail2ban-0.8.3
> python setup.py install
This will install Fail2Ban into /usr/share/fail2ban. The
+1 -1
View File
@@ -4,7 +4,7 @@
|_| \__,_|_|_/___|_.__/\__,_|_||_|
=============================================================
ToDo $Revision$
ToDo $Revision: 653 $
=============================================================
Legend:
+3 -3
View File
@@ -16,10 +16,10 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 433 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 433 $"
__date__ = "$Date: 2006-10-24 21:40:51 +0200 (Tue, 24 Oct 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 433 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 433 $"
__date__ = "$Date: 2006-10-24 21:40:51 +0200 (Tue, 24 Oct 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 644 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 644 $"
__date__ = "$Date: 2008-01-15 00:12:21 +0100 (Tue, 15 Jan 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+1 -1
View File
@@ -16,7 +16,7 @@
# Author: Yaroslav Halchenko
# Modified: Cyril Jaquier
# $Revision$
# $Revision: 656 $
__author__ = 'Yaroslav Halhenko'
__revision__ = '$Revision: $'
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
# Modified by: Yaroslav Halchenko (SafeConfigParserWithIncludes)
# $Revision$
# $Revision: 656 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 656 $"
__date__ = "$Date: 2008-03-04 01:17:56 +0100 (Tue, 04 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 655 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 655 $"
__date__ = "$Date: 2008-03-04 01:13:39 +0100 (Tue, 04 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 635 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 635 $"
__date__ = "$Date: 2007-12-16 22:38:04 +0100 (Sun, 16 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 407 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 407 $"
__date__ = "$Date: 2006-10-09 20:05:13 +0200 (Mon, 09 Oct 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 505 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 505 $"
__date__ = "$Date: 2006-12-24 00:20:16 +0100 (Sun, 24 Dec 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+7 -4
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 690 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 690 $"
__date__ = "$Date: 2008-05-12 10:34:42 +0200 (Mon, 12 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -122,7 +122,10 @@ class JailReader(ConfigReader):
elif opt == "failregex":
stream.append(["set", self.__name, "failregex", self.__opts[opt]])
elif opt == "ignoreregex":
stream.append(["set", self.__name, "ignoreregex", self.__opts[opt]])
for regex in self.__opts[opt].split('\n'):
# Do not send a command if the rule is empty.
if regex != '':
stream.append(["set", self.__name, "addignoreregex", regex])
stream.extend(self.__filter.convert())
for action in self.__actions:
stream.extend(action.convert())
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 655 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 655 $"
__date__ = "$Date: 2008-03-04 01:13:39 +0100 (Tue, 04 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,10 +16,10 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 504 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 504 $"
__date__ = "$Date: 2006-12-23 17:37:17 +0100 (Sat, 23 Dec 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 662 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 662 $"
__date__ = "$Date: 2008-03-05 00:41:58 +0100 (Wed, 05 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+4 -4
View File
@@ -16,12 +16,12 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 703 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 703 $"
__date__ = "$Date: 2008-07-17 23:28:51 +0200 (Thu, 17 Jul 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
version = "0.8.2"
version = "0.8.3"
-52
View File
@@ -1,52 +0,0 @@
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision$
#
[Definition]
# Option: actionstart
# Notes.: command executed once at the start of Fail2Ban.
# Values: CMD
#
actionstart = touch /tmp/fail2ban.dummy
printf %%b "<init>\n" >> /tmp/fail2ban.dummy
# Option: actionstop
# Notes.: command executed once at the end of Fail2Ban
# Values: CMD
#
actionstop = rm -f /tmp/fail2ban.dummy
# 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 = printf %%b "+<ip>\n" >> /tmp/fail2ban.dummy
# 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
#
actionunban = printf %%b "-<ip>\n" >> /tmp/fail2ban.dummy
[Init]
init = 123
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -3,7 +3,7 @@
# Author: Nick Munger
# Modified by: Cyril Jaquier
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -4,7 +4,7 @@
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -7,7 +7,7 @@
# make "fail2ban-<name>-log" chain to log and drop
# insert a jump to fail2ban-<name> from -I INPUT if proto/port match
#
# $Revision$
# $Revision: 668 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
# Modified by Yaroslav Halchenko for multiport banning
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -4,7 +4,7 @@
# Copied from iptables.conf and modified by Yaroslav Halchenko
# to fullfill the needs of bugreporter dbts#350746.
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+2 -2
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 701 $
#
[Definition]
@@ -50,7 +50,7 @@ actioncheck =
#
actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
LINE=$( wc -l <tmpfile> | awk '{ print $1 }' )
if [ $LINE -eq <lines> ]; then
if [ $LINE -ge <lines> ]; then
printf %%b "Hi,\n
These hosts have been banned by Fail2Ban.\n
`cat <tmpfile>`
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
# Modified-By: Yaroslav Halchenko to include grepping on IP over log files
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+2 -2
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 701 $
#
[Definition]
@@ -59,7 +59,7 @@ actioncheck =
#
actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
LINE=$( wc -l <tmpfile> | awk '{ print $1 }' )
if [ $LINE -eq <lines> ]; then
if [ $LINE -ge <lines> ]; then
printf %%b "Subject: [Fail2Ban] <name>: summary
From: Fail2Ban <<sender>>
To: <dest>\n
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 660 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 661 $
#
# The default Shorewall configuration is with "BLACKLISTNEWONLY=Yes" (see
# file /etc/shorewall/shorewall.conf). This means that when Fail2ban adds a
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 629 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 569 $
#
[Definition]
+1 -1
View File
@@ -5,7 +5,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 668 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Tim Connors
#
# $Revision$
# $Revision: 668 $
#
[Definition]
+1 -1
View File
@@ -3,7 +3,7 @@
# Author: Christoph Haas
# Modified by: Cyril Jaquier
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+20
View File
@@ -0,0 +1,20 @@
# Fail2Ban configuration file for wuftpd
#
# Author: Kevin Zembower (copied from wsftpd.conf)
#
# $Revision: 699 $
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
# Values: TEXT
#
failregex = ftpd(?:\[\d+\])?:\s+repeated login failures from <HOST> \(\S+\)$
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
+6 -2
View File
@@ -4,7 +4,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 699 $
#
[Definition]
@@ -28,4 +28,8 @@ __line_prefix=(?:\s\S+ %(__daemon_combs_re)s\s+)?
#
failregex = %(__line_prefix)sclient <HOST>#\S+: query(?: \(cache\))? '.*' denied\s*$
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
+31
View File
@@ -0,0 +1,31 @@
# Fail2Ban configuration file for generic PAM authentication errors
#
# Author: Yaroslav Halchenko
#
# $Revision: $
#
[Definition]
# if you want to catch only login erros from specific daemons, use smth like
#_ttys_re=(?:ssh|pure-ftpd|ftp)
# To catch all failed logins
_ttys_re=\S*
#
# Shortcuts for easier comprehension of the failregex
__pid_re=(?:\[\d+\])
__pam_re=\(?pam_unix(?:\(\S+\))?\)?:?
__pam_combs_re=(?:%(__pid_re)s?:\s+%(__pam_re)s|%(__pam_re)s%(__pid_re)s?:)
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
# Values: TEXT
#
failregex = \s\S+ \S+%(__pam_combs_re)s\s+authentication failure; logname=\S* uid=\S* euid=\S* tty=%(_ttys_re)s ruser=\S* rhost=<HOST>(?:\s+user=.*)?\s*$
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+2 -2
View File
@@ -2,7 +2,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 677 $
#
[Definition]
@@ -14,7 +14,7 @@
# (?:::f{4,6}:)?(?P<host>\S+)
# Values: TEXT
#
failregex = \(\S+\[<HOST>\]\)[: -]+ USER \S+: no such user found from \S+ \[[0-9.]+\] to \S+:\S+$
failregex = \(\S+\[<HOST>\]\)[: -]+ USER \S+: no such user found from \S+ \[\S+\] to \S+:\S+$
\(\S+\[<HOST>\]\)[: -]+ USER \S+ \(Login failed\): Incorrect password\.$
\(\S+\[<HOST>\]\)[: -]+ SECURITY VIOLATION: \S+ login attempted\.$
\(\S+\[<HOST>\]\)[: -]+ Maximum login attempts \(\d+\) exceeded$
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 510 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 592 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 663 $
#
[INCLUDES]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 658 $
#
[Definition]
+1 -1
View File
@@ -3,7 +3,7 @@
# Author: Cyril Jaquier
# Rule by : Delvit Guillaume
#
# $Revision$
# $Revision: 601 $
#
[Definition]
+7 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Yaroslav Halchenko
#
# $Revision$
# $Revision: 699 $
#
[Definition]
@@ -12,3 +12,9 @@
# Values: TEXT
#
failregex = wu-ftpd(?:\[\d+\])?:\s+\(pam_unix\)\s+authentication failure.* rhost=<HOST>$
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Guido Bozzetto
#
# $Revision$
# $Revision: 668 $
#
[Definition]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 617 $
#
# The DEFAULT allows a global definition of the options. They can be override
-1237
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -17,11 +17,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 672 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 672 $"
__date__ = "$Date: 2008-03-06 00:18:06 +0100 (Thu, 06 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -17,11 +17,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 672 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 672 $"
__date__ = "$Date: 2008-03-06 00:18:06 +0100 (Thu, 06 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -17,11 +17,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 672 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 672 $"
__date__ = "$Date: 2008-03-06 00:18:06 +0100 (Thu, 06 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -17,11 +17,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 522 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 522 $"
__date__ = "$Date: 2007-01-21 23:19:57 +0100 (Sun, 21 Jan 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+1 -1
View File
@@ -25,7 +25,7 @@
#
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 527 $
FAIL2BAN="fail2ban-client"
+1 -1
View File
@@ -17,7 +17,7 @@
#
# Author: Sireyessire, Cyril Jaquier
#
# $Revision$
# $Revision: 559 $
opts="start stop restart reload showlog"
+1 -1
View File
@@ -27,7 +27,7 @@ start() {
echo -n $"Starting fail2ban: "
getpid
if [ -z "$pid" ]; then
rm -rf /tmp/fail2ban.sock # in case of unclean shutdown
rm -rf /var/run/fail2ban/fail2ban.sock # in case of unclean shutdown
$FAIL2BAN start > /dev/null
RETVAL=$?
fi
+1 -1
View File
@@ -16,7 +16,7 @@
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/sbin:/usr/bin:/bin
FAIL2BAN_BIN=/usr/local/bin/fail2ban-client
FAIL2BAN_SERVER=/usr/local/bin/fail2ban-server
FAIL2BAN_SOCKET=/tmp/fail2ban.sock
FAIL2BAN_SOCKET=/var/run/fail2ban/fail2ban.sock
test -x $FAIL2BAN_BIN || { echo "$FAIL2BAN_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
-2
View File
@@ -1,2 +0,0 @@
#!/bin/bash
kill `ps ax|grep fail2ban|grep -v grep|awk '{print $1}'`
+3 -3
View File
@@ -16,10 +16,10 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 433 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 433 $"
__date__ = "$Date: 2006-10-24 21:40:51 +0200 (Tue, 24 Oct 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+8 -8
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 682 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 682 $"
__date__ = "$Date: 2008-04-08 00:25:16 +0200 (Tue, 08 Apr 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -106,7 +106,7 @@ class Action:
def setActionStart(self, value):
self.__actionStart = value
logSys.info("Set actionStart = %s" % value)
logSys.debug("Set actionStart = %s" % value)
##
# Get the "start" command.
@@ -135,7 +135,7 @@ class Action:
def setActionBan(self, value):
self.__actionBan = value
logSys.info("Set actionBan = %s" % value)
logSys.debug("Set actionBan = %s" % value)
##
# Get the "ban" command.
@@ -160,7 +160,7 @@ class Action:
def setActionUnban(self, value):
self.__actionUnban = value
logSys.info("Set actionUnban = %s" % value)
logSys.debug("Set actionUnban = %s" % value)
##
# Get the "unban" command.
@@ -185,7 +185,7 @@ class Action:
def setActionCheck(self, value):
self.__actionCheck = value
logSys.info("Set actionCheck = %s" % value)
logSys.debug("Set actionCheck = %s" % value)
##
# Get the "check" command.
@@ -202,7 +202,7 @@ class Action:
def setActionStop(self, value):
self.__actionStop = value
logSys.info("Set actionStop = %s" % value)
logSys.debug("Set actionStop = %s" % value)
##
# Get the "stop" command.
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 567 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 567 $"
__date__ = "$Date: 2007-03-26 23:17:31 +0200 (Mon, 26 Mar 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+1 -1
View File
@@ -132,7 +132,7 @@ class AsyncServer(asyncore.dispatcher):
# Sets the init flag.
self.__init = True
# TODO Add try..catch
asyncore.loop()
asyncore.loop(use_poll = True)
##
# Stops the communication server.
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 638 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 638 $"
__date__ = "$Date: 2007-12-17 21:00:36 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+14 -6
View File
@@ -16,19 +16,17 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 692 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 692 $"
__date__ = "$Date: 2008-05-18 21:53:18 +0200 (Sun, 18 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
import time, logging
from datetemplate import DateStrptime
from datetemplate import DateTai64n
from datetemplate import DateEpoch
from datetemplate import DateStrptime, DateTai64n, DateEpoch, DateISO8601
from threading import Lock
# Gets the instance of the logger.
@@ -67,6 +65,12 @@ class DateDetector:
template.setRegex("\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}")
template.setPattern("%Y/%m/%d %H:%M:%S")
self.__templates.append(template)
# simple date too (from x11vnc)
template = DateStrptime()
template.setName("Day/Month/Year Hour:Minute:Second")
template.setRegex("\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2}")
template.setPattern("%d/%m/%Y %H:%M:%S")
self.__templates.append(template)
# Apache format [31/Oct/2006:09:22:55 -0000]
template = DateStrptime()
template.setName("Day/Month/Year:Hour:Minute:Second")
@@ -93,6 +97,10 @@ class DateDetector:
template = DateEpoch()
template.setName("Epoch")
self.__templates.append(template)
# ISO 8601
template = DateISO8601()
template.setName("ISO 8601")
self.__templates.append(template)
finally:
self.__lock.release()
+25 -4
View File
@@ -17,17 +17,18 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 692 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 692 $"
__date__ = "$Date: 2008-05-18 21:53:18 +0200 (Sun, 18 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
import re, time
from mytime import MyTime
import iso8601
class DateTemplate:
@@ -163,4 +164,24 @@ class DateTai64n(DateTemplate):
value = dateMatch.group()
seconds_since_epoch = value[2:17]
date = list(time.gmtime(int(seconds_since_epoch, 16)))
return date
return date
class DateISO8601(DateTemplate):
def __init__(self):
DateTemplate.__init__(self)
date_re = "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}" \
".[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?" \
"(Z|(([-+])([0-9]{2}):([0-9]{2})))?"
self.setRegex(date_re)
def getDate(self, line):
date = None
dateMatch = self.matchDate(line)
if dateMatch:
# Parses the date.
value = dateMatch.group()
print value
date = list(iso8601.parse_date(value).utctimetuple())
return date
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 382 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 382 $"
__date__ = "$Date: 2006-09-25 19:03:48 +0200 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 638 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 638 $"
__date__ = "$Date: 2007-12-17 21:00:36 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 642 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 642 $"
__date__ = "$Date: 2008-01-05 23:33:44 +0100 (Sat, 05 Jan 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+4 -4
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 696 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 696 $"
__date__ = "$Date: 2008-05-19 23:05:32 +0200 (Mon, 19 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -68,7 +68,7 @@ class Filter(JailThread):
self.dateDetector = DateDetector()
self.dateDetector.addDefaultTemplate()
logSys.info("Created Filter")
logSys.debug("Created Filter")
##
+7 -6
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 696 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 696 $"
__date__ = "$Date: 2008-05-19 23:05:32 +0200 (Mon, 19 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -53,7 +53,7 @@ class FilterGamin(FileFilter):
self.__modified = False
# Gamin monitor
self.monitor = gamin.WatchMonitor()
logSys.info("Created FilterGamin")
logSys.debug("Created FilterGamin")
def callback(self, path, event):
@@ -108,8 +108,9 @@ class FilterGamin(FileFilter):
if self.__modified:
try:
ticket = self.failManager.toBan()
self.jail.putFailTicket(ticket)
while True:
ticket = self.failManager.toBan()
self.jail.putFailTicket(ticket)
except FailManagerEmpty:
self.failManager.cleanup(MyTime.time())
self.dateDetector.sortTemplate()
+7 -6
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 696 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 696 $"
__date__ = "$Date: 2008-05-19 23:05:32 +0200 (Mon, 19 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -54,7 +54,7 @@ class FilterPoll(FileFilter):
## The time of the last modification of the file.
self.__lastModTime = dict()
self.__file404Cnt = dict()
logSys.info("Created FilterPoll")
logSys.debug("Created FilterPoll")
##
# Add a log file path
@@ -103,8 +103,9 @@ class FilterPoll(FileFilter):
if self.__modified:
try:
ticket = self.failManager.toBan()
self.jail.putFailTicket(ticket)
while True:
ticket = self.failManager.toBan()
self.jail.putFailTicket(ticket)
except FailManagerEmpty:
self.failManager.cleanup(MyTime.time())
self.dateDetector.sortTemplate()
+123
View File
@@ -0,0 +1,123 @@
# Copyright (c) 2007 Michael Twomey
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""ISO 8601 date time string parsing
Basic usage:
>>> import iso8601
>>> iso8601.parse_date("2007-01-25T12:00:00Z")
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>)
>>>
"""
from datetime import datetime, timedelta, tzinfo
import re
__all__ = ["parse_date", "ParseError"]
# Adapted from http://delete.me.uk/2005/03/iso8601.html
ISO8601_REGEX = re.compile(r"(?P<year>[0-9]{4})(-(?P<month>[0-9]{1,2})(-(?P<day>[0-9]{1,2})"
r"((?P<separator>.)(?P<hour>[0-9]{2}):(?P<minute>[0-9]{2})(:(?P<second>[0-9]{2})(\.(?P<fraction>[0-9]+))?)?"
r"(?P<timezone>Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?"
)
TIMEZONE_REGEX = re.compile("(?P<prefix>[+-])(?P<hours>[0-9]{2}).(?P<minutes>[0-9]{2})")
class ParseError(Exception):
"""Raised when there is a problem parsing a date string"""
# Yoinked from python docs
ZERO = timedelta(0)
class Utc(tzinfo):
"""UTC
"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return ZERO
UTC = Utc()
class FixedOffset(tzinfo):
"""Fixed offset in hours and minutes from UTC
"""
def __init__(self, offset_hours, offset_minutes, name):
self.__offset = timedelta(hours=offset_hours, minutes=offset_minutes)
self.__name = name
def utcoffset(self, dt):
return self.__offset
def tzname(self, dt):
return self.__name
def dst(self, dt):
return ZERO
def __repr__(self):
return "<FixedOffset %r>" % self.__name
def parse_timezone(tzstring, default_timezone=UTC):
"""Parses ISO 8601 time zone specs into tzinfo offsets
"""
if tzstring == "Z":
return default_timezone
# This isn't strictly correct, but it's common to encounter dates without
# timezones so I'll assume the default (which defaults to UTC).
# Addresses issue 4.
if tzstring is None:
return default_timezone
m = TIMEZONE_REGEX.match(tzstring)
prefix, hours, minutes = m.groups()
hours, minutes = int(hours), int(minutes)
if prefix == "-":
hours = -hours
minutes = -minutes
return FixedOffset(hours, minutes, tzstring)
def parse_date(datestring, default_timezone=UTC):
"""Parses ISO 8601 dates into datetime objects
The timezone is parsed from the date string. However it is quite common to
have dates without a timezone (not strictly correct). In this case the
default timezone specified in default_timezone is used. This is UTC by
default.
"""
if not isinstance(datestring, basestring):
raise ParseError("Expecting a string %r" % datestring)
m = ISO8601_REGEX.match(datestring)
if not m:
raise ParseError("Unable to parse date string %r" % datestring)
groups = m.groupdict()
tz = parse_timezone(groups["timezone"], default_timezone=default_timezone)
if groups["fraction"] is None:
groups["fraction"] = 0
else:
groups["fraction"] = int(float("0.%s" % groups["fraction"]) * 1e6)
return datetime(int(groups["year"]), int(groups["month"]), int(groups["day"]),
int(groups["hour"]), int(groups["minute"]), int(groups["second"]),
int(groups["fraction"]), tz)
+8 -5
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 696 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 696 $"
__date__ = "$Date: 2008-05-19 23:05:32 +0200 (Mon, 19 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -37,6 +37,7 @@ class Jail:
self.__name = name
self.__queue = Queue.Queue()
self.__filter = None
logSys.info("Creating new jail '%s'" % self.__name)
if backend == "polling":
self.__initPoller()
else:
@@ -47,14 +48,14 @@ class Jail:
self.__action = Actions(self)
def __initPoller(self):
logSys.info("Using poller")
logSys.info("Jail '%s' uses poller" % self.__name)
from filterpoll import FilterPoll
self.__filter = FilterPoll(self)
def __initGamin(self):
# Try to import gamin
import gamin
logSys.info("Using Gamin")
logSys.info("Jail '%s' uses Gamin" % self.__name)
from filtergamin import FilterGamin
self.__filter = FilterGamin(self)
@@ -82,12 +83,14 @@ class Jail:
def start(self):
self.__filter.start()
self.__action.start()
logSys.info("Jail '%s' started" % self.__name)
def stop(self):
self.__filter.stop()
self.__action.stop()
self.__filter.join()
self.__action.join()
logSys.info("Jail '%s' stopped" % self.__name)
def isAlive(self):
isAlive0 = self.__filter.isAlive()
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 504 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 504 $"
__date__ = "$Date: 2006-12-23 17:37:17 +0100 (Sat, 23 Dec 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 567 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 567 $"
__date__ = "$Date: 2007-03-26 23:17:31 +0200 (Mon, 26 Mar 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 635 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 635 $"
__date__ = "$Date: 2007-12-16 22:38:04 +0100 (Sun, 16 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+30 -22
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 696 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 696 $"
__date__ = "$Date: 2008-05-19 23:05:32 +0200 (Mon, 19 May 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -46,11 +46,11 @@ class Server:
self.__daemon = daemon
self.__transm = Transmitter(self)
self.__asyncServer = AsyncServer(self.__transm)
self.__logLevel = 3
self.__logTarget = "STDOUT"
self.__logLevel = None
self.__logTarget = None
# Set logging level
self.setLogLevel(self.__logLevel)
self.setLogTarget(self.__logTarget)
self.setLogLevel(3)
self.setLogTarget("STDOUT")
def __sigTERMhandler(self, signum, frame):
logSys.debug("Caught signal %d. Exiting" % signum)
@@ -59,6 +59,21 @@ class Server:
def start(self, sock, force = False):
logSys.info("Starting Fail2ban v" + version.version)
# Install signal handlers
signal.signal(signal.SIGTERM, self.__sigTERMhandler)
signal.signal(signal.SIGINT, self.__sigTERMhandler)
# First set the mask to only allow access to owner
os.umask(0077)
if self.__daemon:
logSys.info("Starting in daemon mode")
ret = self.__createDaemon()
if ret:
logSys.info("Daemon started")
else:
logSys.error("Could not create daemon")
raise ServerInitializationError("Could not create daemon")
# Creates a PID file.
try:
logSys.debug("Creating PID file %s" % Server.PID_FILE)
@@ -68,19 +83,6 @@ class Server:
except IOError, e:
logSys.error("Unable to create PID file: %s" % e)
# Install signal handlers
signal.signal(signal.SIGTERM, self.__sigTERMhandler)
signal.signal(signal.SIGINT, self.__sigTERMhandler)
# First set the mask to only allow access to owner
os.umask(0077)
if self.__daemon:
ret = self.__createDaemon()
if ret:
logSys.info("Daemon started")
else:
logSys.error("Could not create daemon")
raise ServerInitializationError("Could not create daemon")
# Start the communication
logSys.debug("Starting communication")
try:
@@ -164,7 +166,8 @@ class Server:
self.__jails.getFilter(name).delLogPath(fileName)
def getLogPath(self, name):
return self.__jails.getFilter(name).getLogPath()
return [m.getFileName()
for m in self.__jails.getFilter(name).getLogPath()]
def setFindTime(self, name, value):
self.__jails.getFilter(name).setFindTime(value)
@@ -343,7 +346,6 @@ class Server:
logSys.error("Unable to log to " + target)
logSys.info("Logging to previous target " + self.__logTarget)
return False
self.__logTarget = target
# Removes previous handlers
for handler in logging.getLogger("fail2ban").handlers:
# Closes the handler.
@@ -352,6 +354,12 @@ class Server:
# tell the handler to use this format
hdlr.setFormatter(formatter)
logging.getLogger("fail2ban").addHandler(hdlr)
# Does not display this message at startup.
if not self.__logTarget == None:
logSys.info("Changed logging target to %s for Fail2ban v%s" %
(target, version.version))
# Sets the logging target.
self.__logTarget = target
return True
finally:
self.__loggingLock.release()
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 638 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 638 $"
__date__ = "$Date: 2007-12-17 21:00:36 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 639 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 639 $"
__date__ = "$Date: 2007-12-17 21:04:29 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+6 -3
View File
@@ -18,11 +18,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 678 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 678 $"
__date__ = "$Date: 2008-03-10 23:34:46 +0100 (Mon, 10 Mar 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
@@ -68,6 +68,9 @@ setup(
),
('/etc/fail2ban/action.d',
glob("config/action.d/*.conf")
),
('/var/run/fail2ban',
''
)
]
)
+3 -3
View File
@@ -16,10 +16,10 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 253 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 253 $"
__date__ = "$Date: 2006-07-17 00:21:58 +0200 (Mon, 17 Jul 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 504 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 504 $"
__date__ = "$Date: 2006-12-23 17:37:17 +0100 (Sat, 23 Dec 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 638 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 638 $"
__date__ = "$Date: 2007-12-17 21:00:36 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 504 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 504 $"
__date__ = "$Date: 2006-12-23 17:37:17 +0100 (Sat, 23 Dec 2006) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 650 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 650 $"
__date__ = "$Date: 2008-02-02 21:07:06 +0100 (Sat, 02 Feb 2008) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 638 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 638 $"
__date__ = "$Date: 2007-12-17 21:00:36 +0100 (Mon, 17 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
+3 -3
View File
@@ -16,11 +16,11 @@
# Author: Cyril Jaquier
#
# $Revision$
# $Revision: 641 $
__author__ = "Cyril Jaquier"
__version__ = "$Revision$"
__date__ = "$Date$"
__version__ = "$Revision: 641 $"
__date__ = "$Date: 2007-12-26 12:46:22 +0100 (Wed, 26 Dec 2007) $"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"

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