<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>


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

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-madeleine-explicit-domains-relations-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="Explicit relationship between domains">Explicit bilateral relationship between domains</title>

    <seriesInfo name="Internet-Draft" value="draft-madeleine-explicit-domains-relations-00" />

    <author fullname="Yann Madeleine" initials="Y" role="editor" surname="Madeleine">
      <address>
        <email>contact@yann-madeleine.com</email>
      </address>
    </author>

    <date year="2022" />

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>Domains relationship</keyword>
    <keyword>User trust</keyword>
    <keyword>http headers</keyword>

    <abstract>
      <t>Good practices of domain handling are often overseen, making it difficult for users to know if a 
        domain is legitimate, this proposal aims to create an easy, accessible way to verify relations between domains and by extension entities.
      </t>
    </abstract>

  </front>

  <middle>
    <section>
      <name>Introduction</name>
      <t>Domains are a common vector of attack, this is due in partly to the non comprehension of what a URL is, but also due to the lack of good domain
        handling. </t>
      <t>Mastercard for example uses mastercard.com as a global entry, mastercardcontentexchange.com for newsroom, mastercardservices.com for services.</t>


      <t> National Bank of Canada (one of Canada's biggest banks) uses bnc.ca, nbc.ca, banquenationale.com, bncd.ca, nbdb.ca, nbfwm.ca, fbngp.ca, bntmaretraite.com, nbfm.ca, bnmf.ca, assurances-bnc.ca,
        nbc-insurance.ca depending of the language and the offer.</t>

      <t>Equifax uses equifaxbreachsettlement.com for the settlement of its data breach and that domain has been infamously squatted.</t>


      <t> How can we legitimately hope that a normal user can tell apart a domain like bncd.ca and bnc.bank or spot a variation in a domain like equifaxbreachsettlement.com ?
        As it's nearly impossible to create a system that insures who owns what domains, and as hoping for correct domain handling is day dreaming.
        This draft will try to actually create explicit links between domains allowing browser vendors to give the user information that will help them
        defining if a domain is actually related to a trusted domain.
      </t>

      <section>
        <name>Requirements Language</name>
        <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 BCP 14
          <xref target="RFC2119" />
          <xref target="RFC8174" />
          when, and only when, they appear in
          all capitals, as shown here.
        </t>
      </section>

    </section>

    <section>
      <name>Definition</name>
      <t>To help tackle the domains relation in a way that is standard fair to small and big player and non government related, this draft proposes to use
        a new dedicated http header to establish the relation. This header will be set on both the claiming domain and the trusty domain.
      The new header MUST only be available on secured connections (https) to mitigate their alteration by an adverse party, they also MUST be non accessible/forbidden
      to javascript or fetch.</t>

      <t>The header is of the following form</t>
      <t>REL: RELATION; DOMAIN</t>
      <ul spacing="normal">
        <li>rel: own; https:www.equifaxbreachsettlement.com</li>
        <li>rel: claim; https://equifax.com</li>
      </ul>

      <t>Only one REL header with a claim relation should be present in a response, multiple REL headers with non claim relation can be sent with a response.
      Each REL header should define only one relation to a domain, subdomain or subdirectory.
      The claiming relation MUST use the claim relation, the trusty can use one of the defined relations:
        </t>
      <dl newline="true">
        <dt>own</dt>
        <dd>The related domain is entirely owned and operated by the same entity as the domain exposing the relation</dd>
        <dt>delegate</dt>
        <dd>The related domain or subdomain is handled by an entity to which the owner of the exposing domain as delegated the rights to operate under its name, for example a support platform</dd>
        <dt>operate</dt>
        <dd>The related domain/subdomain/subdirectory is owned by a third party, but operated by the owner of the domain exposing the relation, this is usually the case for a social profile</dd>
      </dl>
    </section>
    <section>
      <name>Validity</name>
      <t>
      All relationships MUST be direct if a transitive relation is found it should be ignored so A &lt;---> B is OK but A &lt;---> B &lt;----> C will only expose the relation between A and B
      This will both avoid some circular relationships and mitigate the use of a compromised trusted intermediate to fake a relation.</t>


      <ul spacing="normal">
        <li> All relationships MUST be sent in non redirected responses, every 3XX HTTP responses MUST be resolved before interpreting the REL header.</li>

        <li>All relationships MUST be exposed on HEAD, GET and OPTIONS methods and SHOULD be exposed on the other HTTP methods.</li>

        <li>A relation is valid for the domain/subdomain/subdirectory depending on the type of relation and the expressed domain</li>
      </ul>
      <t>The claim relation MUST be on a domain with no subdomain, the request will then be resolved to the main subdomain for the domain, this prevents the use of a delegated subdomain into a claim.
      For example www.badactor.test can not claim actor.supportplatform.test as it would imply a relation to supportplatform if that platform was allowing its users to add some headers on their pages
      </t>
      <section>
        <name>Owning relations</name>
        <t>
            An owning relation can only be linked to a full domain, and therefore the domain definition MUST be of the type REL: own; https:*.DOMAIN.TLD so every subdomains, every subdirectory of DOMAIN.TLD should 
            be considered as owned by the same entity as the domain exposing the relation.
        </t>

        <table>
          <thead>
            <tr>
              <th colspan="2">rel: own; https://*.domain.tld</th>
            </tr>
            <tr>
              <th>URI</th>
              <th>Valid</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>https://www.domain.tld</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://domain.tld</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://domain.tld/dir</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.sub.domain.tld</td>
              <td>TRUE</td>
            </tr>
          </tbody>
        </table>

      </section>

      <section>
        <name>Delegated relations</name>
        <t>
              A delegated relation can only be linked to a full domain or a subdomain, and therefore the domain definition MUST be one of 
          </t>
        <ul spacing="normal">
          <li>REL: delegate; https://*.DOMAIN.TLD so every subdomains, every subdirectories of DOMAIN.TLD should be considered as owned by the same entity as the domain exposing the relation.</li>
          <li>REL: delegate; https://DOMAIN.TLD no subdomain but every subdirectories of DOMAIN.TLD should be considered as owned by the same entity as the domain exposing the relation.</li>
          <li>REL: delegate; https://SUB.DOMAIN.TLD only the subdomain SUB and its subdirectories are considered as owned by a trusted third party</li>
        </ul>

        <table>
          <thead>
            <tr>
              <th colspan="2">rel: delegate; https://sub.domain.tld</th>
            </tr>
            <tr>
              <th>URI</th>
              <th>Valid</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>https://www.domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://domain.tld/dir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.sub.domain.tld</td>
              <td>FALSE</td>
            </tr>
          </tbody>
        </table>

        <table>
          <thead>
            <tr>
              <th colspan="2">rel: delegate; https://domain.tld</th>
            </tr>
            <tr>
              <th>URI</th>
              <th>Valid</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>https://www.domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld/dir</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.sub.domain.tld</td>
              <td>FALSE</td>
            </tr>
          </tbody>
        </table>
      </section>


      <section>
        <name>Operated relations</name>
        <t>
                An operated relation can only be linked to a domain a subdomain or subdirectory, and therefore the domain definition MUST be one of 
            </t>
        <ul spacing="normal">
          <li>REL: operate; https://*.DOMAIN.TLD so every subdomains, every subdirectories of DOMAIN.TLD should be considered as owned by the same entity as the domain exposing the relation.</li>
          <li>REL: operate; https://DOMAIN.TLD no subdomain but every subdirectories of DOMAIN.TLD should be considered as owned a trusted third party.</li>
          <li>REL: operate; https://SUB.DOMAIN.TLD only the subdomain SUB and its subdirectories are considered as owned by a trusted third party.</li>
          <li>REL: operate; https://SUB.DOMAIN.TLD/DIR/SUBDIR only the subdirectory SUB/SUBDIRECTORY found under SUB.DOMAIN.TLD/ and its subdirectories are considered as owned by a third party but operated by the trusted entity.</li>
        </ul>
        <table>
          <thead>
            <tr>
              <th colspan="2">rel: operate; https://sub.domain.tld/directory/subdirectory</th>
            </tr>
            <tr>
              <th>URI</th>
              <th>Valid</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>https://www.domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld/dir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.sub.domain.tld/dir/subdir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://domain.tld/dir/subdir</td>
              <td>FALSE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir/subdir</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir/subdir/leaf.html</td>
              <td>TRUE</td>
            </tr>
            <tr>
              <td>https://sub.domain.tld/dir/subdir/lastdir</td>
              <td>TRUE</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section>
      <name>Caching, duration and revocation.</name>
      <t>
The REL header MAY be cached for the duration of a session but SHOULD NOT be cached for a longer time, this will make sure the relation between the 2 domains is always relevant and 
allow for fast response in case of exploit on one of the domains.
The revocation of a relation can be unilateral by any of the domains and is just a matter of not sending the header.
      </t>
    </section>

    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This memo includes no request to IANA.</t>
    </section>

    <section anchor="Security">
      <name>Security Considerations</name>
      <t>This document should not affect the security of the Internet.</t>
    </section>

  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml" />
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml" />
        <!-- The recommended and simplest way to include a well known reference -->

      </references>
    </references>

    <section anchor="Contributors" numbered="false">
      <name>Contributors</name>
      <t>Thanks to all of the contributors.</t>
      <contact fullname="Guillaume Metayer" initials="G" surname="Metayer"></contact>
    </section>
  </back>
</rfc>