MCPcopy Create free account
hub / github.com/adobe/Marinus / get_current_ct_certificates

Function get_current_ct_certificates

python3_cron_scripts/create_cert_graphs.py:33–56  ·  view source on GitHub ↗

Get the list of non-expired certificate transparency certificates for the indicated zone.

(ct_connection, zone)

Source from the content-addressed store, hash-verified

31
32
33def get_current_ct_certificates(ct_connection, zone):
34 """
35 Get the list of non-expired certificate transparency certificates for the indicated zone.
36 """
37
38 results = ct_connection.find(
39 {
40 "isExpired": False,
41 "subject_common_names": {"$regex": r"^(.+\.)*" + zone + "$"},
42 "subject_dns_names": {"$regex": r"^(.+\.)*" + zone + "$"},
43 },
44 {"fingerprint_sha256": 1, "subject_common_names": 1, "subject_dns_names": 1},
45 )
46
47 collection = []
48 for result in results:
49 item = {"id": result["fingerprint_sha256"]}
50 item["dns_entries"] = (
51 result["subject_common_names"] + result["subject_dns_names"]
52 )
53 item["sources"] = ["ct_logs"]
54 collection.append(item)
55
56 return collection
57
58
59def get_censys_count(censys_collection, sha256_hash):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected