Skip to content

Commit

Permalink
Actually save source_tye and source_name to Elasticsearch and Opensearch
Browse files Browse the repository at this point in the history
  • Loading branch information
seanthegeek committed Apr 1, 2024
1 parent 36eedcb commit d6128ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parsedmarc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion parsedmarc/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Index:
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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion parsedmarc/opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Index:
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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d6128ea

Please sign in to comment.