<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-brotman-dkim-aggregate-reporting-01" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true" consensus="true">

<front>
<title abbrev="DKIM-AGGREGATE-REPORTING">Aggregate Reports for DKIM Signers</title><seriesInfo value="draft-brotman-dkim-aggregate-reporting-01" stream="IETF" status="standard" name="RFC"></seriesInfo>
<author initials="A." surname="Brotman" fullname="Alex Brotman"><organization>Comcast, Inc</organization><address><postal><street></street>
</postal><email>alex_brotman@comcast.com</email>
</address></author><date year="2024" month="August" day="6"></date>
<area>Applications</area>
<workgroup></workgroup>

<abstract>
<t>This document introduces a mechanism enabling DKIM-signing domain owners to
solicit aggregate reports from email receivers. Presented in an
XML format, these reports possess adaptable elements conducive for
integration with current and future drafts and standards like DMARCbis. They
capture the evaluation outcomes of DKIM signatures, such as 'pass' or 'fail',
alongside other potential data attributes. Receivers can relay these
aggregate reports to destinations designated by the DKIM-signing domain
holder, contingent upon their support capabilities.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>With a growing emphasis on email security, the industry is rapidly adopting
message authentication mechanisms such as DKIM and SPF. While many initiatives,
including DMARC, aim to enhance message validation through their reporting
features, they often fall short in meeting the diverse needs of all
stakeholders in the email delivery process. Moreover, these mechanisms
aren't always effective in identifying certain abuses, like DKIM replay.</t>
<t>A notable challenge arises with marketing and transactional messages, which
often contain multiple valid DKIM signatures.  While DMARC reports can provide
information to the 5322.From Domain holder, some DKIM signers may not receive a
copy of that information.  This gap in information could result in a lack of
understanding when there is an issue with authentication.</t>
</section>

<section anchor="glossary"><name>Glossary</name>

<ul>
<li><t>DKIM (DomainKeys Identified Mail): An email authentication method utiilizing a cryptographic signature.</t>
</li>
<li><t>DMARC (Domain-based Message Authentication, Reporting &amp; Conformance): An email authentication mechanism that uses SPF and DKIM to verify the use of the domain in an email's visible From: header.</t>
</li>
<li><t>SPF (Sender Policy Framework): An email authentication method using an IP-based configuration.</t>
</li>
<li><t>Replay Attack: A malicious technique where an attacker intercepts and retransmits a valid data transmission, often to impersonate another user or entity.</t>
</li>
<li><t>Selector: A string used by the DKIM system to help identify the DKIM public key information.</t>
</li>
<li><t>GUID (Globally Unique Identifier): A unique reference number used as an identifier in software.</t>
</li>
<li><t>DNS (Domain Name System): A system for converting human-friendly domain names into IP addresses.</t>
</li>
<li><t>5322.From domain: The domain present in the &quot;From:&quot; field of an email, as defined in RFC 5322.</t>
</li>
<li><t>Aggregate Report: Summarized feedback about messages purported to come from a specific domain during a specified period.</t>
</li>
</ul>
</section>

<section anchor="enhanced-awareness-for-validation-outcome"><name>Enhanced Awareness For Validation Outcome</name>
<t>Visibility into DKIM signatures responsible for message
authentication can be fairly important to system operators, perhaps
more so when the signatures do not align with the 5322.From Domain. Allowing
receivers to inform signers about potential validation errors could aid in
resolving those issues, and allow for better authentication for the
given message stream.</t>
</section>

<section anchor="decoding-dkim-reports-insights-and-implications"><name>Decoding DKIM Reports: Insights and Implications</name>
<t>The essence of DKIM aggregate reports is to furnish Signing Domain Owners
with a thorough understanding of the following:</t>

<ul>
<li><t>Authentication Results: The outcomes from various verification checks
provide an indication of how receivers evaluate the messages. It's crucial
for signing domain owners to comprehend the frequency of their successful
authentications and pinpoint potential areas for improvement.</t>
</li>
<li><t>Trust in Original Senders: Before applying signatures to future messages,
signing domain owners need to evaluate the credibility and reliability of
the submission entity. If issues or inconsistencies arise in reports, it might
signal that the original sender's practices aren't aligned with the signing
domain owner's standards, leading to reconsideration of the signing
relationship.</t>
</li>
</ul>
<t>OR</t>

<ul>
<li><t>Evaluation of Submitting Entity: Allowing the signing entity to understand
if the signer would like to continue to sign on behalf of the submitter. If
the submitter has questionable practices, the signing may not wish to
continue signing on behalf of that submitter.</t>
</li>
<li><t>Indications of DKIM Replay: DKIM replay involves the malicious reuse of a
previously signed email by unauthorized entities. By identifying signs like
SPF zone misalignment or unexpected volume discrepancies, signing domain
owners can address potential threats and maintain the integrity
of their emails.</t>
</li>
</ul>
</section>

<section anchor="configuring-dkim-aggregate-reporting-a-guide-to-dns-records"><name>Configuring DKIM Aggregate Reporting: A Guide to DNS Records</name>
<t>Email security necessitates clear and accurate configuration.  As domains
employ authentication mechanisms, they must follow technical specifications,
as well as best common practices.  Domain owners may choose to use their
own resources for this, or utilize a third-party to assist them with
various parts of the process or on-going operations.</t>

<section anchor="delegation-of-sending-to-third-parties"><name>Delegation of sending to Third-Parties:</name>
<t>To delegate DKIM signing to a third party, the domain owner must publish
specific DNS TXT or CNAME records associated with the DKIM keys used by the
third-party sender.</t>
<t>Example:
<tt>delegatedselector._domainkey.example.org</tt> TXT <tt>v=DKIM1;k=rsa;p=&lt;data&gt;</tt></t>
<t><tt>_dmarc.example.org</tt> TXT <tt>v=DMARC1;rua=mailto:reports@example.org</tt></t>
<t>Here, <tt>delegatedselector</tt> is the selector. As per DMARCbis, <tt>example.org</tt> will
receive DMARC aggregate reports at <tt>reports@example.org</tt>.</t>
</section>

<section anchor="receiving-dkim-aggregate-reports"><name>Receiving DKIM Aggregate Reports:</name>
<t>For the third party DKIM signer to access DKIM aggregate reports, an
additional DNS TXT record is required.</t>
<t>Example:
<tt>_report.delegatedselector._domainkey.example.org</tt> TXT <br />
<tt>v=RDKIM;tgt=mailto:reports@thirdparty.example</tt></t>
<t>Additionally, to prevent unsolicited reports and denial of service against
third party receiving endpoints, report senders MUST check for the existence
of a DNS record:</t>
<t>Example:
<tt>example.org._report._domainkey.thirdparty.example</tt></t>
<t>This ensures that the third party can retrieve the reports via email without
receiving unsolicited reports.</t>
</section>

<section anchor="third-party-signature-considerations"><name>Third-Party Signature Considerations:</name>
<t>Third-party senders might use additional signatures under their own domains
to gather feedback about email quality. A typical setup:</t>
<t><tt>selector._domainkey.thirdparty.example</tt> TXT <tt>v=DKIM1;k=rsa;p=&lt;data&gt;</tt></t>
<t>For the DKIM aggregate reports:
<tt>_report.selector._domainkey.thirdparty.example</tt> TXT <br />
<tt>v=RDKIM;tgt=mailto:reports@thirdparty.example</tt></t>
</section>

<section anchor="feedback-suppression-and-visibility"><name>Feedback Suppression and Visibility:</name>
<t>Sending domain (5322.From) owners might sometimes prefer to suppress feedback,
minimizing any potential exposure of sensitive report data or to hide their
malicious intent from the signer. To maintain transparency and ensure that all
parties (the domain owner and the third-party sender) have adequate
visibility, report senders SHOULD transmit reports to all the specified
reporting addresses.</t>
</section>
</section>

<section anchor="dns-entry-format"><name>DNS Entry Format</name>
<t>There are a number of methods by which a domain can declare the intention to
receive reports:</t>
<t>v: This MUST be &quot;RDKIM&quot;. If this is absent, the record is invalid.</t>
<t>tgt: The location(s) for reports. Methods can be requested as <tt>mailto</tt>.
      Be mindful that more than one can be requested
      but not all receivers will support all varieties.  Each mechanism has
      more detail below.  If a mistake in the record is found by the receiver,
      the entirety of the record should be ignored.</t>
<t>rfr: This is a pointer to another domain to use their data.  May be used
      in conjunction with a <tt>tgt</tt> attribute. This should take the format
      of the FQDN, i.e., &quot;v=RDKIM;rfr:_report.selector._domainkey.foo.com&quot;.</t>

<section anchor="example-dns-entries-for-dkim-based-reporting"><name>Example DNS Entries for DKIM-based Reporting</name>

