Add alignment booleans to JSON output

This commit is contained in:
Sean Whalen
2018-09-17 12:35:27 -04:00
parent 3fdd5457b1
commit aead7ee754
2 changed files with 7 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ Collector (HEC)
- Use a browser-like `User-Agent` when downloading the Public Suffix List, to
avoid being blocked by security proxies
- Reduce default DNS timeout to 0.5 seconds
- Add alignment booleans to JSON output
3.9.7
-----

View File

@@ -350,6 +350,12 @@ def _parse_report_record(record, nameservers=None, timeout=0.5):
if "spf" in policy_evaluated:
new_policy_evaluated["spf"] = policy_evaluated["spf"]
reasons = []
spf_aligned = policy_evaluated["spf"] == "pass"
dkim_aligned = policy_evaluated["dkim"] == "pass"
dmarc_aligned = spf_aligned or dkim_aligned
new_record["alignment"]["spf"] = spf_aligned
new_record["alignment"]["dkim"] = dkim_aligned
new_record["alignment"]["dmarc"] = dmarc_aligned
if "reason" in policy_evaluated:
if type(policy_evaluated["reason"]) == list:
reasons = policy_evaluated["reason"]