<?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">
]>

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

<rfc ipr="trust200902" docName="draft-bellis-dnsop-xpf-00" 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="06"/>

    <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 (for example) load
balancing or to perform transport layer conversions.</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>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="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>

</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.</t>

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

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

<t>Proxies implementing this specification must append this option to each
request packet received before forwarding it to the intended DNS server.</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>

<t>Author’s note: what are the implications of that for TSIG <xref target="tsig"/>?</t>

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

<t>This option MUST be ignored by servers when received from a client that
is not white-listed by the server.</t>

<t>When this option is received from a white-listed proxy, the DNS server
MUST (SHOULD?) use the address 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 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>Author’s note: What response for unknown IP version numbers?</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 the server response (which
per above MUST NOT be modified by adding this option) 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 anchor="multi-tier-proxies" title="Multi-tier Proxies">

<t>TBD</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>

</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'>

&RFC1035;
&RFC6891;
&RFC2119;
&RFC2845;
&RFC5625;


    </references>




  </back>
</rfc>

