<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.1 (Ruby 3.2.2) -->

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-ohai-svcb-config-07" number="9540" submissionType="IETF" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true"
updates="" obsoletes="" xml:lang="en" version="3">

  <!-- xml2rfc v2v3 conversion 3.18.1 -->
  <front>
    <title abbrev="Oblivious Services in SVCB">Discovery of Oblivious Services via Service Binding Records</title>
    <seriesInfo name="RFC" value="9540"/>
    <author initials="T." surname="Pauly" fullname="Tommy Pauly">
      <organization>Apple Inc.</organization>
      <address>
        <email>tpauly@apple.com</email>
      </address>
    </author>
    <author initials="T." surname="Reddy.K" fullname="Tirumaleswar Reddy.K">
      <organization>Nokia</organization>
      <address>
        <email>kondtir@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="February"/>
    <area>sec</area>
    <workgroup>ohai</workgroup>

<keyword>DNS</keyword>
<keyword>Oblivious HTTP</keyword>
<keyword>SVCB</keyword>

    <abstract>
<t>This document defines a parameter that can be included in Service Binding (SVCB) and HTTPS
DNS resource records to denote that a service is accessible using Oblivious
HTTP, by offering an Oblivious Gateway Resource through which to access the
target. This document also defines a mechanism for learning the key configuration
of the discovered Oblivious Gateway Resource.</t>

    </abstract>
  </front>
  <middle>
<section anchor="introduction">
      <name>Introduction</name>
      <t>Oblivious HTTP <xref target="RFC9458"/> allows clients to encrypt
messages exchanged with an Oblivious Target Resource (target). The messages
are encapsulated in encrypted messages to an Oblivious Gateway Resource
(gateway), which offers Oblivious HTTP access to the target. The gateway is
accessed via an Oblivious Relay Resource (relay), which proxies the encapsulated
messages to hide the identity of the client. Overall, this architecture is
designed in such a way that the relay cannot inspect the contents of messages,
and the gateway and target cannot learn the client's identity from a single
transaction.</t>
      <t>Since Oblivious HTTP deployments typically involve very specific coordination
between clients, relays, and gateways, the key configuration is often shared
in a bespoke fashion. However, some deployments involve clients
discovering targets and their associated gateways more dynamically.
For example, a network might operate a DNS resolver that provides more optimized
or more relevant DNS answers and is accessible using Oblivious HTTP, and might
want to advertise support for Oblivious HTTP via mechanisms like Discovery of
Designated Resolvers <xref target="RFC9462"/> and
Discovery of Network-designated Resolvers <xref target="RFC9463"/>.
Clients can access these gateways through trusted relays.</t>
      <t>This document defines a way to use DNS resource records (RRs) to advertise that an HTTP
service supports Oblivious HTTP. This advertisement is a parameter that can be included in
Service Binding (SVCB) and HTTPS DNS RRs <xref target="RFC9460"/> (<xref target="svc-param"/>).
The presence of this parameter indicates that a service can act as a target and
has a gateway that can provide access to the target.</t>
      <t>The client learns the URI to use for the gateway using a well-known
URI suffix <xref target="RFC8615"/>, "ohttp-gateway", which is accessed on
the target (<xref target="gateway-location"/>). This means that for deployments that
support this kind of discovery, the Gateway and Target Resources need to
be located on the same host.</t>
      <t>This document also defines a way to fetch a gateway's key
configuration from the gateway (<xref target="config-fetch"/>).</t>
      <t>This mechanism does not aid in the discovery of relays;
relay configuration is out of scope for this document. Models in which
this discovery mechanism is applicable are described in <xref target="applicability"/>.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
       <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
       "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>",
       "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>",
       "<bcp14>SHOULD NOT</bcp14>",
       "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
       "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document
       are to be interpreted as described in BCP&nbsp;14
       <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
       when, they appear in all capitals, as shown here.</t>
</section>
    <section anchor="applicability">
      <name>Applicability</name>
      <t>There are multiple models in which the discovery mechanism defined
in this document can be used. These include:</t>

      <ul spacing="normal">
        <li>
          <t>Upgrading regular (non-proxied) HTTP to Oblivious HTTP. In this model,
