diff --git a/MANIFEST b/MANIFEST index 4c60f8e4..eef145b6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -20,6 +20,7 @@ client/configurator.py client/csocket.py server/asyncserver.py server/filter.py +server/filterpyinotify.py server/filtergamin.py server/filterpoll.py server/iso8601.py diff --git a/README b/README index 4b5048ed..556e2fac 100644 --- a/README +++ b/README @@ -22,7 +22,12 @@ Required: >=python-2.3 (http://www.python.org) Optional: - >=gamin-0.0.21 (http://www.gnome.org/~veillard/gamin) + pyinotify: + >=linux-2.6.13 + >=python-2.4 + >=pyinotify-0.8.3 (https://github.com/seb-m/pyinotify) + Gamin: + >=gamin-0.0.21 (http://www.gnome.org/~veillard/gamin) To install, just do: diff --git a/TODO b/TODO index 2b17c916..fc43dc2c 100644 --- a/TODO +++ b/TODO @@ -19,10 +19,8 @@ Legend: - Add timeout to external commands (signal alarm, watchdog thread, etc) -- New backend: pyinotify - - Uniformize filters and actions name. Use the software name (openssh, postfix, - proftp) + proftp) and possible qualifier (e.g. auth) after a '-' - Added tag for failregex. Add features using this information. Maybe add more tags @@ -52,3 +50,5 @@ Legend: # better return values in function # refactoring in server.py, actions.py, filter.py + +* New backend: pyinotify diff --git a/client/__init__.py b/client/__init__.py index 65ba9868..c448827b 100644 --- a/client/__init__.py +++ b/client/__init__.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/actionreader.py b/client/actionreader.py index 29672bca..581a1b3c 100644 --- a/client/actionreader.py +++ b/client/actionreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/beautifier.py b/client/beautifier.py index 104a239e..a75655e7 100644 --- a/client/beautifier.py +++ b/client/beautifier.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/configparserinc.py b/client/configparserinc.py index 12ac97a8..7ac8b4a5 100644 --- a/client/configparserinc.py +++ b/client/configparserinc.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Yaroslav Halchenko # Modified: Cyril Jaquier diff --git a/client/configreader.py b/client/configreader.py index 18ae9b9a..063484e8 100644 --- a/client/configreader.py +++ b/client/configreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # Modified by: Yaroslav Halchenko (SafeConfigParserWithIncludes) diff --git a/client/configurator.py b/client/configurator.py index 526f218b..0baff2d8 100644 --- a/client/configurator.py +++ b/client/configurator.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/csocket.py b/client/csocket.py index 4bfb0510..6e014e23 100644 --- a/client/csocket.py +++ b/client/csocket.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/fail2banreader.py b/client/fail2banreader.py index f4f2728f..ee097bd6 100644 --- a/client/fail2banreader.py +++ b/client/fail2banreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/filterreader.py b/client/filterreader.py index b20c6f83..b7a72f9c 100644 --- a/client/filterreader.py +++ b/client/filterreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/client/jailreader.py b/client/jailreader.py index 52d5f82c..f66dc010 100644 --- a/client/jailreader.py +++ b/client/jailreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # @@ -65,6 +65,7 @@ class JailReader(ConfigReader): ["int", "maxretry", 3], ["int", "findtime", 600], ["int", "bantime", 600], + ["string", "usedns", "warn"], ["string", "failregex", None], ["string", "ignoreregex", None], ["string", "ignoreip", None], @@ -122,6 +123,8 @@ class JailReader(ConfigReader): stream.append(["set", self.__name, "findtime", self.__opts[opt]]) elif opt == "bantime": stream.append(["set", self.__name, "bantime", self.__opts[opt]]) + elif opt == "usedns": + stream.append(["set", self.__name, "usedns", self.__opts[opt]]) elif opt == "failregex": stream.append(["set", self.__name, "addfailregex", self.__opts[opt]]) elif opt == "ignoreregex": diff --git a/client/jailsreader.py b/client/jailsreader.py index 9e68dffe..bedc5a3c 100644 --- a/client/jailsreader.py +++ b/client/jailsreader.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/common/__init__.py b/common/__init__.py index 65ba9868..c448827b 100644 --- a/common/__init__.py +++ b/common/__init__.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # diff --git a/common/helpers.py b/common/helpers.py index 5afc3723..6115b971 100644 --- a/common/helpers.py +++ b/common/helpers.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # Author: Arturo 'Buanzo' Busleiman diff --git a/common/protocol.py b/common/protocol.py index 7f0ec9e1..db2b07eb 100644 --- a/common/protocol.py +++ b/common/protocol.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Cyril Jaquier # @@ -62,6 +62,7 @@ protocol = [ ["set delignoreregex ", "removes the regular expression at for ignoreregex"], ["set findtime