From 6885ec5ce5c478cd7e607bbe283554eddb536158 Mon Sep 17 00:00:00 2001 From: josef Date: Tue, 10 Nov 2015 09:56:56 +0100 Subject: adding issuer monitoring for lets encrypt --- monitor/josef_monitor.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'monitor/josef_monitor.py') diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py index a05a898..2a33ef0 100755 --- a/monitor/josef_monitor.py +++ b/monitor/josef_monitor.py @@ -129,6 +129,7 @@ class ctlog: tmp_data["leaf_hash"] = base64.b64encode(entry_hash) tmp_cert_data.append(tmp_data) new_leafs.append(entry_hash) + monitor_issuer(tmp_data) if self.dbdir: db_add_certs(self.dbdir, tmp_cert_data) if CONFIG.DEFAULT_CERT_FILE: @@ -344,10 +345,24 @@ class ctlog: # print "ERROR:", e.read() # sys.exit(0) +def monitor_issuer(data): + # print data["issuer"] + if CONFIG.ISSUERS_FILE: + filename = CONFIG.ISSUERS_FILE + + for issuer in CONFIG.MONITORED_ISSUERS: + if issuer in data["issuer"]: + with open(filename, 'a') as f: + f.write(time_str() + str(data) + "\n") + f.close() + + def setup_domain_monitoring(): monitored_domains = [] + if not CONFIG.MONITORED_DOMAINS: + return [] try: with open(CONFIG.DOMAINS_FILE) as fp: -- cgit v1.1