the client intends to communicate with a specific target service and
prefers to use Oblivious HTTP if it is available. The target service
has a gateway that it offers to allow access using Oblivious
HTTP. Once the client learns about the gateway, it "upgrades"
its requests from non-proxied HTTP to Oblivious HTTP to access
the target service.</t>
        </li>
        <li>
          <t>Discovering alternative Oblivious HTTP services. In this model,
the client has a default target service that it uses. For
example, this may be a public DNS resolver that is accessible over
Oblivious HTTP. The client is willing to use alternative
target services if they are discovered, which may provide more
optimized or more relevant responses.</t>
        </li>
      </ul>
      <t>In both of these deployment models, the client is configured with
a relay that it trusts for Oblivious HTTP transactions. This
relay needs to provide either (1)&nbsp;generic access to gateways or
(2)&nbsp;a service to clients to allow them to check which gateways
are accessible.</t>
    </section>
    <section anchor="svc-param">
      <name>The &quot;ohttp&quot; SvcParamKey</name>
      <t>The "ohttp" SvcParamKey is used to indicate that a
service described in a SVCB RR can be accessed as a target
using an associated gateway. The service that is queried by the client hosts
one or more Target Resources.</t>
      <t>In order to access the service's Target Resources using Oblivious HTTP, the client
needs to send encapsulated messages to the Gateway Resource and the gateway's
key configuration (both of which can be retrieved using the method described in
<xref target="config-fetch"/>).</t>
      <t>Both the presentation and wire-format values for the "ohttp" parameter
<bcp14>MUST</bcp14> be empty.</t>
      <t>Services can include the "ohttp" parameter in the mandatory parameter
list if the service is only accessible using Oblivious HTTP. Marking
the "ohttp" parameter as mandatory will cause clients that do not
understand the parameter to ignore that SVCB RR.
Including the "ohttp" parameter without marking it mandatory advertises
a service that is optionally available using Oblivious HTTP. Note also
that multiple SVCB RRs can be provided to indicate separate
configurations.</t>
      <t>The media type to use for encapsulated requests made to a target service
depends on the scheme of the SVCB RR. This document defines the
interpretation for the "https" scheme <xref target="RFC9460"/> and the "dns" scheme <xref target="RFC9461"/>. Other schemes that want to use this parameter <bcp14>MUST</bcp14> define the
interpretation and meaning of the configuration.</t>
      <section anchor="use-in-https-service-rrs">
        <name>Use in HTTPS Service RRs</name>
        <t>For the "https" scheme, which uses the HTTPS RR type instead of SVCB,
the presence of the "ohttp" parameter means that the target
being described is an Oblivious HTTP service that is accessible using
the default "message/bhttp" media type <xref target="RFC9458"/>
          <xref target="RFC9292"/>.</t>
        <t>For example, an HTTPS service RR for svc.example.com that supports
Oblivious HTTP could look like this:</t>

        <artwork><![CDATA[
svc.example.com. 7200  IN HTTPS 1 . ( alpn=h2 ohttp )
]]></artwork>
        <t>A similar RR for a service that only supports Oblivious HTTP
could look like this:</t>
        <artwork><![CDATA[
svc.example.com. 7200  IN HTTPS 1 . ( mandatory=ohttp ohttp )
]]></artwork>
      </section>
      <section anchor="use-in-dns-server-svcb-rrs">
        <name>Use in DNS Server SVCB RRs</name>
        <t>For the "dns" scheme, as defined in <xref target="RFC9461"/>, the presence of
the "ohttp" parameter means that the DNS server being
described has a DNS-over-HTTPS (DoH) service <xref target="RFC8484"/> that can
be accessed using Oblivious HTTP. Requests to the resolver are sent to
the gateway using binary HTTP with the default "message/bhttp"
media type <xref target="RFC9292"/>, containing inner requests that use the
"application/dns-message" media type <xref target="RFC8484"/>.</t>
        <t>If the "ohttp" parameter is included in a DNS server SVCB RR,
the "alpn" parameter <bcp14>MUST</bcp14> include at least one HTTP value (such as "h2" or
"h3").</t>
        <t>In order for DoH-capable recursive resolvers to function as Oblivious HTTP targets, their
