fail2ban.server.filter module
*****************************

class fail2ban.server.filter.FileContainer(filename, encoding, tail=False)

   Bases: "object"

   -[ Methods ]-

   +-----------------+------------+
   | **close**       |            |
   +-----------------+------------+
   | **decode_line** |            |
   +-----------------+------------+
   | **getEncoding** |            |
   +-----------------+------------+
   | **getFileName** |            |
   +-----------------+------------+
   | **getFileSize** |            |
   +-----------------+------------+
   | **getHash**     |            |
   +-----------------+------------+
   | **getPos**      |            |
   +-----------------+------------+
   | **open**        |            |
   +-----------------+------------+
   | **readline**    |            |
   +-----------------+------------+
   | **seek**        |            |
   +-----------------+------------+
   | **setEncoding** |            |
   +-----------------+------------+
   | **setPos**      |            |
   +-----------------+------------+
   | **tell**        |            |
   +-----------------+------------+

   close(self)

   static decode_line(filename, enc, line)

   getEncoding(self)

   getFileName(self)

   getFileSize(self)

   getHash(self)

   getPos(self)

   open(self)

   readline(self)

   seek(self, offs, endLine=True)

   setEncoding(self, encoding)

   setPos(self, value)

   tell(self)

class fail2ban.server.filter.FileFilter(jail, **kwargs)

   Bases: "fail2ban.server.filter.Filter"

   Attributes:
      "daemon"
         A boolean value indicating whether this thread is a daemon
         thread.

      "ident"
         Thread identifier of this thread or None if it has not been
         started.

      **ignoreCache**
      **ignoreCommand**
      **ignoreSelf**
      **jailName**
      **mlfidCache**
      "name"
         A string used for identification purposes only.

      "native_id"
         Native integral thread ID of this thread, or None if it has
         not been started.

      **prefRegex**
   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "addAttem  | Generate a failed attempt for ip                                                           |
   | pt"(self,  |                                                                                            |
   | ip,        |                                                                                            |
   | \*matches) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "clearAll  | Clear all lists/dicts parameters (used by reloading)                                       |
   | Params"(s  |                                                                                            |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "isAlive"  | Return whether the thread is alive.                                                        |
   | (self)     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "is_alive  | Return whether the thread is alive.                                                        |
   | "(self)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "join"(se  | Safer join, that could be called also for not started (or ended) threads (used for         |
   | lf)        | cleanup).                                                                                  |
   +------------+--------------------------------------------------------------------------------------------+
   | "performB  | Performs a ban for IPs (or given ip) that are reached maxretry of the jail.                |
   | an"(self[, |                                                                                            |
   | ip])       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Split the time portion from log msg and return findFailures on them                        |
   | ine"(self, |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Processes the line for failures and populates failManager                                  |
   | ineAndAdd  |                                                                                            |
   | "(self,    |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "reload"(  | Begin or end of reloading resp.                                                            |
   | self[,     |                                                                                            |
   | begin])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "run"(sel  | Abstract - Called when thread starts, thread stops when returns.                           |
   | f)         |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "start"(s  | Sets active flag and starts thread.                                                        |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "status"(  | Status of Filter plus files being monitored.                                               |
   | self[,     |                                                                                            |
   | flavor])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "stop"(se  | Stop monitoring of log-file(s)                                                             |
   | lf)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+

   +---------------------+------------+
   | **addFailRegex**    |            |
   +---------------------+------------+
   | **addIgnoreIP**     |            |
   +---------------------+------------+
   | **addIgnoreRegex**  |            |
   +---------------------+------------+
   | **addLogPath**      |            |
   +---------------------+------------+
   | **commonError**     |            |
   +---------------------+------------+
   | **containsLogPath** |            |
   +---------------------+------------+
   | **delFailRegex**    |            |
   +---------------------+------------+
   | **delIgnoreIP**     |            |
   +---------------------+------------+
   | **delIgnoreRegex**  |            |
   +---------------------+------------+
   | **delLogPath**      |            |
   +---------------------+------------+
   | **findFailure**     |            |
   +---------------------+------------+
   | **getDatePattern**  |            |
   +---------------------+------------+
   | **getFailRegex**    |            |
   +---------------------+------------+
   | **getFailures**     |            |
   +---------------------+------------+
   | **getFindTime**     |            |
   +---------------------+------------+
   | **getIgnoreIP**     |            |
   +---------------------+------------+
   | **getIgnoreRegex**  |            |
   +---------------------+------------+
   | **getLog**          |            |
   +---------------------+------------+
   | **getLogCount**     |            |
   +---------------------+------------+
   | **getLogEncoding**  |            |
   +---------------------+------------+
   | **getLogPaths**     |            |
   +---------------------+------------+
   | **getLogTimeZone**  |            |
   +---------------------+------------+
   | **getLogs**         |            |
   +---------------------+------------+
   | **getMaxLines**     |            |
   +---------------------+------------+
   | **getMaxRetry**     |            |
   +---------------------+------------+
   | **getName**         |            |
   +---------------------+------------+
   | **getUseDns**       |            |
   +---------------------+------------+
   | **inIgnoreIPList**  |            |
   +---------------------+------------+
   | **isDaemon**        |            |
   +---------------------+------------+
   | **logIgnoreIp**     |            |
   +---------------------+------------+
   | **seekToTime**      |            |
   +---------------------+------------+
   | **setDaemon**       |            |
   +---------------------+------------+
   | **setDatePattern**  |            |
   +---------------------+------------+
   | **setFindTime**     |            |
   +---------------------+------------+
   | **setLogEncoding**  |            |
   +---------------------+------------+
   | **setLogTimeZone**  |            |
   +---------------------+------------+
   | **setMaxLines**     |            |
   +---------------------+------------+
   | **setMaxRetry**     |            |
   +---------------------+------------+
   | **setName**         |            |
   +---------------------+------------+
   | **setUseDns**       |            |
   +---------------------+------------+

   addLogPath(self, path, tail=False, autoSeek=True)

   containsLogPath(self, path)

   delLogPath(self, path)

   getFailures(self, filename, inOperation=None)

   getLog(self, path)

   getLogCount(self)

   getLogPaths(self)

   getLogs(self)

   seekToTime(self, container, date, accuracy=3)

   setLogEncoding(self, encoding)

   status(self, flavor='basic')

      Status of Filter plus files being monitored.

   stop(self)

      Stop monitoring of log-file(s)

class fail2ban.server.filter.Filter(jail, useDns='warn')

   Bases: "fail2ban.server.jailthread.JailThread"

   Attributes:
      "daemon"
         A boolean value indicating whether this thread is a daemon
         thread.

      "ident"
         Thread identifier of this thread or None if it has not been
         started.

      **ignoreCache**
      **ignoreCommand**
      **ignoreSelf**
      **jailName**
      **mlfidCache**
      "name"
         A string used for identification purposes only.

      "native_id"
         Native integral thread ID of this thread, or None if it has
         not been started.

      **prefRegex**
   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "addAttem  | Generate a failed attempt for ip                                                           |
   | pt"(self,  |                                                                                            |
   | ip,        |                                                                                            |
   | \*matches) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "clearAll  | Clear all lists/dicts parameters (used by reloading)                                       |
   | Params"(s  |                                                                                            |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "isAlive"  | Return whether the thread is alive.                                                        |
   | (self)     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "is_alive  | Return whether the thread is alive.                                                        |
   | "(self)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "join"(se  | Safer join, that could be called also for not started (or ended) threads (used for         |
   | lf)        | cleanup).                                                                                  |
   +------------+--------------------------------------------------------------------------------------------+
   | "performB  | Performs a ban for IPs (or given ip) that are reached maxretry of the jail.                |
   | an"(self[, |                                                                                            |
   | ip])       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Split the time portion from log msg and return findFailures on them                        |
   | ine"(self, |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Processes the line for failures and populates failManager                                  |
   | ineAndAdd  |                                                                                            |
   | "(self,    |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "reload"(  | Begin or end of reloading resp.                                                            |
   | self[,     |                                                                                            |
   | begin])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "run"(sel  | Abstract - Called when thread starts, thread stops when returns.                           |
   | f)         |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "start"(s  | Sets active flag and starts thread.                                                        |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "status"(  | Status of failures detected by filter.                                                     |
   | self[,     |                                                                                            |
   | flavor])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "stop"(se  | Sets *active* property to False, to flag run method to return.                             |
   | lf)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+

   +--------------------+------------+
   | **addFailRegex**   |            |
   +--------------------+------------+
   | **addIgnoreIP**    |            |
   +--------------------+------------+
   | **addIgnoreRegex** |            |
   +--------------------+------------+
   | **commonError**    |            |
   +--------------------+------------+
   | **delFailRegex**   |            |
   +--------------------+------------+
   | **delIgnoreIP**    |            |
   +--------------------+------------+
   | **delIgnoreRegex** |            |
   +--------------------+------------+
   | **findFailure**    |            |
   +--------------------+------------+
   | **getDatePattern** |            |
   +--------------------+------------+
   | **getFailRegex**   |            |
   +--------------------+------------+
   | **getFindTime**    |            |
   +--------------------+------------+
   | **getIgnoreIP**    |            |
   +--------------------+------------+
   | **getIgnoreRegex** |            |
   +--------------------+------------+
   | **getLogEncoding** |            |
   +--------------------+------------+
   | **getLogTimeZone** |            |
   +--------------------+------------+
   | **getMaxLines**    |            |
   +--------------------+------------+
   | **getMaxRetry**    |            |
   +--------------------+------------+
   | **getName**        |            |
   +--------------------+------------+
   | **getUseDns**      |            |
   +--------------------+------------+
   | **inIgnoreIPList** |            |
   +--------------------+------------+
   | **isDaemon**       |            |
   +--------------------+------------+
   | **logIgnoreIp**    |            |
   +--------------------+------------+
   | **setDaemon**      |            |
   +--------------------+------------+
   | **setDatePattern** |            |
   +--------------------+------------+
   | **setFindTime**    |            |
   +--------------------+------------+
   | **setLogEncoding** |            |
   +--------------------+------------+
   | **setLogTimeZone** |            |
   +--------------------+------------+
   | **setMaxLines**    |            |
   +--------------------+------------+
   | **setMaxRetry**    |            |
   +--------------------+------------+
   | **setName**        |            |
   +--------------------+------------+
   | **setUseDns**      |            |
   +--------------------+------------+

   addAttempt(self, ip, \*matches)

      Generate a failed attempt for ip

   addFailRegex(self, value)

   addIgnoreIP(self, ipstr)

   addIgnoreRegex(self, value)

   clearAllParams(self)

      Clear all lists/dicts parameters (used by reloading)

   commonError(self)

   delFailRegex(self, index=None)

   delIgnoreIP(self, ip=None)

   delIgnoreRegex(self, index=None)

   findFailure(self, tupleLine, date, noDate=False)

   getDatePattern(self)

   getFailRegex(self)

   getFindTime(self)

   getIgnoreIP(self)

   getIgnoreRegex(self)

   getLogEncoding(self)

   getLogTimeZone(self)

   getMaxLines(self)

   getMaxRetry(self)

   getUseDns(self)

   property ignoreCache

   property ignoreCommand

   property ignoreSelf

   inIgnoreIPList(self, ip, log_ignore=True)

   property jailName

   logIgnoreIp(self, ip, log_ignore, ignore_source='unknown source')

   property mlfidCache

   performBan(self, ip=None)

      Performs a ban for IPs (or given ip) that are reached maxretry
      of the jail.

   property prefRegex

   processLine(self, line, date=None)

      Split the time portion from log msg and return findFailures on
      them

   processLineAndAdd(self, line, date=None)

      Processes the line for failures and populates failManager

   reload(self, begin=True)

      Begin or end of reloading resp. refreshing of all parameters

   run(self)

      Abstract - Called when thread starts, thread stops when returns.

   setDatePattern(self, pattern)

   setFindTime(self, value)

   setLogEncoding(self, encoding)

   setLogTimeZone(self, tz)

   setMaxLines(self, value)

   setMaxRetry(self, value)

   setUseDns(self, value)

   status(self, flavor='basic')

      Status of failures detected by filter.

class fail2ban.server.filter.JournalFilter(jail, useDns='warn')

   Bases: "fail2ban.server.filter.Filter"

   Attributes:
      "daemon"
         A boolean value indicating whether this thread is a daemon
         thread.

      "ident"
         Thread identifier of this thread or None if it has not been
         started.

      **ignoreCache**
      **ignoreCommand**
      **ignoreSelf**
      **jailName**
      **mlfidCache**
      "name"
         A string used for identification purposes only.

      "native_id"
         Native integral thread ID of this thread, or None if it has
         not been started.

      **prefRegex**
   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "addAttem  | Generate a failed attempt for ip                                                           |
   | pt"(self,  |                                                                                            |
   | ip,        |                                                                                            |
   | \*matches) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "clearAll  | Clear all lists/dicts parameters (used by reloading)                                       |
   | Params"(s  |                                                                                            |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "isAlive"  | Return whether the thread is alive.                                                        |
   | (self)     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "is_alive  | Return whether the thread is alive.                                                        |
   | "(self)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "join"(se  | Safer join, that could be called also for not started (or ended) threads (used for         |
   | lf)        | cleanup).                                                                                  |
   +------------+--------------------------------------------------------------------------------------------+
   | "performB  | Performs a ban for IPs (or given ip) that are reached maxretry of the jail.                |
   | an"(self[, |                                                                                            |
   | ip])       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Split the time portion from log msg and return findFailures on them                        |
   | ine"(self, |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "processL  | Processes the line for failures and populates failManager                                  |
   | ineAndAdd  |                                                                                            |
   | "(self,    |                                                                                            |
   | line[,     |                                                                                            |
   | date])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "reload"(  | Begin or end of reloading resp.                                                            |
   | self[,     |                                                                                            |
   | begin])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "run"(sel  | Abstract - Called when thread starts, thread stops when returns.                           |
   | f)         |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "start"(s  | Sets active flag and starts thread.                                                        |
   | elf)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "status"(  | Status of failures detected by filter.                                                     |
   | self[,     |                                                                                            |
   | flavor])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "stop"(se  | Sets *active* property to False, to flag run method to return.                             |
   | lf)        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+

   +---------------------+------------+
   | **addFailRegex**    |            |
   +---------------------+------------+
   | **addIgnoreIP**     |            |
   +---------------------+------------+
   | **addIgnoreRegex**  |            |
   +---------------------+------------+
   | **addJournalMatch** |            |
   +---------------------+------------+
   | **commonError**     |            |
   +---------------------+------------+
   | **delFailRegex**    |            |
   +---------------------+------------+
   | **delIgnoreIP**     |            |
   +---------------------+------------+
   | **delIgnoreRegex**  |            |
   +---------------------+------------+
   | **delJournalMatch** |            |
   +---------------------+------------+
   | **findFailure**     |            |
   +---------------------+------------+
   | **getDatePattern**  |            |
   +---------------------+------------+
   | **getFailRegex**    |            |
   +---------------------+------------+
   | **getFindTime**     |            |
   +---------------------+------------+
   | **getIgnoreIP**     |            |
   +---------------------+------------+
   | **getIgnoreRegex**  |            |
   +---------------------+------------+
   | **getJournalMatch** |            |
   +---------------------+------------+
   | **getLogEncoding**  |            |
   +---------------------+------------+
   | **getLogTimeZone**  |            |
   +---------------------+------------+
   | **getMaxLines**     |            |
   +---------------------+------------+
   | **getMaxRetry**     |            |
   +---------------------+------------+
   | **getName**         |            |
   +---------------------+------------+
   | **getUseDns**       |            |
   +---------------------+------------+
   | **inIgnoreIPList**  |            |
   +---------------------+------------+
   | **isDaemon**        |            |
   +---------------------+------------+
   | **logIgnoreIp**     |            |
   +---------------------+------------+
   | **setDaemon**       |            |
   +---------------------+------------+
   | **setDatePattern**  |            |
   +---------------------+------------+
   | **setFindTime**     |            |
   +---------------------+------------+
   | **setLogEncoding**  |            |
   +---------------------+------------+
   | **setLogTimeZone**  |            |
   +---------------------+------------+
   | **setMaxLines**     |            |
   +---------------------+------------+
   | **setMaxRetry**     |            |
   +---------------------+------------+
   | **setName**         |            |
   +---------------------+------------+
   | **setUseDns**       |            |
   +---------------------+------------+

   addJournalMatch(self, match)

   clearAllParams(self)

      Clear all lists/dicts parameters (used by reloading)

   delJournalMatch(self, match=None)

   getJournalMatch(self, match)
