<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.19 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-chuang-relay-flow-identifier-00" category="exp" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.15.3 -->
  <front>
    <title abbrev="Relay Flow Identifier">Relay Flow Identifier</title>
    <seriesInfo name="Internet-Draft" value="draft-chuang-relay-flow-identifier-00"/>
    <author fullname="Weihaw Chuang">
      <organization>Google, Inc.</organization>
      <address>
        <email>weihaw@google.com</email>
      </address>
    </author>
    <date year="2023" month="January" day="17"/>
    <workgroup>Independent Stream</workgroup>
    <keyword>DKIM</keyword>
    <keyword>ARC</keyword>
    <keyword>Relay</keyword>
    <abstract>
      <t>To prevent spammers from using relay forwarding, we propose to identify relay flows.  We do this by having relays categorize their authenticated traffic flows and publish to receivers identifiers associated with those flows.  This is a unique, persistent over time, base64 identifier token that is secured by some digital signature.  Receivers can use this identifier to help categorize traffic through the relay and use that identifier to apply fine-grain anti-abuse policies instead of on the entire traffic through the relay.  This document provides a specification for DKIM (<xref target="RFC6376"/>) for originating traffic and ARC <xref target="RFC8617"/> for forwarded traffic.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>Spammers utilize relays to obfuscate their identities and often to spoof some other identity with email receivers.  For example a spammer may exploit the shared tenancy vulnerability of SPF to spoof some identity as follows.  It finds a relay that hosts many different enterprise customers who include the relay's IPs in their SPF policies.  The spammer then sends traffic through the relay assuming the identity of one of those customers i.e. it spoofs the MAIL FROM identity of the victim domain. While the SPF validation (if done) of the initial send by the spammer to the relay fails, a subsequent SPF validation when forwarded to some other victim receiver from the relay will pass SPF because the IPs are contained in the victim's SPF policy.  At some point, the receiver notices the spam via the relay and wants to apply anti-abuse counter measures.  With existing authentication methods, this policy would impact all mail flows through that relay, both innocent and malicious.  A better approach would be to selectively apply anti-abuse counter measures to the spammer's flow which is what this proposal enables.</t>
      <section anchor="terminology-and-definitions">
        <name>Terminology and Definitions</name>
        <t>Acronyms</t>
        <ul spacing="normal">
          <li>Authenticated Received Chain (ARC) <xref target="RFC8617"/> - is a protocol that is meant to resolve some of the issues for DMARC <xref target="RFC7489"/> to fix the problems that DMARC policy rejects caused by mail forwarding, and is based on DKIM, but suffers from similar issues as DKIM replay. ARC defines digital signatures and Authentication-Results by ADMD and a versioning mechanism for them.</li>
          <li>Authentication-Results <xref target="RFC8601"/>- A header containing a list of validation results and comments.</li>
          <li>
            <t>DomainKeys Identified Mail (DKIM) <xref target="RFC6376"/>- IETF standard for the cryptographic protocol to authenticate email at the domain level and protect the integrity of messages during transit.
            </t>
            <ul spacing="normal">
              <li>DKIM replay- <xref target="RFC6376"/> section 8.6 defines a vulnerability called DKIM Replay as a spam message sent through a SMTP MTA DKIM signer, that then is sent to many more recipients, leveraging the reputation of the signer.</li>
            </ul>
          </li>
          <li>Sender Policy Framework (SPF) <xref target="RFC7208"/>- IETF standard for authenticating sending servers typically based on IP address.</li>
        </ul>
      </section>
      <section anchor="relay-flow-identifier-specification">
        <name>Relay Flow Identifier Specification</name>
        <t>This specification defines an identifier for authenticated relay.  Typically it is password authenticated such as methods provided for in <xref target="RFC4954"/> but other methods MAY be possible.  This identifier MAY be used for other authenticated forwarding flows such as mailing lists and with other authentication methods such DKIM or SPF that verifies who the sender is.  Because some relays may be originated at the relay which traditionally will be DKIM signed, this document provides a specification for DKIM (<xref target="RFC6376"/>).  In other instances, relays act as forwarders, and these are sometimes not DKIM signed by the relay so instead this document proposes a specification using ARC (<xref target="RFC8617"/>).</t>
        <section anchor="flow-identification">
          <name>Flow Identification</name>
          <t>The relaying service choosing to use this specification MUST categorize and name relayed traffic flows such that receivers can do anti-abuse analysis upon them if necessary.  In order for the identifier to be effective, it SHOULD be persistent in time and uniquely named across all flows through the relay.  If a message is associated with more than one flow, the relay SHOULD select the more specific flow based on local policy.  This specification defines the relay flow identifier as a base64 (<xref target="RFC4648"/>) token.  That name MUST not be any internal name of the relay though MAY be a secure cryptographic hash of such.</t>
        </section>
        <section anchor="dkim">
          <name>DKIM</name>
          <t>This proposes a new DKIM <xref target="RFC8617"/> DKIM-Signature tag-value that identifies the presence of a relay flow and a flow identifier as a token.  The tag is defined "rfid", while the token value is in base64 (<xref target="RFC4648"/>).   The token parsers MUST ignore a reserved comma that may be further specified in the future.</t>
          <t>Example: \</t>
          <artwork><![CDATA[
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=20230116; h=...; bh=...; b....=; rfid=a+to+z/A+to+Z/0123456789,
]]></artwork>
        </section>
        <section anchor="arc">
          <name>ARC</name>
          <t>This proposes a new ARC <xref target="RFC8617"/> ARC-Authentication-Result defined method (<xref target="RFC8601"/>) that identifies the presence of a relay flow and its property that identifies a flow identifier as a token.  The defined method is "relay", which when present, takes a single result value of "pass" that indicates the relay was authenticated.   The relay method will have a propspec tag-value with a policy ptype with a "id" property i.e "policy.id" that takes a single token value.  That token value is in base64 (<xref target="RFC4648"/>).  The token parser MUST ignore a reserved comma that may be further specified in the future.</t>
          <t>Example: \</t>
          <artwork><![CDATA[
ARC-Authentication-Results: i=1; auth.example.com; relay=pass (comments) policy.id=a+to+z/A+to+Z/0123456789,
]]></artwork>
        </section>
      </section>
      <section anchor="privacy-considerations">
        <name>Privacy Considerations</name>
      </section>
      <section anchor="security-considerations">
        <name>Security Considerations</name>
      </section>
      <section anchor="iana-considerations">
        <name>IANA Considerations</name>
        <t>This document has no IANA actions yet.</t>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC6376" target="https://www.rfc-editor.org/info/rfc6376">
        <front>
          <title>DomainKeys Identified Mail (DKIM) Signatures</title>
          <author fullname="D. Crocker" initials="D." role="editor" surname="Crocker">
            <organization/>
          </author>
          <author fullname="T. Hansen" initials="T." role="editor" surname="Hansen">
            <organization/>
          </author>
          <author fullname="M. Kucherawy" initials="M." role="editor" surname="Kucherawy">
            <organization/>
          </author>
          <date month="September" year="2011"/>
          <abstract>
            <t>DomainKeys Identified Mail (DKIM) permits a person, role, or organization that owns the signing domain to claim some responsibility for a message by associating the domain with the message.  This can be an author's organization, an operational relay, or one of their agents.  DKIM separates the question of the identity of the Signer of the message from the purported author of the message.  Assertion of responsibility is validated through a cryptographic signature and by querying the Signer's domain directly to retrieve the appropriate public key.  Message transit from author to recipient is through relays that typically make no substantive change to the message content and thus preserve the DKIM signature.</t>
            <t>This memo obsoletes RFC 4871 and RFC 5672.  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="76"/>
        <seriesInfo name="RFC" value="6376"/>
        <seriesInfo name="DOI" value="10.17487/RFC6376"/>
      </reference>
      <reference anchor="RFC8617" target="https://www.rfc-editor.org/info/rfc8617">
        <front>
          <title>The Authenticated Received Chain (ARC) Protocol</title>
          <author fullname="K. Andersen" initials="K." surname="Andersen">
            <organization/>
          </author>
          <author fullname="B. Long" initials="B." role="editor" surname="Long">
            <organization/>
          </author>
          <author fullname="S. Blank" initials="S." role="editor" surname="Blank">
            <organization/>
          </author>
          <author fullname="M. Kucherawy" initials="M." role="editor" surname="Kucherawy">
            <organization/>
          </author>
          <date month="July" year="2019"/>
          <abstract>
            <t>The Authenticated Received Chain (ARC) protocol provides an authenticated "chain of custody" for a message, allowing each entity that handles the message to see what entities handled it before and what the message's authentication assessment was at each step in the handling.</t>
            <t>ARC allows Internet Mail Handlers to attach assertions of message authentication assessment to individual messages.  As messages traverse ARC-enabled Internet Mail Handlers, additional ARC assertions can be attached to messages to form ordered sets of ARC assertions that represent the authentication assessment at each step of the message-handling paths.</t>
            <t>ARC-enabled Internet Mail Handlers can process sets of ARC assertions to inform message disposition decisions, identify Internet Mail Handlers that might break existing authentication mechanisms, and convey original authentication assessments across trust boundaries.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8617"/>
        <seriesInfo name="DOI" value="10.17487/RFC8617"/>
      </reference>
      <reference anchor="RFC7489" target="https://www.rfc-editor.org/info/rfc7489">
        <front>
          <title>Domain-based Message Authentication, Reporting, and Conformance (DMARC)</title>
          <author fullname="M. Kucherawy" initials="M." role="editor" surname="Kucherawy">
            <organization/>
          </author>
          <author fullname="E. Zwicky" initials="E." role="editor" surname="Zwicky">
            <organization/>
          </author>
          <date month="March" year="2015"/>
          <abstract>
            <t>Domain-based Message Authentication, Reporting, and Conformance (DMARC) is a scalable mechanism by which a mail-originating organization can express domain-level policies and preferences for message validation, disposition, and reporting, that a mail-receiving organization can use to improve mail handling.</t>
            <t>Originators of Internet Mail need to be able to associate reliable and authenticated domain identifiers with messages, communicate policies about messages that use those identifiers, and report about mail using those identifiers.  These abilities have several benefits: Receivers can provide feedback to Domain Owners about the use of their domains; this feedback can provide valuable insight about the management of internal operations and the presence of external domain name abuse.</t>
            <t>DMARC does not produce or encourage elevated delivery privilege of authenticated email.  DMARC is a mechanism for policy distribution that enables increasingly strict handling of messages that fail authentication checks, ranging from no action, through altered delivery, up to message rejection.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7489"/>
        <seriesInfo name="DOI" value="10.17487/RFC7489"/>
      </reference>
      <reference anchor="RFC8601" target="https://www.rfc-editor.org/info/rfc8601">
        <front>
          <title>Message Header Field for Indicating Message Authentication Status</title>
          <author fullname="M. Kucherawy" initials="M." surname="Kucherawy">
            <organization/>
          </author>
          <date month="May" year="2019"/>
          <abstract>
            <t>This document specifies a message header field called "Authentication-Results" for use with electronic mail messages to indicate the results of message authentication efforts.  Any receiver-side software, such as mail filters or Mail User Agents (MUAs), can use this header field to relay that information in a convenient and meaningful way to users or to make sorting and filtering decisions.</t>
            <t>This document obsoletes RFC 7601.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8601"/>
        <seriesInfo name="DOI" value="10.17487/RFC8601"/>
      </reference>
      <reference anchor="RFC7208" target="https://www.rfc-editor.org/info/rfc7208">
        <front>
          <title>Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1</title>
          <author fullname="S. Kitterman" initials="S." surname="Kitterman">
            <organization/>
          </author>
          <date month="April" year="2014"/>
          <abstract>
            <t>Email on the Internet can be forged in a number of ways.  In particular, existing protocols place no restriction on what a sending host can use as the "MAIL FROM" of a message or the domain given on the SMTP HELO/EHLO commands.  This document describes version 1 of the Sender Policy Framework (SPF) protocol, whereby ADministrative Management Domains (ADMDs) can explicitly authorize the hosts that are allowed to use their domain names, and a receiving host can check such authorization.</t>
            <t>This document obsoletes RFC 4408.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7208"/>
        <seriesInfo name="DOI" value="10.17487/RFC7208"/>
      </reference>
      <reference anchor="RFC4954" target="https://www.rfc-editor.org/info/rfc4954">
        <front>
          <title>SMTP Service Extension for Authentication</title>
          <author fullname="R. Siemborski" initials="R." role="editor" surname="Siemborski">
            <organization/>
          </author>
          <author fullname="A. Melnikov" initials="A." role="editor" surname="Melnikov">
            <organization/>
          </author>
          <date month="July" year="2007"/>
          <abstract>
            <t>This document defines a Simple Mail Transport Protocol (SMTP) extension whereby an SMTP client may indicate an authentication mechanism to the server, perform an authentication protocol exchange, and optionally negotiate a security layer for subsequent protocol interactions during this session.  This extension includes a profile of the Simple Authentication and Security Layer (SASL) for SMTP.</t>
            <t>This document obsoletes RFC 2554.  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4954"/>
        <seriesInfo name="DOI" value="10.17487/RFC4954"/>
      </reference>
      <reference anchor="RFC4648" target="https://www.rfc-editor.org/info/rfc4648">
        <front>
          <title>The Base16, Base32, and Base64 Data Encodings</title>
          <author fullname="S. Josefsson" initials="S." surname="Josefsson">
            <organization/>
          </author>
          <date month="October" year="2006"/>
          <abstract>
            <t>This document describes the commonly used base 64, base 32, and base 16 encoding schemes.  It also discusses the use of line-feeds in encoded data, use of padding in encoded data, use of non-alphabet characters in encoded data, use of different encoding alphabets, and canonical encodings.  [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="4648"/>
        <seriesInfo name="DOI" value="10.17487/RFC4648"/>
      </reference>
    </references>
    <section anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>Thanks goes to Emil Gustafsson for suggesting a DKIM specification.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA7VYbXPbxhH+jl9xlT9EakhakmVZpkYzZS0r1SRqNJIymXb6
5QgcyKsAHHp3IE1n5N/eZ/cOL6QU1+1MM0loA3f7+uzusxiPx4nXvlBTcacK
uRFXhVmL60xVXudaWZHI+dyq1e+8TlLp1cLYzVSoT3WSZCatZAlhmZW5H6fL
RlaLsaWr4xxXx7q7Oj48TFwzL7Vz2lR+U+PW9ceHq6Rqyrmy0ySD6GmSmsqp
yjVuKrxtVAJL3iRrYx8X1jQ1rlSZqlVFYsW9t0qWSaJry6edPz48fH94LJJH
tcGdbCoSMRaXP17f0O/s7gP9sGOJbPzS2HAgEfgnb4oi+PKr0ku5Fh/YmfDS
2IWs9GfpYfpU/GDMolAj2JJO+LUqpS6mYs0X/7Tg15PUlPwyNU3lKWJJklTG
lhCygqOJrvLB38bjsZBz561MfZI8GFEjC+Skq2VZKutEbk0pGqdhEwdY4Ppa
2gwPRlCNC6Y2TglvRIz6pj2ITLiJgGMiM8IvtRPzjVjKVSfLiZhY/RkClkpb
QQEiKfQiQ3Rlnus0iBKyykTdzAvtlqTOqlTBC9jYpxuHnDOp5ttr7XFwSda1
tjyQFfhXiqbS/2oQzRqXtPPks4Ew4XWJp3Pp1OnJQDAUPqoK0qSn+06ljYUK
OORMCQf1QntZCKcXlfR4BV13nX2prBBCFWKwJVMsVVFvRSF67JcA3oLMVzGc
5H0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