Actually save source_tye and source_name to Elasticsearch and Opensearch

This commit is contained in:
Sean Whalen
2024-04-01 09:14:45 -04:00
parent 36eedcb446
commit d6128eae9f
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -413,7 +413,7 @@ def parse_aggregate_report_xml(
Args:
xml (str): A string of DMARC aggregate report XML
ip_db_path (str): Path to a MMDB file from MaxMind or DBIP
always_use_local_files (bool): Do not download files
always_use_local_files (bool): Do not download files
reverse_dns_map_path (str): Path to a reverse DNS map file
reverse_dns_map_url (str): URL to a reverse DNS map file
offline (bool): Do not query online for geolocation or DNS
+3 -1
View File
@@ -60,7 +60,7 @@ class _AggregateReportDoc(Document):
source_ip_address = Ip()
source_country = Text()
source_reverse_dns = Text()
source_Base_domain = Text()
source_base_domain = Text()
source_type = Text()
source_name = Text()
message_count = Integer
@@ -442,6 +442,8 @@ def save_aggregate_report_to_elasticsearch(aggregate_report,
source_country=record["source"]["country"],
source_reverse_dns=record["source"]["reverse_dns"],
source_base_domain=record["source"]["base_domain"],
source_type=record["source"]["type"],
source_name=record["source"]["name"],
message_count=record["count"],
disposition=record["policy_evaluated"]["disposition"],
dkim_aligned=record["policy_evaluated"]["dkim"] is not None and
+3 -1
View File
@@ -59,7 +59,7 @@ class _AggregateReportDoc(Document):
source_ip_address = Ip()
source_country = Text()
source_reverse_dns = Text()
source_Base_domain = Text()
source_base_domain = Text()
source_type = Text()
source_name = Text()
message_count = Integer
@@ -438,6 +438,8 @@ def save_aggregate_report_to_opensearch(aggregate_report,
source_country=record["source"]["country"],
source_reverse_dns=record["source"]["reverse_dns"],
source_base_domain=record["source"]["base_domain"],
source_type=record["source"]["type"],
source_name=record["source"]["name"],
message_count=record["count"],
disposition=record["policy_evaluated"]["disposition"],
dkim_aligned=record["policy_evaluated"]["dkim"] is not None and