Network Working Group | D. Crocker, Ed. |
Internet-Draft | Brandenburg InternetWorking |
Intended status: Best Current Practice | April 11, 2013 |
Expires: October 13, 2013 |
Using DMARC
draft-crocker-dmarc-bcp-01
Email abuse often relies on unauthorized use of a domain name, such as one belonging to a well-known company (brand). SPF and DKIM provide basic domain name authentication methods for email. A recent industry effort built an additional authentication-based layer, called Domain-based Message Authentication, Reporting & Conformance (DMARC). It allows a sender to indicate that their emails are protected by SPF and/or DKIM, and tells a receiver what to do if neither of those authentication methods passes; it also provides a reporting mechanism, from receivers back to domain owners. Such capabilities over the public Internet are unusual and their use is not yet well-understood. This document formulates a set of best practices for the use of DMARC.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 13, 2013.
Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Email abuse often relies on unauthorized use of a domain name, such as one belonging to a well-known company (brand). SPF [RFC4408] and DKIM [RFC6376] provide basic domain name authentication methods for email. A recent industry effort (DMARC.org) built an additional authentication-based layer, called Domain-based Message Authentication, Reporting & Conformance. [DMARC] allows a sender to indicate that their emails are protected by SPF and/or DKIM, and tells a receiver what to do if neither of those authentication methods passes; it also provides a reporting mechanism, from receivers back to domain owners. Such capabilities over the public Internet are unusual and their use is not yet well-understood. This document formulates a set of best practices for the use of DMARC.
Discussion is divided along basic lines of activity:
An IETF mailing list for discussing DMARC issues has been established: dmarc@ietf.org.
{This section is meant for any any software development practices, relevant to the use of DMARC. -ed}
Within this section are discussed various hurdles, either real or feared, that might need to be overcome to incorporate DMARC into successful operational service. This includes issues that are applicable from either a sending perspective, as a receiver, or both. When considering DMARC, one must consider the operational and technical maturity that would support a successful implementation
Additional concerns:
Distinct from lower-level issues in the specific steps for deploying and using DMARC is the approach taken in overall planning for its integration and use within the operational email service.
DMARC is intended to protect transactional mail.[*] If you don't send transactional mail, you are not in the primary use case for DMARC, and you probably do not want to set up domains with p=reject. You may, however, want to protect mailboxes by checking inbound mail, and you may want information about how your domains are showing up at recipients by publishing a p=none record.
So, first you need to determine what domains you own, and sort them into piles.
Sending domains:
If you have mixed domains that contain both transactional mail and mail from individuals that join mailing lists, you have four main choices, in order from best protection of your brand to least:
Receiving domains:
Once you know what domains you are trying to protect, you can pick values for alignment and for sp.
If you have a large pile of sending domains like shipping.example.com, ordering.example.com, todays-promotions.example.com, you probably want to make a single, relaxed alignment record for example.com. The same is true for any domain in which you know people frequently create new sending domains with little coordination.
If you have a small number of sending domains, you probably want to make an entry for each with strict alignment and sp=reject. You will also want a sp=reject entry on the parent domain. So, for instance, if example.com sends transactional mail only from important.example.com and marketing mail from marketing.example.com, while the employees hang out on example.com, all three domains should be set to strict alignment and sp=reject. In theory you could in omit the records for important.example.com and marketing.example.com in this situation. In practice, you will almost certainly work your way up to p=reject on different schedules for them, so at least during rollout you will need separate records.
The procedure for incrementally rolling out DMARC on an individual Sending domain is discussed elsewhere.
Most senders have multiple domains, however, and will have to pick which ones to work on first. Start with some combination of
If you can't easily identify domains in either of these categories, turn on DMARC with p=none for a wide assortment of domains, and see if that clarifies matters. (Often it reveals domains that are in both categories at once; domains used for sending some particular piece of signed, transactional mail, where much more forged mail than good mail is sent.) You can use the p=none reporting on a lower domain to substitute for turning on p=none on a subdomain (so, for instance, if you have example.com at p=none and notice that alerts.example.com sends out only DKIM-signed mail, you can move alerts.example.com directly to p=quarantine, and senders who are familiar with DMARC and their sending environment may choose to move it directly to p=reject)
In order to have fully implemented DMARC on the receiving side, you must both act on mail and report on mail. In general, you will have to pick one of these to do first; do you turn on reporting, and report all mail as exempted for local reasons, or do you turn on actions first? Both of these are acceptable compromises, as long as you are rejecting rather than silently discarding mail when p=reject. However, you should not spend very long in either state.
[Original listing of issues]
The first step most recipients of DMARC aggregate XML reports will take, after accepting the compressed files via email, will be to uncompress the file and run a script or program to parse and store the data contained within the reports. In order for this to work properly, the filenames and report metadata must work in a standard way from all DMARC compliant report generators.
The correct compression mechanism and filename convention is described in section 12.2.1 [DMARC] for emailed reports. It is important to ensure that the uncompressed filename still adheres to the specified naming convention. Cases have been noted were upon uncompressing a file, the new filename is something entirely different than what is specified in section 12.2.1.
In the report metadata there are several fields that contain important information for a report recipient. Here is a brief description of each field and some notes on usage and/or problems encountered with each.
<?xml version="1.0" encoding="UTF-8" ?> <feedback> <report_metadata> <org_name>google.com</org_name> <email>noreply-dmarc-support@google.com</email> <extra_contact_info>http://support.google.com/a/bin/answer.py?answer=2466580</extra_contact_info> <report_id>303460054821571539</report_id> <date_range> <begin>1364169600</begin> <end>1364255999</end> </date_range> </report_metadata> <policy_published> <domain>facebook.com</domain> <adkim>r</adkim> <aspf>r</aspf> <p>reject</p> <sp>reject</sp> <pct>100</pct> </policy_published>
Below is a sample of report metadata and policy discovery sections of DMARC XML report with a the file name: google.com!facebook.com!1364169600!1364255999.xml.
The data contained in a DMARC aggregate report, at minimum, allows a report recipient to:
To make this possible, each record in a DMARC report must contain a minimum set of data. The fields below are defined in Appendix C. DMARC XML Schema and are critical to producing a complete aggregate report. Some notes on usage of these fields are included to help guide you in your deployment.
Below are three examples of real DMARC XML records for a domain with a DMARC reject policy in place.
<record> <row> <source_ip>91.98.85.94</source_ip> <count>1</count> <policy_evaluated> <disposition>reject</disposition> <dkim>fail</dkim> <spf>fail</spf> </policy_evaluated> </row> <identifiers> <header_from>blog.facebook.com</header_from> </identifiers> <auth_results> <dkim> <domain></domain> <result>none</result> </dkim> <spf> <domain>blog.facebook.com</domain> <result>neutral</result> </spf> </auth_results> </record>
Example 1. This record indicates a single message matching this set of data points. The DMARC disposition for this message was “reject” based on DMARC aligned results for SPF and DKIM of “fail” and the domain’s reject policy. The empty DKIM domain field and DKIM authentication result of “none” indicates that there was no DKIM signature. The result of the SPF authentication check was “neutral”.
<record> <row> <source_ip>141.161.2.153</source_ip> <count>3</count> <policy_evaluated> <disposition>none</disposition> <dkim>pass</dkim> <spf>fail</spf> </policy_evaluated> </row> <identifiers> <header_from>facebook.com</header_from> </identifiers> <auth_results> <dkim> <domain>facebook.com</domain> <result>pass</result> </dkim> <spf> <domain>facebook.com</domain> <result>fail</result> </spf> </auth_results> </record>
Example 2. This record indicates that 3 messages were represented by this set of data points. The disposition for these messages was “none” because the DMARC aligned result for DKIM was “pass”. The DMARC aligned result for SPF was “fail”. The messages passed the DKIM authentication check and failed the SPF authentication check.
<record> <row> <source_ip>65.61.105.5</source_ip> <count>1</count> <policy_evaluated> <disposition>reject</disposition> <dkim>fail</dkim> <spf>fail</spf> </policy_evaluated> </row> <identifiers> <header_from>facebook.com</header_from> </identifiers> <auth_results> <dkim> <domain></domain> <result>none</result> </dkim> <spf> <domain>classifiedads.com</domain> <result>pass</result> </spf> </auth_results> </record>
Example 3. This record indicates a single message matching this set of data points. The DMARC disposition for this message was “reject” based on DMARC aligned results for SPF and DKIM of “fail” and the domain’s reject policy. There was no DKIM signature on this message, as in Example 1. The SPF authentication result was “pass” with a MAILFROM domain of “classifiedads.com”. The SPF domain is not aligned with the header From domain, causing the DMARC aligned SPF result to be “fail”.
The DMARC specification allows for a DMARC compliant receiver to take an action that is different than the DMARC disposition for the message (see Section B.3.1, SMTP-time Processing [DMARC]). Reasons that a receiver may choose to do so include overriding a reject policy if the message source is a known forwarder or mailing list that breaks DKIM and SPF. If a message source has a high reputation the receiver may choose to accept and/or analyze a message with local rules despite a DMARC disposition of “reject”. While ultimately an email receiver’s local policy and the final placement of a message cannot be standardized by DMARC, the DMARC related reporting of such can.
The reporting of a “PolicyOverrideReason” is specified in Appendix C [DMARC]. A <reason> tag is included in the <policy_evaluated> section of the <record> with two sub-fields, <type> and <comment>. Below are the DMARC XML tags and fields involved with a brief explanation of each and two real examples of DMARC records with a PolicyOverrideReason.
<record> <row> <source_ip>132.205.122.20</source_ip> <count>19</count> <policy_evaluated> <disposition>reject</disposition> <dkim>fail</dkim> <spf>fail</spf> <reason> <type>mailing_list</type> <comment></comment> </reason> </policy_evaluated> </row> <identifiers> <header_from>star.c10r.facebook.com</header_from> </identifiers> <auth_results> <dkim> <domain>facebookmail.com</domain> <result>neutral</result> <human_result></human_result> </dkim> <spf> <domain>star.c10r.facebook.com</domain> <result>neutral</result> </spf> </auth_results> </record>
Example 1. In this example the DMARC disposition is reject, based on the domain’s DMARC reject policy and DMARC aligned SPF and DKIM results of “fail”. But a <reason><type> of “mailing_list” is reported by the report generator. The report recipient can interpret this to mean that the domain’s reject policy was correctly applied, but the receiver chose to override the reject action because the message source is a known mailing list which cause SPF and DKIM to break.
<record> <row> <source_ip>195.23.141.86</source_ip> <count>2</count> <policy_evaluated> <disposition>none</disposition> <dkim>pass</dkim> <spf>fail</spf> <reason> <type>forwarded</type> <comment></comment> </reason> </policy_evaluated> </row> <identifiers> <header_from>support.facebook.com</header_from> </identifiers> <auth_results> <dkim> <domain>support.facebook.com</domain> <result>pass</result> <human_result></human_result> </dkim> <spf> <domain>support.facebook.com</domain> </spf> </auth_results> </record>
Example 2. In this example the DMARC disposition is “none” because the DMARC aligned DKIM result is “pass”, thus the domain’s DMARC reject policy is not applicable. Yet the report generator still chose to report a policy override <reason><type> of “forwarded” in the record. This is perfectly acceptable, even though the policy override reason did not impact the treatment of the message as far as DMARC is concerned.
DMARC forensic reports serve two primary purposes. First is to allow a domain owner to investigate in more detail, legitimate sources of their email that are failing one or both modes of authentication. For example, from aggregate data one might know that a domain’s 3rd party email is failing DKIM some percentage of the time yet not know which messages are affected. Forensic reports could show a consistent From address and Subject from the source that are unsigned, indicating a specific campaign not being signed by DKIM. Second is to allow a domain owner to understand and mitigate specific threat campaigns abusing their domain. Examples include early identification of phishing URLs in current campaigns for quick takedown or identification of Subjects used in current campaigns which can be used by customer service call center personnel to handle customer calls.
The data contained in a DMARC forensic report, at minimum, allows a report recipient to:
Details on the format of failure reports are found in sections 8.4. and 8.4.1 [DMARC].
Upon successful publication of a DMARC record for your domain you will soon begin to receive DMARC data. Current report generator practice is to aggregate DMARC data daily. Therefore you should expect to receive your first aggregate data in the range of 12 – 48 hours after you first publish the record. This can vary depending on the time of day your record was published. DMARC aggregate reports should use UTC day boundaries for the reporting intervals. There is also some time lag while your record propagates through DNS is discoverable by DMARC compliant receivers.
The aggregate data files will arrive as gzipped email attachments. While the DMARC specification allows for multiple types of URIs to indicate your preference for aggregate data delivery, current report generator practice is to deliver reports via email using the mailto: URI specified in the rua tag. Note that if you list multiple email addresses in your rua tag, you should list them in the order of the highest priority address first, as there have been report generators who do not send to all addresses. In these cases the report generator does send reports to at least the first address listed. Upon receipt of these files you will need to uncompress them for further processing or manual inspection.
Upon successful publication of a DMARC record for your domain you will also begin to receive DMARC failure data for individual message failures at the email address specified in your DMARC record’s ruf tag. You will likely receive your first reports within the first 24 hours of your record being published. There are several factors that will affect the timing and source of your first failure reports. First, the current practice is that only a small number of DMARC receivers are providing failure reports, as it is optional for a DMARC receiver to provide this data. Therefore you should not expect failure reports from all of the same report generators that send you aggregate reports. Next, failure reports are not aggregated and the current practice among report generators is to generate a report near real time when they receive the failed message.
The failure reports you will receive are specified in section 8.4. and 8.4.1 [DMARC].. These reports are intended to be machine readable and it is recommended that you automate the process of parsing and storing the data contained in the reports. The volume of these reports you will receive can be highly variable and it is not limited by the amount of email that you send. Attacks using your domain can happen at any time and their nature is largely outside of your control. Therefore it is also recommended that your report processing infrastructure be able to rate limit or sample the inbound reports in a way that does not negatively impact the sending infrastructure of report generators.
If you have published DMARC records and waited 24 to 48 hours yet still received no data you should check the following:
For detailed descriptions on the meaning of different data fields in DMARC aggregate XML files please see the descriptions in subsections .1-.3 of Section 7. For a description of the data contained in a failure report (see Section 7.4). In order to move on to the analysis of DMARC data, it is important to understand what the report generator is telling you in each field.
There are many ways you can approach the analysis of DMARC data for your domain. The approach you take will likely depend on what you already know about your domain’s email sending and abuse of your domain. It is recommended that in general you start with aggregate data. Here are some suggestions on initial things to look for.
As you analyze data and answer some of these questions, it will lead to deeper investigation. At some point you will reach a limit to what you can learn from the aggregate data and likely need to look further using failure reports if they are available. You may want to search for examples of failures coming from a particular IP address to understand what kind of messages are being sent. With the From, Subject, and URLs in failure reports you may be able to identify specific phishing or spam campaigns using your domain.
Once you have a good understanding of the current state of your domain’s email you can use DMARC data to begin remediating problems and tracking the ongoing progress of your changes. Depending on your domain’s email characteristics your ultimate goal may be to publish DMARC reject policies or to simply continue collecting intelligence about your email.
When analyzing DMARC data you will likely come across results that you want to verify or understand better. In some cases this is possible via further analysis of additional DMARC aggregate data fields. In other cases it is helpful if you have failure reports to analyze. A few examples of common things to explore are noted below.
Do DMARC.org members think it is appropriate to point out here that there are vendor and 3rd party resources that can help with report receipt, processing, and analysis? Of course we would not mention specifics here, but could point to the dmarc.org/resources. I feel it is appropriate to point out that a build vs buy decision is possible.
This section is meant as a catch-all, for items that haven't yet been assigned to their appropriate section.
Some issues come into play when DMARC is used in conjunction with one or more other services.
This section explains a number of choices made for DMARC.
In this section we describe several security considerations related to the implementation of the DMARC protocol.
[Original listing of issues]
[DMARC] | Kucherawy, M., "Domain-based Message Authentication, Reporting and Conformance (DMARC)", URL https://datatracker.ietf.org/doc/draft-kucherawy-dmarc-base/, March 2013. |
[RFC4408] | Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) for Authorizing Use of Domains in E-Mail, Version 1", RFC 4408, April 2006. |
[RFC6376] | Crocker, D., Hansen, T. and M. Kucherawy, "DomainKeys Identified Mail (DKIM) Signatures", RFC 6376, September 2011. |
DMARC and the version of this document submitted to the IETF were the result of lengthy efforts by an informal industry consortium: DMARC.org. Participating companies included: Agari, American Greetings, AOL, Bank of America, Cloudmark, Comcast, Facebook, Fidelity Investments, Google, JPMorgan Chase & Company, LinkedIn, Microsoft, Netease, Paypal, ReturnPath, Trusted Domain Project, and Yahoo!. Although the number of contributors and supporters are too numerous to mention, notable individual contributions were made by J. Trent Adams, Michael Adkins, Monica Chew, Dave Crocker, Tim Draegen, Murray Kucherawy, Steve Jones, Franck Martin, Brett McDowell, and Paul Midgen. The contributors would also like to recognize the invaluable input and guidance that was provided by J.D. Falk.