Commit d43fcee8 authored by Romain Courteaud's avatar Romain Courteaud

Bot: warn about domain linking to a single IP

parent f4b012fc
......@@ -524,12 +524,24 @@ class WebBot:
for domain in domain_list:
if domain in checked_domain_dict:
if "A" in checked_domain_dict[domain]:
for server_ip in checked_domain_dict[domain]["A"][
"response"
].split(", "):
if not server_ip:
# drop empty response
continue
# Drop empty response
domain_server_ip_list = [
x
for x in checked_domain_dict[domain]["A"][
"response"
].split(", ")
if x
]
if len(domain_server_ip_list) == 1:
result_dict["warning"].append(
{
"text": "(A) single IP for: %s" % (domain,),
"date": result_dict["bot_status"][0]["date"],
}
)
for server_ip in domain_server_ip_list:
if server_ip not in server_ip_dict:
server_ip_dict[server_ip] = []
if domain not in server_ip_dict[server_ip]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment