<?xml version="1.0" encoding="utf-8"?>
<!-- 
     draft-rfcxml-general-template-standard-00
  
     This template includes examples of the most commonly used features of RFCXML with comments 
     explaining how to customise them. This template can be quickly turned into an I-D by editing 
     the examples provided. Look for [REPLACE], [REPLACE/DELETE], [CHECK] and edit accordingly.
     Note - 'DELETE' means delete the element or attribute, not just the contents.
     
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE 
rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-adell-client-roaming-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- [REPLACE] 
       * docName with name of your draft
     [CHECK] 
       * category should be one of std, bcp, info, exp, historic
       * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
       * updates can be an RFC number as NNNN
       * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title>Client Roaming Control</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-adell-client-roaming-00"/>
   
    <author fullname="Eugene Adell" initials="E.">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <address>
        <email>eugene.adell@gmail.com</email>  
      </address>
    </author>
   
    <date year="2022"/>
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->

    <keyword>DNS</keyword>
    <keyword>client</keyword>
    <keyword>roaming</keyword>
    <keyword>CRC</keyword>
    <keyword>CRS</keyword>
    <keyword>authentication</keyword>
    <keyword>authorization</keyword>
    <keyword>white-list</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>This document describes the Client Roaming Control (CRC) technique to allow an organization to control the access to third-party applications over Internet. It specifies the _crc Global Underscored Node Name for organizations willing to implement this technique. A new Client Roaming Support (CRS) Resource Record is also introduced for the applications supporting an authorization mechanism honoring the CRC, in order to inform of this support.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>Illegitimate access to professional restricted applications over Internet is a permanent threat for organizations and their staff. Different methods can be used to impersonate a user access, and in some cases an organization also wants to better prevent its own staff to access a third-party application from a network which is not under its control. On the contrary, an organization maybe wants to allow roaming then its users can access from different known places.</t>
	  <t>Associated to the Address Prefixes Lists (APL) [RFC3123] Resource Record (RR), the _crc global underscored node name acts a White-List and informs a compatible application from which networks its users are allowed to connect, be it a limited list of networks or broadly without any restriction.</t>
	  <t>At the application level, the identification of the user's organization domain can be based on an information carried during the authentication process, or a lookup on an information already known by the application. In both cases this information lets the application relate the user to its organization unequivocally.<br/>Finally, the corresponding user's domain DNS will be requested with the application's FQDN and port, and the application will know whether an authorization is expected or not. The precise syntax of this request and some examples are given in this document.</t>
	  <t>The applications implementing this authorization control let the client organizations know this feature is available by using the Client Roaming Support (CRS) RR. The data associated with this record indicates if the client's organization expected support of the CRC is mandatory, optional, or ignored. This information stored in the CRS can be confirmed at the application level by a redundant data. The way the application handles the authorization mechanism, by consulting the associated CRS record in real-time or relying on a configuration file, is left to the implementor.</t>
	  <t>Although this mechanism is designed for improving the security between different organizations, there is no objection to use it for a same organization playing both roles of client and application , as an alternative or additional layer to a solution already in place, such as a firewall for example.</t>
    </section>
    <section>
		<name>Conventions Used in This Document</name>
		<t>This specification uses definitions from Domain Name System <xref target="RFC1035"/>, and readers unfamiliar with it can also check DNS Terminology <xref target="RFC8499"/>.</t>
        <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>
      <!-- [CHECK] The 'Requirements Language' section is optional -->

    
    <section>
      <name>The CRC Global Underscored Node Name</name>
      <t>The _crc Node Name (NN) purpose is to provide a list of IP ranges authorized to use a particular application. The APL RR being designed to store lists of address prefixes, it is used here in association with the _crc NN.</t>

	  <section>
		<name>APL Applicability Statement</name>
		<t>Using the APL RR requires to define the precise behavior for ordinary and particular syntaxes. Acting as a White-List, the following characteristics MUST be implemented for interpreting correctly the CRC value :</t>
	    <ul>
          <li>multiple RRSets are allowed, and the expected meaning is an union of all their prefixes</li>
		  <li>both address families 1 and 2 MUST be supported</li>
		  <li>mixing different address families in the same record is NOT RECOMMENDED</li>
          <li>an empty RR is allowed but NOT RECOMMENDED</li>
          <li>the negated expression "!" has no meaning and is NOT RECOMMENDED, if used at all it MUST be ignored by applications</li>
        </ul>
	  </section>
	  <section>
		<name>Leaf Node Name construction</name>
		<t>The leaf node name is built by concatenating the application domain name, its listening port expressed as a subordinate underscored node name, and the CRC global underscored node name.</t>
		<t>For example, the FTP application hosted on ftp.example.com and listening on port 21 will be associated with this leaf :<br/>ftp.example.com._21._crc</t>
	  </section>
    </section>
	<section>
      <name>The CRS Resource Record</name>
	  <t>The CRS RR indicates which control is done on the client organizations, and thus which ones are authorized. A requirement field is used for this purpose, it has one of the following values and meanings when the checking is performed :</t>
	    <ul>
          <li>"N" : Never, all organizations are authorized</li>
          <li>"A" : Always, only organizations with a CRC are authorized</li>
          <li>"O" : Optional, any organization CRC is honored, other organizations are authorized</li>
        </ul>
	  <t>In addition to this value, an optional list of ports can be given. Indeed, multiple applications can be hosted on different ports under the same domain name, and an equivalent support was described for the CRC NN. In case of different requirement values, it is RECOMMENDED to have one dedicated RR for each although one single RR with all the information is supported. One particular port MUST NOT appear in more than one RR. When no port is mentioned, only one RR MAY be declared and its requirement value covers all applications for this domain name.</t>
	  <t>In the absence of such record, no roaming control is to be expected by the client, any of its CRC NNs will be ignored. It is equivalent to a CRS requirement value "N" indicating no control is performed.</t>

	  <section>
		<name>CRS RDATA Wire Format</name>
		<t>The CRS RDATA wire format is encoded as follows:</t>
		<sourcecode><![CDATA[
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    /                     CRS                       /
    /                                               /
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+]]>
		</sourcecode>
		<t>The CRS field contains a list of requirements followed by their respective optional ports.</t>
	  </section>
	  <section>
		<name>CRS Presentation Format</name>
		<t>The presentation format of the CRS record is:<br/>
		<br/>CRS (single-rule / multiple-rules)<br/>
		<br/>single-rule = "R=" ("N" / "A" / "O") *(,port)<br/>
		<br/>multiple-rules = unit-rule 1*2(;unit-rule)<br/>
		<br/>unit-rule = "R=" ("N" / "A" / "O") 1*(,port)<br/>
		<br/>port = [1-9] *([DIGIT])
		</t>
		</section>
    </section>

	<section>
      <name>Examples</name>
	  <t>The following examples show some typical uses expected from this documentation. Particularly, the intended behaviors for different CRC and CRS values are explained, while the user identification is done directly through carried data or a deduction process.</t>
	  <section>
		<name>Restricted Application</name>
		<t>In this example, an application is only opened to organizations publishing their respective allowed networks. The requirement value of the CRS record equals "A", and any organization with an empty or missing CRC for this application will be denied access.</t>
		<t>The ftp.example.com domain is dedicated to hosting an FTP application, which extracts the client's domain from the username used during the authentication process. This information is then used for requesting the client APL record and finally comparing its content with the client's IP. The client organization example.net allows its users from its own network 192.0.2.0/24 and from a cloud service located at 198.51.100.0/24. A second organization example.org has no APL record and its users are rejected.</t>
		<t>Application FQDN : ftp.example.com<br/>Application CRS record : ftp.example.com. IN CRS R=A,21</t>
		<t>Client FQDN : example.net<br/>Client organization APL record : ftp.example.com._21._crc.example.net. IN APL 1:192.0.2.0/24 1:198.51.100.0/24</t>
		<t>Client FQDN : example.org<br/>No client organization APL record</t>
		<sourcecode><![CDATA[
Client DNS  Client FTP                Server FTP

                  FTP USER me@example.net
            ----------------------------->
                         ...
                  FTP PASS ********
            ----------------------------->
       Query : APL ftp.example.com._21._crc.example.net
     <------------------------------------
       Answer : APL ftp.example.com._21._crc.example.net 1:192.0.2.0/24 1:198.51.100.0/24
     ------------------------------------>
                  FTP 230
           <------------------------------


                  FTP USER me@example.org
            ----------------------------->
                         ...
                  FTP PASS ********
            ----------------------------->
       Query : APL ftp.example.com._21._crc.example.org
     <------------------------------------
       Answer : No such name (3)
     ------------------------------------>
                  FTP 430
           <------------------------------
		]]></sourcecode>
	  </section>
	  <section>
		<name>Controlled Application</name>
		<t>The www.example.com domain hosts a Web application on port 443 using client certificates for authenticating its users. The application extracts the client domains from the certificates, which are used to retrieve their APL records. Users from the example.net organization are allowed only if they connect from an authorized network listed in the APL record, while users from example.org are always granted access since this one has no APL declared.</t>
		<t>Application FQDN : www.example.com<br/>Application CRS record : www.example.com. IN CRS R=O,443</t>
		<t>Client FQDN : example.net<br/>Client organization APL record : www.example.com._443._crc.example.net. IN APL 1:192.0.2.0/24 1:198.51.100.0/24</t>
		<t>Client FQDN : example.org<br/>No client organization APL record</t>
		<sourcecode><![CDATA[
Client DNS  Client browser                Web application


                          .....
              Client certificate me@example.net
            ----------------------------------->
       Query : APL www.example.com._443._crc.example.net
     <------------------------------------------
       Answer : APL www.example.com._443._crc.example.net 1:192.0.2.0/24 1:198.51.100.0/24
     ------------------------------------------>
                          .....
                  200 OK
            <-----------------------------------


                          .....
              Client certificate me@example.org
            ----------------------------------->
       Query : APL www.example.com._443._crc.example.org
     <------------------------------------------
       Answer : No such name (3)
     ------------------------------------------>
                          .....
                  200 OK
            <-----------------------------------
		]]></sourcecode>
	  </section>
	  <section>
		<name>Opened Application</name>
		<t>A company is testing the CRC and CRS behaviors before opening a new service to its customers. Its first test described below consists in configuring both sides to be completely opened, likely before hardening the CRS, then the APL, and testing again.</t>
		<t>The application.example.com domain hosts a Web application on port 443 where users are logged in by sending a numerical identifier and a password. The application uses a dictionary data type to identify the user's domain. The client.example.net domain is temporarily using 2 APL records (one for each IP version) indicating a free access from anywhere.</t>
		<t>Application FQDN : application.example.com<br/>Application CRS record : application.example.com. IN CRS R=N,443</t>
		<t>Client FQDN : client.example.net<br/>Client organization APL records : application.example.com._443._crc.example.net. IN APL 1:0.0.0.0/24<br/>application.example.com._443._crc.example.net. IN APL 2:fe80::/10</t>
		<sourcecode><![CDATA[
Client DNS  Client browser                Web application


                          .....
              HTTP POST 123456/******
            ----------------------------------->
                  200 OK
            <-----------------------------------
		]]></sourcecode>
	  </section>
	</section>

    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
      <name>IANA Considerations</name>
	  <t>According to Guidelines for Writing an IANA Considerations Section in RFCs [RFC8126] it is asked to IANA to add into the Resource Record (RR) TYPEs registry located at https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4 this CRS entry.</t>
	  <table>
		<thead>
			<tr>
				<td>TYPE</td>
				<td>Value</td>
				<td>Description</td>
				<td>Reference</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>CRS</td>
				<td>TBD1</td>
				<td>Client Roaming Support</td>
				<td>this RFC</td>
			</tr>
		</tbody>
	  </table>
	  <t>It is also asked to IANA to add into the Underscored and Globally Scoped DNS Node Names registry located at https://www.iana.org/assignments/dns-parameters/dns-parameters.xml#underscored-globally-scoped-dns-node-names this CRC entry</t>
	  <table>
		<thead>
			<tr>
				<td>RR TYPE</td>
				<td>_NODE NAME</td>
				<td>Reference</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>APL</td>
				<td>_crc</td>
				<td>this RFC</td>
			</tr>
		</tbody>
	  </table>

    </section>
    
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>This section is meant to inform developers and users of the security implications of the CRC/CRS mechanism described by this document. While the CRS RR mostly plays an informative role, the CRC Node Name delivers important data which requires attention from the developers and administrators. Some particular points are discussed here.</t>
		<section>
			<name>DNS Security</name>
			<t>Client and application administrators are encouraged to take care of their DNS infrastructure and operation management. In particular, the client DNS becoming unavailable or unresponsive could in turn make the application unavailable. The restricted and controlled scenarios are expected to just bring down the application in such case, and not disable the authorization turning things into an open scenario.</t>
			<t>As the CRC node names are supposed to be requested during an application authentication process, reflection attacks could be built to target a client organization, even one not hosting any CRC entry at all.<br/>In a general manner, administrators may consider an adequate TTL setting to be resilient to short time DNS unavailability and to not overload client organizations, enable TCP as the preferred transport, and rely on DNSSEC to warrant data authenticity and integrity.</t>
		</section>
		<section>
			<name>DNS misconfiguration</name>
			<t>Any DNS CRS misconfiguration such as multiple records with different requirement values but with the same port value can get a client confused. In this case the client does not know without testing the actual configuration, if its organization is protected against roaming, and contacting the application administrator to fix the situation is a possibility.</t>
			<t>While CRC misconfigurations are leading to more or less serious security problems, administrators need to pay attention when dealing with multiple networks or records. Particularly, multiple records for the same network range or overlapping networks should be avoided.</t>
		</section>
		<section>
			<name>Application Security</name>
			<t>The following points are of concern to developers:</t>
			<t>Encryption:<br/>Whenever possible, the application protocol should be encrypted to prevent eavesdropping and man-in-the-middle attacks. It is a critical point for applications maintaining a user session with anything like a token or cookie, as it can lead to session hijacking as discussed below.</t>
			<t>Timing attack:<br/>All authentication systems need to be careful to not deliver any information derived from the computing time to a denied user, even the ones involving multiple factors or steps like the one described in this document. In particular, the order in which these steps are executed and their respective implementations, need to defeat statistical hypotheses.</t>
			<t>Intermediate systems:<br/>Some applications are not directly Internet facing and cannot access to the real client's IP address without involving a mechanism to forward this IP at the application layer. For example with HTTP, the common practice based on the non-standard X-Forwarded-For header, or its alternative standard Forwarded <xref target="RFC7239"/>, are playing this role. Such practice requires a correct sanitizing of user data to avoid false injected IPs.</t>
			<t>Session hijacking:<br/>A well-known attack called Session Hijacking is not meant to be defeated by this document alone. Application developers must ensure that any receveid session token, such as an HTTP Cookie, belongs to the same IP address than the one which started this session.</t>
		</section>
    </section>
    
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.1035.xml"/>
        <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"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8552.xml"/>
        <!-- The recommended and simplest way to include a well known reference -->
        
      </references>
 
      <references>
        <name>Informative References</name>

        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7239.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8499.xml"/>

      </references>
    </references>
    
 </back>
</rfc>
