|
1 | 1 | # tinydmarc |
2 | | -A tiny "functionally minimalist" DMARC aggregate report summarizer |
| 2 | +A tiny "functionally minimalist" DMARC aggregate report summarizer. |
| 3 | + |
| 4 | +## What is it? |
| 5 | + |
| 6 | +`tinydmarc` is a small, simple CLI that can read in a set of DMARC Aggregate Report XML files and generates a report, broken down by week and receiving domain, with the number |
| 7 | +of emails "rejected" and "not rejected" by each domain in that week. |
| 8 | + |
| 9 | +## What isn't it? |
| 10 | + |
| 11 | +This is in no way a "feature rich" tool for processing DMARC reports! |
| 12 | + |
| 13 | +- It does not handle many error cases |
| 14 | +- It does not handle DMARC Forensic reports |
| 15 | +- It does not draw any charts |
| 16 | +- It does not handle non-standard Aggregate Report files |
| 17 | +- It does not retrieve the report files from an email account |
| 18 | +- It does not handle time zones |
| 19 | + |
| 20 | +`tinydmarc` does the bare minimum of what I want, and was mostly an exercise in learning the basics of Rust. If you want an awesome, fully functional DMARC solution, then |
| 21 | +check out [parsedmarc](https://domainaware.github.io/parsedmarc/#). If you just want to check if your DMARC reports show any rejected messages recently then maybe `tinydmarc` |
| 22 | +is for you. |
| 23 | + |
| 24 | +## What does it do? |
| 25 | + |
| 26 | +`tinydmarc` takes as input a directory containing a set of DMARC Aggregate Reports. It reads in all of the reports, then assigns them to a week-long time bucket running from |
| 27 | +Sunday to Sunday, using the value from `feedback.report_metadata.date_range.begin`. |
| 28 | + |
| 29 | +It then loops through each time bucket and processes all of the reports in that bucket. For each report, it iterates through each `feedback.record` and counts how many messages |
| 30 | +have `record.row.policy_evaluated.disposition` equal to "none" (counting as a "good" message) and how many do not (counting as a "bad" message). It then generates a report with |
| 31 | +a weekly breakdown of how many messages each receiving domain reported as "good" and "bad". |
| 32 | + |
| 33 | +The report can be printed to `STDOUT` or written to a file, and the report format can be one of `txt`, `html` and `JSON`. |
| 34 | + |
| 35 | +## How do I use it? |
| 36 | + |
| 37 | +``` |
| 38 | +$ tinydmarc --help |
| 39 | +Tiny DMARC Report Generator 0.0.1 |
| 40 | +Scans all DMARC XML reports in a folder and generates a simple HTML report |
| 41 | +
|
| 42 | +USAGE: |
| 43 | + tinydmarc [FLAGS] [OPTIONS] --inputDir <INPUTDIR> |
| 44 | +
|
| 45 | +FLAGS: |
| 46 | + -h, --help Prints help information |
| 47 | + -v Sets the level of verbosity (-vvv is trace) |
| 48 | + -V, --version Prints version information |
| 49 | +
|
| 50 | +OPTIONS: |
| 51 | + -o, --outputFormat <FORMAT> Sets the output file format [default: txt] [possible values: html, txt, json] |
| 52 | + -i, --inputDir <INPUTDIR> Sets the directory containing the DMARC reports |
| 53 | + -f, --outputFile <OUTPUTFILE> Sets the output file to write to |
| 54 | +``` |
| 55 | + |
| 56 | +### Print out a summary to STDOUT |
| 57 | + |
| 58 | +``` |
| 59 | +$> tinydmarc --inputDir path/to/dmarc/reports/ |
| 60 | +DMARC REPORT GENERATED AT 2020-12-14T23:02:36.546142100+00:00 |
| 61 | +=== |
| 62 | +Date: Sun 22 November - Sat 28 November |
| 63 | +Domain: "google.com" - Good: 6 - Bad: 0 |
| 64 | +--- |
| 65 | +Date: Sun 29 November - Sat 5 December |
| 66 | +Domain: "Yahoo! Inc." - Good: 6 - Bad: 0 |
| 67 | +Domain: "google.com" - Good: 40 - Bad: 0 |
| 68 | +--- |
| 69 | +``` |
| 70 | + |
| 71 | +### Write an HTML report to a file |
| 72 | + |
| 73 | +``` |
| 74 | +$> tinydmarc --inputDir path/to/dmarc/reports/ --outputFile path/to/report.html -o html |
| 75 | +``` |
| 76 | + |
| 77 | +which may produce: |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +## License |
| 82 | + |
| 83 | +Do what you want with it! |
0 commit comments