added CSR, Owner, Cert type and extended key usage from Entrust

This commit is contained in:
sirferl 2020-12-03 09:24:49 +01:00
parent 6585bcaa55
commit c635e0f76e
1 changed files with 11 additions and 7 deletions

View File

@ -20,13 +20,14 @@ def log_status_code(r, *args, **kwargs):
:param kwargs: :param kwargs:
:return: :return:
""" """
log_data = { if r.status_code != 200:
"reason": (r.reason if r.reason else ""), log_data = {
"status_code": r.status_code, "reason": (r.reason if r.reason else ""),
"url": (r.url if r.url 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) metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1)
current_app.logger.info(log_data)
def determine_end_date(end_date): def determine_end_date(end_date):
@ -386,6 +387,9 @@ class EntrustSourcePlugin(SourcePlugin):
"body": certificate["endEntityCert"], "body": certificate["endEntityCert"],
"serial": serial, "serial": serial,
"external_id": str(certificate["trackingId"]), "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) certs.append(cert)
processed_certs += 1 processed_certs += 1