From c635e0f76e7774cfd1ed6a80a67587c10a2defea Mon Sep 17 00:00:00 2001 From: sirferl Date: Thu, 3 Dec 2020 09:24:49 +0100 Subject: [PATCH] added CSR, Owner, Cert type and extended key usage from Entrust --- lemur/plugins/lemur_entrust/plugin.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lemur/plugins/lemur_entrust/plugin.py b/lemur/plugins/lemur_entrust/plugin.py index 8c50fd6e..5f758fed 100644 --- a/lemur/plugins/lemur_entrust/plugin.py +++ b/lemur/plugins/lemur_entrust/plugin.py @@ -20,13 +20,14 @@ def log_status_code(r, *args, **kwargs): :param kwargs: :return: """ - log_data = { - "reason": (r.reason if r.reason else ""), - "status_code": r.status_code, - "url": (r.url if r.url else ""), - } - metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1) - current_app.logger.info(log_data) + if r.status_code != 200: + log_data = { + "reason": (r.reason if r.reason else ""), + "status_code": r.status_code, + "url": (r.url if r.url else ""), + } + metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1) + current_app.logger.info(log_data) def determine_end_date(end_date): @@ -386,6 +387,9 @@ class EntrustSourcePlugin(SourcePlugin): "body": certificate["endEntityCert"], "serial": serial, "external_id": str(certificate["trackingId"]), + "csr": certificate["csr"], + "owner": certificate["tracking"]["requesterEmail"], + "description": f"Type: Entrust {certificate['certType']}\nExtended Key Usage: {certificate['eku']}" } certs.append(cert) processed_certs += 1