diff options
author | josef <josef.gson@gmail.com> | 2015-11-10 09:56:56 +0100 |
---|---|---|
committer | josef <josef.gson@gmail.com> | 2015-11-10 09:56:56 +0100 |
commit | 6885ec5ce5c478cd7e607bbe283554eddb536158 (patch) | |
tree | 561e17f4971796211b6d34b3984c59f6107b24b0 /monitor/josef_monitor.py | |
parent | ffcd056438f907f27de46129c34026d786129245 (diff) |
adding issuer monitoring for lets encrypt
Diffstat (limited to 'monitor/josef_monitor.py')
-rwxr-xr-x | monitor/josef_monitor.py | 15 |
1 files changed, 15 insertions, 0 deletions
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: |