|
|
@ -8,6 +8,7 @@ import whois
|
|
|
|
import OpenSSL
|
|
|
|
import OpenSSL
|
|
|
|
import ssl
|
|
|
|
import ssl
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
|
|
|
|
import pdb
|
|
|
|
|
|
|
|
|
|
|
|
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p',level=logging.INFO,filename='arke.log')
|
|
|
|
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p',level=logging.INFO,filename='arke.log')
|
|
|
|
logger = logging.getLogger("arke")
|
|
|
|
logger = logging.getLogger("arke")
|
|
|
@ -73,25 +74,20 @@ is_on = True
|
|
|
|
while is_on:
|
|
|
|
while is_on:
|
|
|
|
|
|
|
|
|
|
|
|
today = datetime.today()
|
|
|
|
today = datetime.today()
|
|
|
|
|
|
|
|
datastore = {}
|
|
|
|
|
|
|
|
|
|
|
|
# make sure http targets are /up/
|
|
|
|
# make sure http targets are /up/
|
|
|
|
datastore = monitor_HttpTargets(arkevars.httpTargets)
|
|
|
|
datastore['http'] = monitor_HttpTargets(arkevars.httpTargets)
|
|
|
|
json_string = json.dumps(datastore)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# get SSL certs on http targets
|
|
|
|
# get SSL certs on http targets
|
|
|
|
cert_info = monitor_TlsExpiry(arkevars.tlsTargets)
|
|
|
|
datastore['certs'] = monitor_TlsExpiry(arkevars.tlsTargets)
|
|
|
|
cert_json = json.dumps(cert_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# get whois info on domain targets
|
|
|
|
# get whois info on domain targets
|
|
|
|
domain_info = monitor_DomainExpiry(arkevars.domains_to_check)
|
|
|
|
datastore['whois'] = monitor_DomainExpiry(arkevars.domains_to_check)
|
|
|
|
domain_json = json.dumps(domain_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# write new results to file
|
|
|
|
# write new results to file
|
|
|
|
file = open(this_round_file, "a+")
|
|
|
|
with open(this_round_file, "a+", encoding="utf-8") as outfile:
|
|
|
|
file.write(json_string)
|
|
|
|
json.dump(datastore, outfile, ensure_ascii=False, sort_keys=True)
|
|
|
|
file.write(cert_json)
|
|
|
|
|
|
|
|
file.write(domain_json)
|
|
|
|
|
|
|
|
file.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# track state
|
|
|
|
# track state
|
|
|
|
file = open(this_round_file, "r")
|
|
|
|
file = open(this_round_file, "r")
|
|
|
|