<ul spacing="compact">
<li>Basic Reporting</li>
</ul>
<t>_report.selector1._domainkey.example.org TXT <br />
  &quot;v=RDKIM;tgt=<eref target="mailto:reporting@example.org&quot;">mailto:reporting@example.org"</eref></t>

<ul spacing="compact">
<li>Delegated Reporting (with referral record)</li>
</ul>
<t>_report.selector1._domainkey.example.org TXT <br />
  &quot;v=RDKIM;tgt=<eref target="mailto:reporting@other.org&quot;">mailto:reporting@other.org"</eref></t>
<t>example.org._report._domainkey.other.org TXT <br />
  &quot;v=RDKIM&quot;</t>

<ul spacing="compact">
<li>Two destinations</li>
</ul>
<t>_report.selector1._domainkey.example.org TXT <br />
  &quot;v=RDKIM;tgt=<eref target="mailto:reporting@example.org,mailto:reporting@elsewhere.com&quot;">mailto:reporting@example.org,mailto:reporting@elsewhere.com"</eref></t>
<t>example.org._report._domainkey.elsewhere.com TXT <br />
  &quot;v=RDKIM&quot;</t>

<ul spacing="compact">
<li>Only a referral</li>
</ul>
<t>_report.selector1._domainkey.example.org TXT <br />
  &quot;v=RDKIM;rfr:_report._selector1.domainkey.other.org&quot;</t>
<t>_report.selector1._domainkey.other.org TXT <br />
  &quot;v=RDKIM;tgt=<eref target="mailto:reporting@elsewhere.com&quot;">mailto:reporting@elsewhere.com"</eref></t>
<t>example.org._report._domainkey.elsewhere.com TXT <br />
  &quot;v=RDKIM&quot;</t>
</section>
</section>

<section anchor="dual-or-more-signed-messages"><name>Dual (Or More) Signed Messages</name>
<t>When a message has multiple signatures which verify, the reporter SHOULD send
reports to all signatories who have requested reports.  In the case where two
(or more) signatures have the same destination <tt>tgt</tt>, this should still
generate as many reports as there are valid signatures.</t>
<t>NOTE, this needs to be expanded.</t>
</section>

<section anchor="feedback-mechanisms"><name>Feedback Mechanisms</name>

<section anchor="mailto"><name>mailto</name>
<t>Similar to DMARC reports, data is aggregated and sent to the site daily.</t>
</section>
</section>

<section anchor="report-format"><name>Report Format</name>
<t>This format will be an XML file.</t>
<t>NOTE:  There's no true reason to keep this as XML, JSON is an option.</t>
<t>A sample file:</t>

<artwork>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;feedback xmlns=&quot;urn:ietf:params:xml:ns:dkimaggreport-1.0&quot;&gt;
    &lt;report_metadata&gt;
        &lt;org_name&gt;Reporter Company&lt;/org_name&gt;
        &lt;email&gt;contact@receiver.net&lt;/email&gt;
        &lt;extra_contact_info&gt;dest_domain: foo.net&lt;/extra_contact_info&gt;
        &lt;report_id&gt;GUID_HERE&lt;/report_id&gt;
        &lt;date_range&gt;
            &lt;begin&gt;151061515&lt;/begin&gt;
            &lt;end&gt;151071241&lt;/end&gt;
        &lt;/date_range&gt;
    &lt;/report_metadata&gt;
    &lt;signature&gt;
        &lt;domain&gt;example.org&lt;/domain&gt;
        &lt;selector&gt;delegatedselector&lt;/selector&gt;
    &lt;/signature&gt;
    &lt;record&gt;
        &lt;row&gt;
            &lt;source_ip&gt;10.123.23.12&lt;/source_ip&gt;
            &lt;spf_domain&gt;botnet.example&lt;/spf_domain&gt;
            &lt;spf_result&gt;pass&lt;/spf_result&gt;
            &lt;spf_alignment&gt;fail&lt;/spf_alignment&gt;
            &lt;dkim_passed&gt;123&lt;/dkim_passed&gt;
            &lt;dkim_failed&gt;1&lt;/dkim_failed&gt;
            &lt;dkim_alignment&gt;true&lt;/dkim_alignment&gt;
            &lt;from_domain&gt;example.org&lt;/from_domain&gt;
            &lt;extensions&gt;
              &lt;extension def=&quot;https://site.com/ext_def&quot;&gt;
                ...
              &lt;/extension&gt;
            &lt;/extensions&gt;
        &lt;/row&gt;
        &lt;identifiers&gt;
            &lt;sample_msg_id&gt;uuid@bounces.example.org&lt;/sample_msg_id&gt;
        &lt;/identifiers&gt;
    &lt;/record&gt;
    &lt;extensions&gt;
      &lt;extension def=&quot;https://site.com/ext2_def&quot;&gt;
        ...
      &lt;/extension&gt;
    &lt;/extensions&gt;
