<?xml version="1.0" encoding="utf-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.31 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1035 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC6891 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6891.xml">
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2845 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2845.xml">
<!ENTITY RFC5625 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5625.xml">
<!ENTITY RFC7858 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml">
<!ENTITY RFC7871 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7871.xml">
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bellis-dnsop-xpf-01" category="std">

  <front>
    <title>EDNS X-Proxied-For</title>

    <author initials="R." surname="Bellis" fullname="Ray Bellis">
      <organization abbrev="ISC">Internet Systems Consortium, Inc.</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <code>CA 94063</code>
          <country>USA</country>
        </postal>
        <phone>+1 650 423 1200</phone>
        <email>ray@isc.org</email>
      </address>
    </author>

    <date year="2017" month="January" day="09"/>

    <area>Internet</area>
    <workgroup>DNSOP Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>It is becoming more commonplace to install front end proxy devices in
front of DNS servers to provide (for example) load balancing or to
perform transport layer conversions.</t>

<t>This document defines an option within the EDNS(0) Extension Mechanism
for DNS that allows a DNS server to receive the original client source
IP address when supplied by trusted proxies.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>It is becoming more commonplace to install front end proxy devices in
front of DNS servers <xref target="RFC1035"/> to provide load balancing or to
perform transport layer conversions (e.g. to add DNS over TLS
<xref target="RFC7858"/> to a DNS server that lacks native support).</t>

<t>This has the unfortunate side effect of hiding the clients’ source IP
addresses from the server, making it harder to employ server-side
technologies that rely on knowing those address (e.g. ACLs, DNS Response
Rate Limiting, etc).</t>

<t>This document defines an option within the EDNS(0) Extension Mechanism
for DNS <xref target="RFC6891"/> that allows a DNS server to receive the original
client source IP address when supplied by trusted proxies.</t>

<t>Whilst in some circumstances it would be possible to re-use the Client
Subnet EDNS Option <xref target="RFC7871"/> to carry this information, a new option
is defined to allow both this option and the Client Subnet option to
co-exist in the same packet.</t>

</section>
<section anchor="terminology" title="Terminology">

<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”,
“SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and
“OPTIONAL” in this document are to be interpreted as described in
“Key words for use in RFCs to Indicate Requirement Levels” <xref target="RFC2119"/>.</t>

<t>The word “proxy” in this document means a network component that sits on
the inbound query path in front of a recursive or authoritative DNS
server, receiving DNS queries from clients and dispatching them to local
servers.  This is to distinguish these from a “forwarder” since that
term is usually understood to describe a network component that sits on
the oubound query path of a client.</t>

</section>
<section anchor="description" title="Description">

<section anchor="edns-option-format" title="EDNS Option Format">

<t>The overall format of an EDNS option is shown for reference below,
per <xref target="RFC6891"/>, followed by the option specific data:</t>

