Commit Graph

14 Commits

Author SHA1 Message Date
Sean Whalen d7366d088f Add DMARCbis report support; rename forensic→failure project-wide
Rebased on top of master @ 2cda5bf (9.9.0), which added the ASN
source attribution work (#712, #713, #714, #715). Individual Copilot
iteration commits squashed into this single commit — the per-commit
history on the feature branch was iterative (add tests, fix lint,
move field, revert, etc.) and not worth preserving; GitHub squash-
merges PRs anyway.

### DMARCbis fields (new)

New fields from the DMARCbis XSD, plumbed through types, parsing, CSV
output, and the Elasticsearch / OpenSearch mappings:

- ``np`` — non-existent subdomain policy (``none`` / ``quarantine`` /
  ``reject``)
- ``testing`` — testing mode flag (``n`` / ``y``), replaces RFC 7489
  ``pct``
- ``discovery_method`` — policy discovery method (``psl`` /
  ``treewalk``)
- ``generator`` — report generator software identifier (metadata)
- ``human_result`` — optional descriptive text on DKIM / SPF results

RFC 7489 reports parse with ``None`` for DMARCbis-only fields.

### Forensic → failure rename

Forensic reports have been renamed to failure reports throughout the
project to reflect the proper naming since RFC 7489.

- Core: ``types.py``, ``__init__.py`` — ``ForensicReport`` →
  ``FailureReport``, ``parse_forensic_report`` →
  ``parse_failure_report``, report type ``"failure"``.
- Output modules: ``elastic.py``, ``opensearch.py``, ``splunk.py``,
  ``kafkaclient.py``, ``syslog.py``, ``gelf.py``, ``webhook.py``,
  ``loganalytics.py``, ``s3.py``.
- CLI: ``cli.py`` — args, config keys, index names
  (``dmarc_failure``).
- Docs + dashboards: all markdown, Grafana JSON, Kibana NDJSON,
  Splunk XML.

Backward compatibility preserved: old function / type names remain as
aliases (``parse_forensic_report = parse_failure_report``,
``ForensicReport = FailureReport``, etc.), CLI accepts both the old
(``save_forensic``, ``forensic_topic``) and new (``save_failure``,
``failure_topic``) config keys, and updated dashboards query both
old and new index / sourcetype names so data from before and after
the rename appears together.

### Rebase notes

Merge conflicts resolved in ``parsedmarc/constants.py`` (took bis's
10.0.0 bump), ``parsedmarc/__init__.py`` (combined bis's "failure"
wording with master's IPinfo MMDB mention), ``parsedmarc/elastic.py``
and ``parsedmarc/opensearch.py`` (kept master's ``source_asn`` /
``source_asn_name`` / ``source_asn_domain`` on the failure doc path
while renaming ``forensic_report`` → ``failure_report``), and
``CHANGELOG.md`` (10.0.0 entry now sits above the 9.9.0 entry).

All 324 tests pass; ``ruff check`` / ``ruff format --check`` clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 02:26:30 -04:00
Lennart Friberg 91191e30f3 Fix if base_domain is None before get_service_from_reverse_dns_base_d… (#514)
* Fix if base_domain is None before get_service_from_reverse_dns_base_domain call

- Added if statement for base_domain before getting get_service_from_reverse_dns_base_domain(). If base_domain is None, get_service_from_reverse_dns_base_domain() will fail the report.
- Added .xml test file

* Create protection.outlook.com!example.com!1711756800!1711843200.xml

added .xml test sample report where base_domain return none
2024-05-22 08:36:13 -04:00
yuji suzuki 201280d700 Fixed ci for Test sample DMARC reports (#520)
* Fixed ci for Test sample DMARC reports

* pip install local local folder

* pip install path fix
2024-05-22 08:14:04 -04:00
Russel Hunter Yukawa 7aa2e14cbb Fix for deadlock with large report (#508)
* add large xml sample

* Avoid deadlock

* Remove extra  whitespaces
2024-05-22 08:10:59 -04:00
Yuuki Takahashi d512b9f60e fix: handle none value (#468) 2024-02-19 18:53:52 -05:00
Nicholas Hairs cb3f82e847 Add additional samples and ensure git does not touch CRLF (#456)
mimecast sample taken from:
https://github.com/domainaware/parsedmarc/issues/429#issuecomment-1873387507
2024-01-02 16:29:06 -05:00
Sean Whalen 89872d78ac Fix testing 2023-06-27 15:43:09 -04:00
Sean Whalen 4fca674064 6.10.0
- Ignore unknown forensic report fields when generating CSVs (Closes issue #148)
- Fix crash on IMAP timeout (PR #164 - closes issue #163)
- Use SMTP port from the config file when sending emails (PR #151)
- Add support for Elasticsearch 7.0 (PR #161 - closes issue #149)
- Remove temporary workaround for DMARC aggregate report records missing a SPF domain fields
2020-05-10 17:44:14 -04:00
Sean Whalen d0bb858e74 6.9.0 2020-02-17 16:24:11 -05:00
Ebrahim Aharpour 4c57181e21 Making dkim_aligned and spf_aligned case insensitive. 2019-12-16 21:32:00 +01:00
michaeldavie d4ec6dee65 Handle invalid XML 2019-11-05 22:13:06 -05:00
michaeldavie 13a2624850 Handle invalid bytes 2019-11-05 21:15:06 -05:00
Sean Whalen e588845f23 6.1.0 - Fix aggregate report email parsing regression
Fix aggregate report email parsing regression in 6.0.3 (closes issues #57 and #58)
2019-02-13 10:30:25 -05:00
Sean Whalen f45ab94e06 Update test suitw 2018-10-11 19:01:02 -04:00