associated gateways need to be accessible via a client-trusted relay.
DoH recursive resolvers used with the discovery mechanisms described
in this section can be either publicly accessible or specific to a
network. In general, only publicly accessible DoH recursive resolvers will work
as Oblivious HTTP targets, unless there is a coordinated deployment
with a relay to access the network-specific DoH recursive resolvers.</t>
        <section anchor="ddr">
          <name>Use with DDR</name>
          <t>Clients can discover that a DoH recursive resolver supports Oblivious HTTP using
DDR, by either querying _dns.resolver.arpa to a locally configured
resolver or querying using the name of a resolver <xref target="RFC9462"/>.</t>
          <t>For example, a DoH service advertised over DDR can be annotated
as supporting resolution via Oblivious HTTP using the following RR:</t>
          <artwork><![CDATA[
_dns.resolver.arpa  7200  IN SVCB 1 doh.example.net (
     alpn=h2 dohpath=/dns-query{?dns} ohttp )
]]></artwork>
          <t>Clients still need to perform verification of oblivious DoH servers --
specifically, the TLS certificate checks described in <xref section="4.2" sectionFormat="of" target="RFC9462"/>.
Since the Gateway and Target Resources for discovered oblivious services
need to be on the same host, this means that the client needs to verify
that the certificate presented by the gateway passes the required checks.
These checks can be performed when looking up the configuration on the gateway
as described in <xref target="config-fetch"/> and can be done either directly
or via the relay or another proxy to avoid exposing client IP addresses.</t>
          <t>Opportunistic Discovery <xref target="RFC9462"/>, where only the IP address is validated,
<bcp14>SHOULD NOT</bcp14> be used in general with Oblivious HTTP, since this mode
primarily exists to support resolvers that use private or local IP
addresses, which will usually not be accessible when using a
relay. If a configuration occurs where the resolver is accessible but
cannot use certificate-based validation, the client <bcp14>MUST</bcp14> ensure
that the relay only accesses the gateway and target using
the unencrypted resolver's original IP address.</t>
          <t>For the case of DoH recursive resolvers, clients also need to ensure that they are not
being targeted with unique DoH paths that would reveal their identity. See
<xref target="security"/> for more discussion.</t>
        </section>
        <section anchor="dnr">
          <name>Use with DNR</name>
          <t>The SvcParamKey defined in this document also can be used with Discovery
of Network-designated Resolvers <xref target="RFC9463"/>. In this
case, the oblivious configuration and path parameters can be included
in DHCP and Router Advertisement messages.</t>
          <t>While DNR does not require the same kind of verification as DDR, clients
that learn about DoH recursive resolvers still need to ensure that they are not being
targeted with unique DoH paths that would reveal their identity. See <xref target="security"/>
for more discussion.</t>
        </section>
      </section>
    </section>
    <section anchor="gateway-location">
      <name>Gateway Location</name>
      <t>Once a client has discovered that a service supports Oblivious HTTP
via the "ohttp" parameter in a SVCB or HTTPS RR, it needs to be
able to send requests via a relay to the correct gateway location.</t>
      <t>This document defines a well-known resource <xref target="RFC8615"/>,
"/.well-known/ohttp-gateway", which is an Oblivious Gateway Resource
available on the same host as the Target Resource.</t>
      <t>Some servers might not want to operate the gateway on a well-known URI.
In such cases, these servers can use 3xx (Redirection) responses
(<xref section="15.4" sectionFormat="of" target="RFC9110"/>) to direct clients and relays to the correct
location of the gateway. Such redirects would apply to both (1)&nbsp;requests
made to fetch key configurations (as defined in <xref target="config-fetch"/>) and
(2)&nbsp;encapsulated requests made via a relay.</t>
      <t>If a client receives a redirect when fetching the key configuration from the