<figure><artwork><![CDATA[
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |                          OPTION-CODE                          |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |                         OPTION-LENGTH                         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
4: |                                                               |
   /                          OPTION-DATA                          /
   /                                                               /
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>OPTION-CODE: TBD, with mnemonic “XPF”.</t>

<t>OPTION-LENGTH: Size (in octets) of OPTION-DATA.</t>

<t>OPTION-DATA: Option specific, as below:</t>

<figure><artwork><![CDATA[
                +0 (MSB)                            +1 (LSB)
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |     Unused    |   IP Version  |        Address Octet 0        |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |        Address Octet 1        |              ...              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |              ...             ///                              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>Unused: Currently reserved.  These MUST be zero unless redefined in a
subsequent specification.</t>

<t>IP Version: The IP protocol version number used by the client, as
defined in the IANA IP Version Number Registry <xref target="IANA-IP"/>.
Implementations MUST support IPv4 (4) and IPv6 (6).</t>

<t>Address: The source IP address of the client.</t>

</section>
<section anchor="proxy-processing" title="Proxy Processing">

<t>Proxies MUST append this option to each request packet received before
sending it to the intended DNS server.</t>

<t>If this option is already present in an incoming request it MUST be
stripped from the request unless the request was received from an
upstream proxy that is itself white-listed by the receiving proxy (i.e.
if the proxies are configured in a multi-tier architecture), in which
case the original value of the option MUST be preserved.</t>

<t>If the proxy has to create a new OPT RR (because none was present in the
original request) it MUST strip any OPT RR subsequently seen in the
response for conformance with Section 7 of <xref target="RFC6891"/>.</t>

</section>
<section anchor="server-processing" title="Server Processing">

<t>When this option is received from a white-listed client the DNS server
MUST (SHOULD?) use the address from the option contained therein in
preference to the client’s source IP address for any data processing
logic that would otherwise depend on the latter.</t>

<t>If this option is received from a non-white-listed client the server
MUST return a REFUSED response.</t>

<t>If the IP version is not understood by the server it MUST return a
REFUSED response.</t>

<t>If the length of the client IP address contained in the OPTION-DATA is
not consistent with that expected for the given IP version then the
server MUST return a FORMERR response.</t>

<t>Servers MUST NOT send this option in DNS responses.</t>

</section>
<section anchor="tsig" title="  Secret Key Transaction Authentication for DNS (TSIG)">

<t>The considerations for TSIG <xref target="RFC2845"/> from Section 4.5 of “DNS Proxy
Implementation Guidelines” <xref target="RFC5625"/> apply here.</t>

<t>A TSIG-signed request MUST either:</t>

<t><list style="numbers">
  <t>be forwarded according to RFC 5625 without addition of this option,
or</t>
  <t>be verified using a secret shared between client and proxy, updated
with this option, and then re-signed with a (potentially different)
shared secret before sending to the server.</t>
</list></t>

<t>In the case of option 1, the server might still be able to uniquely
identify and authenticate the client through its shared key, but not by
its IP address.</t>

<t>If option 2 is used, there is an operational trade-off to be considered
as to whether the two secrets (between client and proxy, and between
proxy and server) are actually the same secret.  A potential advantage
of three-way sharing of the secret is that if the server response
requires no modifications it may be returned directly to the client
without any further TSIG operations.</t>

<t>Author’s note: A third alternative exists, which is to append an
additional TSIG signature to the packet based on a secret shared only
between the proxy and server.  If end-to-end TSIG validation is required
alongside TSIG validation between proxy and server, the server would
have to 1) validate that second signature, 2) strip it, and then 3)
perform further validation on the original signature.  Feedback is
sought on whether this is worth pursuing.</t>

</section>
</section>
<section anchor="security" title="Security Considerations">

<t>If the white-list of trusted proxies is implemented as a list of IP
addresses, the server administrator MUST have the ability to selectively
disable this feature for any transport where there is a possibility of
the proxy’s source address being spoofed.</t>

<t>This does not mean to imply that use over UDP is impossible - if for
example the network architecture keeps all proxy-to-server traffic on a
dedicated network and clients have no direct access to the servers then
the proxies’ source addresses can be considered unspoofable.</t>

</section>
<section anchor="privacy-considerations" title="Privacy Considerations">

<t>Used incorrectly, this option could expose internal network information,
however it is not intended for use on proxy / forwarder devices that sit
on the client-side of a DNS request.</t>

<t>This specification is only intended for use on server-side proxy devices
that are under the same administrative control as the DNS servers
themselves.  As such there is no change in the scope within which any
private information might be shared.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>IANA are directed to assign the value TBD for the XPF option
in the DNS EDNS0 Option Codes Registry.</t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

</section>


  </middle>

  <back>

    <references title='Normative References'>

<reference anchor="IANA-IP" target="http://www.iana.org/assignments/version-numbers/">
  <front>
    <title>IANA IP Version Registry</title>
    <author >
      <organization>IANA</organization>
    </author>
    <date year="2016" month="November" day="17"/>
  </front>
</reference>
&RFC1035;
&RFC6891;
&RFC2119;
&RFC2845;
&RFC5625;


    </references>

    <references title='Informative References'>

&RFC7858;
&RFC7871;


    </references>



  </back>
</rfc>

