mirror of https://github.com/fail2ban/fail2ban
Change domain filter regex
Change domain filter regex since there are other Google crawlers. See "Google crawlers" <https://support.google.com/webmasters/answer/1061943?hl=en>pull/1226/head
parent
74fcb219ab
commit
2c576c64f8
|
@ -21,6 +21,7 @@ ver. 0.9.4 (2015/XX/XXX) - wanna-be-released
|
||||||
* Treat failed and killed execution of commands identically (only
|
* Treat failed and killed execution of commands identically (only
|
||||||
different log messages), which addresses different behavior on different
|
different log messages), which addresses different behavior on different
|
||||||
exit codes of dash and bash (gh-1155)
|
exit codes of dash and bash (gh-1155)
|
||||||
|
* Fix jail.conf.5 man's section (gh-1226)
|
||||||
|
|
||||||
- New Features:
|
- New Features:
|
||||||
|
|
||||||
|
@ -34,6 +35,8 @@ ver. 0.9.4 (2015/XX/XXX) - wanna-be-released
|
||||||
(Thanks M. Maraun)
|
(Thanks M. Maraun)
|
||||||
* Added check against atacker's Googlebot PTR fake records
|
* Added check against atacker's Googlebot PTR fake records
|
||||||
(Thanks Pablo Rodriguez Fernandez)
|
(Thanks Pablo Rodriguez Fernandez)
|
||||||
|
* Enhance filter against atacker's Googlebot PTR fake records
|
||||||
|
(gh-1226)
|
||||||
|
|
||||||
ver. 0.9.3 (2015/08/01) - lets-all-stay-friends
|
ver. 0.9.3 (2015/08/01) - lets-all-stay-friends
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -26,7 +26,7 @@ def is_googlebot(ip):
|
||||||
from fail2ban.server.filter import DNSUtils
|
from fail2ban.server.filter import DNSUtils
|
||||||
|
|
||||||
host = DNSUtils.ipToName(ip)
|
host = DNSUtils.ipToName(ip)
|
||||||
if not host or not re.match('crawl-.*\.googlebot\.com$', host):
|
if not host or not re.match('.*\.google(bot)?\.com$', host):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
host_ips = DNSUtils.dnsToIp(host)
|
host_ips = DNSUtils.dnsToIp(host)
|
||||||
sys.exit(0 if ip in host_ips else 1)
|
sys.exit(0 if ip in host_ips else 1)
|
||||||
|
|
Loading…
Reference in New Issue