&lt;/feedback&gt;
</artwork>

<section anchor="report-declaration"><name>Report Declaration</name>

<section anchor="published-policy"><name>Published Policy</name>
<t>The <tt>domain</tt> is the domain from the <tt>d=</tt> in the original message signature,
and the <tt>selector</tt> is from the <tt>s=</tt>.</t>
<t>The time period for the report should be a single UTC day, and noted
in the report body by the epoch timestamps with <tt>start</tt> and <tt>end</tt>.</t>
</section>
</section>

<section anchor="row-data"><name>Row Data</name>
<t>Each row should contain information so that the recipient can understand
more about how their signature is being used, whether pass or fail.</t>
<t>source_ip: The Internet Address responsible for delivery of the message.</t>
<t>spf_domain: The domain used during SPF evaluation, whether the HELO string
             or the Return-Path. Review <xref target="RFC7208"></xref>.</t>
<t>spf_result: Must be one of pass/fail/error.</t>
<t>spf_alignment: Acceptable values are true/false.</t>
<t>dkim_passed: The number of messages in this row for which DKIM evaluation
              succeeded.</t>
<t>dkim_failed: The number of messages for which this DKIM signature could not be
              properly evaluated.</t>
<t>dkim_alignment: Per the DKIM RFC, was the DKIM signature properly aligned with
                 Sending Domain. Values are true/false.</t>
<t>from_domain: The 5322.From sending Domain.</t>
</section>

<section anchor="report-metadata"><name>Report Metadata</name>
<t>The subject of the report should contain a few key components:</t>

<ul spacing="compact">
<li>Selector - The value from the s= being reported</li>
<li>Domain - The value from the d= being reported</li>
<li>Date - format is YYYYMMDD</li>
<li>GUID</li>
</ul>
<t>Format MUST be:</t>
<t>Subject: &lt;selector&gt;:&lt;domain&gt;; &lt;date&gt;; &lt;guid&gt;</t>
<t>The GUID MUST be in a header for the report, called
<tt>DKIM-Aggregate-Report-GUID</tt>.</t>
</section>

<section anchor="extensions"><name>Extensions</name>
<t>The report format allows for the possibility of extensions. The extensions
can be included within a row, or within the record.  The absence of these
sections MUST NOT result in a processing error.  The party including the
extension should include a URL to a definition of some sort.  This would
aid report receivers in understanding how to best interpret the data.</t>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>

<section anchor="report-abuse"><name>Report Abuse</name>
<t>NOTE, needs to be more fully considered.  If we allow for an open target
for real-time reporting, how does a report receiver ensure the sender
is reputable?</t>

<ul spacing="compact">
<li>Report receivers need to deduplicate reports if multiple signing domains
with feedback enabled is employed</li>
<li>Report receivers should use DMARC logic to authenticate the reporter when
deciding whether to trust the reports. For example, allow-list the RFC5322.From
address of trusted reporters only if the reports are sent with DKIM
domain-aligned authenticated identifier</li>
<li>Report senders should include a sample message-id</li>
<li>Report receivers should look for a sample message-id to authenticate the
report as being associated with a message it has sent recently</li>
</ul>
</section>
</section>

<section anchor="contributors"><name>Contributors</name>
</section>

<section anchor="notes"><name>Notes</name>
</section>

<section anchor="references"><name>References</name>

<ol>
<li><t><strong>RFC5322</strong>: &quot;Internet Message Format&quot;. IETF.</t>
</li>
<li><t><strong>RFC6376</strong>: &quot;DomainKeys Identified Mail (DKIM) Signatures&quot;. IETF.</t>
</li>
<li><t><strong>RFC7489</strong>: &quot;Domain-based Message Authentication, Reporting, and Conformance (DMARC)&quot;. IETF.</t>
</li>
<li><t><strong>RFC7208</strong>: &quot;Sender Policy Framework (SPF) for Authorizing Use of Domains in Email&quot;. IETF.</t>
</li>
</ol>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7208.xml"/>
</references>

</back>

</rfc>