well-known Gateway Resource, it <bcp14>MUST NOT</bcp14> communicate the redirected
gateway URI to the relay as the location of the gateway to use.
Doing so would allow the gateway to target clients by encoding
unique or client-identifying values in the redirected URI. Instead,
relays being used with dynamically discovered gateways <bcp14>MUST</bcp14> use the
well-known Gateway Resource and follow any redirects independently of
redirects that clients received. The relay can remember such redirects
across oblivious requests for all clients in order to avoid added latency.</t>
    </section>
    <section anchor="config-fetch">
      <name>Key Configuration Fetching</name>
      <t>Clients also need to know the key configuration of a gateway before encapsulating
and sending requests to the relay.</t>
      <t>If a client fetches the key configuration directly from the gateway, it
will expose identifiers like a client IP address to the gateway. The
privacy and security implications of fetching the key configuration are
discussed more in <xref target="security"/>. Clients can use an HTTP proxy to
hide their IP addresses when fetching key configurations. Clients can
also perform consistency checks to validate that they are not receiving
unique key configurations, as discussed in <xref target="consistency"/>.</t>
      <t>In order to fetch the key configuration of a gateway discovered
in the manner described in <xref target="gateway-location"/>, the client issues a GET request
(either through a proxy or directly) to the URI of the gateway specifying
the "application/ohttp-keys" media type <xref target="RFC9458"/> in the Accept header.</t>
      <t>For example, if the client knows an Oblivious Gateway URI,
https://svc.example.com/.well-known/ohttp-gateway, it could fetch the
key configuration with the following request:</t>
      <artwork><![CDATA[
GET /.well-known/ohttp-gateway HTTP/1.1
Host: svc.example.com
Accept: application/ohttp-keys
]]></artwork>
      <t>Gateways that coordinate with targets that advertise Oblivious HTTP
support <bcp14>SHOULD</bcp14> support GET requests for their key configuration in this
manner, unless there is another out-of-band configuration model that is
usable by clients. Gateways respond with their key configuration in the
response body, with a content type of "application/ohttp-keys".</t>
    </section>
    <section anchor="security">
      <name>Security and Privacy Considerations</name>
      <t>Attackers on a network can remove SVCB information from cleartext DNS
answers that are not protected by DNSSEC <xref target="RFC4033"/>. This
can effectively downgrade clients. However, since SVCB indications
for Oblivious HTTP support are just hints, a client can mitigate this by
always checking for a gateway configuration (<xref target="config-fetch"/>)
on the well-known gateway location (<xref target="gateway-location"/>).
Using encrypted DNS along with DNSSEC can also provide such a mitigation.</t>
      <t>When clients fetch a gateway's configuration (<xref target="config-fetch"/>),
they can expose their identity in the form of an IP address if they do not
connect via a proxy or some other IP-hiding mechanism. In some circumstances,
this might not be a privacy concern, since revealing that a particular
client IP address is preparing to use an Oblivious HTTP service can be
expected. However, if a client is otherwise trying to hide its IP
address or location (and not merely decouple its specific requests from its
IP address), or if revealing its IP address facilitates key targeting attacks
(if a gateway service uses IP addresses to associate specific configurations
with specific clients), a proxy or similar mechanism can be used to fetch
the gateway's configuration.</t>
      <t>When discovering designated oblivious DoH recursive resolvers using this mechanism,
clients need to ensure that the designation is trusted in lieu of
being able to directly check the contents of the gateway server's TLS
certificate. See <xref target="ddr"/> for more discussion, as well as Section&nbsp;<xref target="RFC9461" section="8" 
sectionFormat="bare">"Security Considerations"</xref> of <xref target="RFC9461"/>.</t>
      <section anchor="consistency">
        <name>Key Targeting Attacks</name>
        <t>As discussed in <xref target="RFC9458"/>, client requests using Oblivious HTTP
can only be linked by recognizing the key configuration. In order to
prevent unwanted linkability and tracking, clients using any key
configuration discovery mechanism need to be concerned with attacks
that target a specific user or population with a unique key configuration.</t>
        <t>There are several approaches clients can use to mitigate key targeting
