mirror of https://github.com/fail2ban/fail2ban
commit
c429f5c91a
|
@ -65,7 +65,7 @@ class JailReader(ConfigReader):
|
|||
["int", "maxretry", 3],
|
||||
["int", "findtime", 600],
|
||||
["int", "bantime", 600],
|
||||
["string", "use_dns", "warn"],
|
||||
["string", "usedns", "warn"],
|
||||
["string", "failregex", None],
|
||||
["string", "ignoreregex", None],
|
||||
["string", "ignoreip", None],
|
||||
|
@ -123,8 +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 == "use_dns":
|
||||
stream.append(["set", self.__name, "use_dns", 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":
|
||||
|
|
|
@ -62,7 +62,7 @@ protocol = [
|
|||
["set <JAIL> delignoreregex <INDEX>", "removes the regular expression at <INDEX> for ignoreregex"],
|
||||
["set <JAIL> findtime <TIME>", "sets the number of seconds <TIME> for which the filter will look back for <JAIL>"],
|
||||
["set <JAIL> bantime <TIME>", "sets the number of seconds <TIME> a host will be banned for <JAIL>"],
|
||||
["set <JAIL> use_dns <VALUE>", "sets the use_dns mode for <JAIL>"],
|
||||
["set <JAIL> usedns <VALUE>", "sets the usedns mode for <JAIL>"],
|
||||
["set <JAIL> banip <IP>", "manually Ban <IP> for <JAIL>"],
|
||||
["set <JAIL> maxretry <RETRY>", "sets the number of failures <RETRY> before banning the host for <JAIL>"],
|
||||
["set <JAIL> addaction <ACT>", "adds a new action named <NAME> for <JAIL>"],
|
||||
|
@ -81,7 +81,7 @@ protocol = [
|
|||
["get <JAIL> ignoreregex", "gets the list of regular expressions which matches patterns to ignore for <JAIL>"],
|
||||
["get <JAIL> findtime", "gets the time for which the filter will look back for failures for <JAIL>"],
|
||||
["get <JAIL> bantime", "gets the time a host is banned for <JAIL>"],
|
||||
["get <JAIL> use_dns", "gets the use_dns setting for <JAIL>"],
|
||||
["get <JAIL> usedns", "gets the usedns setting for <JAIL>"],
|
||||
["get <JAIL> maxretry", "gets the number of failures allowed for <JAIL>"],
|
||||
["get <JAIL> addaction", "gets the last action which has been added for <JAIL>"],
|
||||
["get <JAIL> actionstart <ACT>", "gets the start command for the action <ACT> for <JAIL>"],
|
||||
|
|
|
@ -38,7 +38,7 @@ maxretry = 3
|
|||
# pyinotify, gamin, polling.
|
||||
backend = auto
|
||||
|
||||
# "use_dns" specifies if jails should trust hostnames in logs,
|
||||
# "usedns" specifies if jails should trust hostnames in logs,
|
||||
# warn when reverse DNS lookups are performed, or ignore all hostnames in logs
|
||||
#
|
||||
# yes: if a hostname is encountered, a reverse DNS lookup will be performed.
|
||||
|
@ -46,7 +46,7 @@ backend = auto
|
|||
# but it will be logged as a warning.
|
||||
# no: if a hostname is encountered, will not be used for banning,
|
||||
# but it will be logged as info.
|
||||
use_dns = warn
|
||||
usedns = warn
|
||||
|
||||
|
||||
# This jail corresponds to the standard configuration in Fail2ban 0.6.
|
||||
|
|
|
@ -143,14 +143,14 @@ class Filter(JailThread):
|
|||
|
||||
##
|
||||
# Set the Use DNS mode
|
||||
# @param value the use_dns mode
|
||||
# @param value the usedns mode
|
||||
|
||||
def setUseDns(self, value):
|
||||
self.__useDns = value
|
||||
|
||||
##
|
||||
# Get the use_dns mode
|
||||
# @return the use_dns mode
|
||||
# Get the usedns mode
|
||||
# @return the usedns mode
|
||||
|
||||
def getUseDns(self):
|
||||
return self.__useDns
|
||||
|
@ -586,7 +586,7 @@ class DNSUtils:
|
|||
if useDns == "no":
|
||||
return None
|
||||
else:
|
||||
logSys.debug("use_dns = %s" % useDns)
|
||||
logSys.debug("usedns = %s" % useDns)
|
||||
ipList = list()
|
||||
# Search for plain IP
|
||||
plainIP = DNSUtils.searchIP(text)
|
||||
|
|
|
@ -154,7 +154,7 @@ class Transmitter:
|
|||
value = int(command[2])
|
||||
self.__server.delIgnoreRegex(name, value)
|
||||
return self.__server.getIgnoreRegex(name)
|
||||
elif command[1] == "use_dns":
|
||||
elif command[1] == "usedns":
|
||||
value = command[2]
|
||||
self.__server.setUseDns(name, value)
|
||||
return self.__server.getUseDns(name)
|
||||
|
@ -235,7 +235,7 @@ class Transmitter:
|
|||
return self.__server.getFailRegex(name)
|
||||
elif command[1] == "ignoreregex":
|
||||
return self.__server.getIgnoreRegex(name)
|
||||
elif command[1] == "use_dns":
|
||||
elif command[1] == "usedns":
|
||||
return self.__server.getUseDns(name)
|
||||
elif command[1] == "findtime":
|
||||
return self.__server.getFindTime(name)
|
||||
|
|
Loading…
Reference in New Issue