Certstream ingestor now only logs sub-domains since we already ingested zone files. Ignores www. and wildcard domains.
This commit is contained in:
parent
7f93a4d8de
commit
1ab7199f7d
@ -54,10 +54,20 @@ async def process_data(place_holder: str = None):
|
|||||||
logging.error(f'Invalid line from the websocket: {line}')
|
logging.error(f'Invalid line from the websocket: {line}')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Grab the unique domains from the record (excluding wildcards)
|
# Grab the unique domains from the records
|
||||||
domains = record['data']['leaf_cert']['all_domains']
|
all_domains = record['data']['leaf_cert']['all_domains']
|
||||||
domains = set([domain[2:] if domain.startswith('*.') else domain for domain in domains])
|
domains = list()
|
||||||
|
|
||||||
|
# We only care about subdomains (excluding www. and wildcards)
|
||||||
|
for domain in all_domains:
|
||||||
|
if domain.startswith('*.'):
|
||||||
|
domain = domain[2:]
|
||||||
|
elif domain.startswith('www.') and domain.count('.') == 2:
|
||||||
|
continue
|
||||||
|
if domain.count('.') > 1:
|
||||||
|
if domain not in domains:
|
||||||
|
domains.append(domain)
|
||||||
|
|
||||||
# Construct the document
|
# Construct the document
|
||||||
for domain in domains:
|
for domain in domains:
|
||||||
struct = {
|
struct = {
|
||||||
|
Loading…
Reference in New Issue
Block a user