Logo Search packages:      
Sourcecode: fail2ban version File versions  Download package

def firewall::firewall::Firewall::addBanIP (   self,
  aInfo,
  debug 
)

Bans an IP.

Definition at line 83 of file firewall.py.

00083                                       :
            """ Bans an IP.
            """
            ip = aInfo["ip"]
            if not self.inBanList(ip):
                  crtTime = time.time()
                  logSys.warn("%s: Ban "%self.section + ip)
                  self.banList[ip] = crtTime
                  aInfo["bantime"] = crtTime
                  self.runCheck(debug)
                  cmd = self.banIP(aInfo)
                  if executeCmd(cmd, debug):
                        raise ExternalError("Firewall: execution of fwban command " +
                                                      "'%s' failed"%cmd)
            else:
                  self.runCheck(debug)
                  logSys.error("%s: "%self.section+ip+" already in ban list")
      
      def delBanIP(self, aInfo, debug):


Generated by  Doxygen 1.6.0   Back to index