attacks. <xref target="I-D.ietf-privacypass-key-consistency"/> provides an overview
of the options for ensuring that the key configurations are consistent between
different clients. Clients <bcp14>SHOULD</bcp14> employ some technique to mitigate key
targeting attacks, such as the option of confirming the key with a shared
proxy as described in <xref target="I-D.ietf-privacypass-key-consistency"/>. If a client detects that a gateway
is using per-client targeted key configuration, the client can stop using
the gateway and, potentially, report the targeting attack so that other
clients can avoid using this gateway in the future.</t>
      </section>
      <section anchor="dohpath-targeting-attacks">
        <name>dohpath Targeting Attacks</name>
        <t>For oblivious DoH servers, an attacker could use unique <tt>"dohpath"</tt> values
to target or identify specific clients. This attack is very similar to
the generic OHTTP key targeting attack described above.</t>
        <t>A client can avoid these targeting attacks by only allowing a single
<tt>"dohpath"</tt> value, such as the commonly used "/dns-query{?dns}" or
another pre-known value. If the client allows arbitrary <tt>"dohpath"</tt>
values, it <bcp14>SHOULD</bcp14> mitigate targeting attacks with a consistency check,
such as using one of the mechanisms described in <xref target="I-D.ietf-privacypass-key-consistency"/> to validate the
<tt>"dohpath"</tt> value with another source. Clients might choose to only
employ a consistency check on a percentage of discovery events,
depending on the capacity of consistency check options and their
deployment threat model.</t>
      </section>
    </section>
    <section anchor="iana">
      <name>IANA Considerations</name>
      <section anchor="svcb-service-parameter">
        <name>SVCB Service Parameter</name>
        <t>This document adds the following entry to the "Service Parameter Keys (SvcParamKeys)" registry <xref target="RFC9460"/>. This parameter is defined in <xref target="svc-param"/>.</t>

        <table>
          <thead>
            <tr>
              <th align="left">Number</th>
              <th align="left">Name</th>
              <th align="left">Meaning</th>
	      <th align="left"> Change Controller</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">8</td>
              <td align="left">ohttp</td>
              <td align="left">Denotes that a service operates an Oblivious HTTP target</td>
	      <td align="left">IETF</td>
              <td align="left">RFC 9540, <xref target="svc-param"/></td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="well-known-uri">
        <name>Well-Known URI</name>
        <t>IANA has added one entry in the "Well-Known URIs" registry <xref target="RFC8615"/>.</t>
    <dl newline="false">
        <dt>URI Suffix:</dt><dd>ohttp-gateway</dd>
        <dt>Change Controller:</dt><dd>IETF</dd>
        <dt>Reference:</dt><dd>RFC 9540</dd>
        <dt>Status:</dt><dd>permanent</dd>
        <dt>Related Information:</dt><dd>N/A</dd>
    </dl>
      </section>
    </section>
  </middle>
  <back>

<displayreference target="RFC9458" to="OHTTP"/>
<displayreference target="RFC9462" to="DDR"/>
<displayreference target="RFC9463" to="DNR"/>
<displayreference target="RFC9460" to="SVCB"/>
<displayreference target="RFC8615" to="WELLKNOWN"/>
<displayreference target="RFC9461" to="DNS-SVCB"/>
<displayreference target="RFC9292" to="BINARY-HTTP"/>
<displayreference target="RFC8484" to="DOH"/>
<displayreference target="RFC9110" to="HTTP"/>
<displayreference target="RFC4033" to="DNSSEC"/>
<displayreference target="I-D.ietf-privacypass-key-consistency" to="CONSISTENCY"/>

    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>

<!-- draft-ietf-ohai-ohttp (RFC 9458: published) -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9458.xml"/>	

<!-- draft-ietf-add-ddr (RFC 9462; published) -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9462.xml"/>

<!-- draft-ietf-add-dnr (RFC 9463; published) -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9463.xml"/>
	  
<!-- draft-ietf-dnsop-svcb-https (RFC 9460; published) -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9460.xml"/>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8615.xml"/>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>

<!-- draft-ietf-add-svcb-dns (RFC 9461; published) -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9461.xml"/>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9292.xml"/>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8484.xml"/>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>

      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>

<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"/>

<!-- draft-ietf-privacypass-key-consistency (Expired) -->
<xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-privacypass-key-consistency.xml"/>

      </references>
    </references>
  </back>
</rfc>
