Score:0

Analyse DMARC reports

cn flag

I receive Google's DMARC reports daily as a zip file containing an XML file. I manually download each zip file ~/Documents/DMARC.

I want to aggregate the information from all the saved DMARC reports and produce a human-readable readable report (e.g. table in LibreOffice Calc spreadsheet). I am on Ubuntu 20.04 standard desktop, so I would rather not have memory-hungry or CPU-hungry services running all the time.

Any suggestions on how to do this?

Background Info

Domain-based Message Authentication, Reporting and Conformance (DMARC) is an evolving technical standard and the DMARC report format is specified by that standard. It also looks like Ubuntu will natively support DMARC from 21.04 onwards, but not in 20.04.

The Google link above shows samples of input DMARC XML file format and an output tabular form. As requested, they are pasted here.

Sample input XML file:

<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
  <report_metadata>
    <org_name>solarmora.com</org_name>
    <email>[email protected]</email>
   <extra_contact_info>http://solarmora.com/dmarc/support</extra_contact_info>
    <report_id>9391651994964116463</report_id>
    <date_range>
      <begin>1335571200</begin>
      <end>1335657599</end>
    </date_range>
  </report_metadata>
  <policy_published>
    <domain>bix-business.com</domain>
    <adkim>r</adkim>
    <aspf>r</aspf>
    <p>none</p>
    <sp>none</sp>
    <pct>100</pct>
  </policy_published>
  <record>
    <row>
      <source_ip>203.0.113.209</source_ip>
      <count>2</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>fail</dkim>
        <spf>pass</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>bix-business.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>bix-business.com</domain>
        <result>fail</result>
        <human_result></human_result>
      </dkim>
      <spf>
        <domain>bix-business.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
</feedback>

Sample output table: Sample output table:

muru avatar
us flag
Add some example input and what sort of output you want to your question please.
JayDin avatar
cn flag
@muru the Google link in the question shows both input and output formats. I have also now explicitly stated this in the question. Is that enough?
muru avatar
us flag
No, please include relevant information *in this post* as text, with [code formatting](https://askubuntu.com/editing-help#code).
JayDin avatar
cn flag
@muru ok, added further info and code.
muru avatar
us flag
Thanks, having the XML here is better.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.