<?xml version='1.0' encoding='utf-8'?>
<!-- -*- indent-with-tabs: 0 -*- -->
<?xml-model href="rfc7991bis.rnc"?>
<!-- <?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;">
]>
<rfc docName="draft-ietf-opsawg-tacacs-tls13-04"
     category="std"
     ipr="trust200902"
     submissionType='IETF'
     consensus="true"
     updates="RFC8907"
     xmlns:xi="http://www.w3.org/2001/XInclude" version="3"
     sortRefs="true"
     indexInclude="false"
     tocDepth="3">


   <front>
     <title abbrev="TACACS+ TLS 1.3">
            TACACS+ TLS 1.3
     </title>
     <author fullname="Thorsten Dahm" initials="T." surname="Dahm">
       <address>
         <postal>
           <street></street>
           <code></code>
           <city></city>
           <country></country>
         </postal>
         <email>thorsten.dahm@gmail.com</email>
       </address>
     </author>

     <author fullname="Douglas Gash" initials="D." surname="Gash">
       <organization>Cisco Systems, Inc.</organization>
       <address>
         <postal>
           <street></street>
           <code></code>
           <city></city>
           <country></country>
         </postal>
         <email>dcmgash@cisco.com</email>
       </address>
     </author>

     <author fullname="Andrej Ota" initials="A." surname="Ota">
       <address>
         <postal>
           <street></street>
           <code></code>
           <city></city>
           <country></country>
         </postal>
         <email>andrej@ota.si</email>
       </address>
     </author>

     <author fullname="John Heasley" initials="J." surname="Heasley">
       <organization abbrev="NTT">NTT</organization>
       <address>
         <postal>
           <street></street>
           <code></code>
           <city></city>
           <country></country>
         </postal>
         <email>heas@shrubbery.net</email>
       </address>
     </author>

     <date />
     <area>Operations and Management Area (ops)</area>
     <workgroup>Operations and Management Area Working Group</workgroup>

     <keyword>TACACS+</keyword>

     <abstract>
     <t>
       The <xref target="RFC8907">TACACS+ Protocol</xref> provides device administration for routers, network access servers and other networked computing devices via one or more centralized servers.
       This document, a companion to the <xref target="RFC8907">TACACS+ protocol</xref>, adds Transport Layer Security (currently defined by <xref target="RFC8446">TLS 1.3</xref>) support and obsoletes former inferior security mechanisms.
     </t>
     </abstract>
     <note title="Requirements Language">
       <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 <xref target="BCP14"/> when, and only when, they appear in all capitals, as shown here.
       </t>
     </note>
   </front>

   <middle>
     <section title="Introduction">
       <t>
         The <xref target="RFC8907">TACACS+ Protocol</xref> provides device administration for routers, network access servers and other networked computing devices via one or more centralized servers.
         The protocol provides authentication, authorization and accounting services for TACACS+ clients.
       </t>
       <t>
	 While the content of the protocol is highly sensitive, TACACS+ lacks modern and/or effective confidentiality, integrity, and authentication of the connection and network traffic between the server and client.
	 The existing mechanisms of TACACS+ are extremely weak and the Security Considerations section of the <xref target="RFC8907">TACACS+ Protocol</xref> adequately describes this.
       </t>
       <t>
	 To address these deficiencies, this document updates the <xref target="RFC8907">TACACS+ Protocol</xref> to use <xref target="RFC8446">TLS 1.3</xref> authentication and encryption, and obsoletes the use of its former mechanisms.
       </t>
     </section>

     <section title="Technical Definitions">
       <t>
         The Technical Definitions section of the <xref target="RFC8907">TACACS+ Protocol</xref> is fully applicable here and will not be repeated.
         The following terms are also used in this document.
       </t>
       <section title="Obfuscation">
         <t>
           Inferior form of encryption used in TACACS+, referred to as obfuscation in <xref target="RFC8907" section="10.5.2" sectionFormat="comma"/> to indicate that it is not encryption and is utterly insufficient.
         </t>
       </section>
       <section title="Non-TLS Connection">
         <t>
           This is another term for a Connection as defined in <xref target="RFC8907">TACACS+ Protocol</xref>.
           It is a Connection without TLS and therefore being plaintext or possibly using unsecure TACACS+ authentication and obfuscation.
         </t>
       </section>
       <section title="TLS Connection">
         <t>
           A TLS Connection is a TCP/IP connection with TLS authentication and encryption used by TACACS+ for transport. The TLS Connection for TACACS+ is always between one Client and one Server as defined in <xref target="RFC8907">TACACS+ Protocol</xref>.
         </t>
       </section>
       <section title="TACACS+ Server">
         <t>
            In this document, we clarify that a TACACS+ Server is an instance of
            the Server as defined in <xref target="RFC8907" section="3.2" sectionFormat="comma"/> that
            responds to TACACS+ traffic on a specific port in a host, and does not
            refer to the host itself. A host may have multiple TACACS+ Servers
            installed, listening to different ports.
         </t>
       </section>
       <section title="Peer">
         <t>
           In the context of a TLS Connection, the peer of a TACACS+ Client is the Server, and the peer of a TACACS+ Server is the Client. Together, the ends of a TACACS+ Connection are referred as the peers.
         </t>
       </section>
     </section>

     <section title="TLS for TACACS+">
       <t>
         TACACS+ connections are TCP/IP connections initiated by the Client to the Server.
         The well-known TCP/IP port 49 on the Server is used for unobfuscated and obfuscated connections as defined in the <xref target="RFC8907">TACACS+ Protocol</xref>.
         A connection might be used for only a single Session or the multiplexing of multiple Sessions in TACACS+ Single Connection Mode.
       </t>
       <t>TLS is introduced into TACACS+ to fulfill the following requirements:
       </t>
       <ol>
       <li>Confidentiality and Integrity: The MD5 Obfuscation specified in the original protocol definition is not fit for purpose, requiring that TACACS+ be
       deployed over a secured network. Securing TACACS+ protocol with TLS is intended to provide confidentiality and integrity without requiring the provision of a secured network.</li>
       <li>Peer authentication: The  authentication capabilities of TLS replace the pre-shared keys of Obfuscation to authenticate Peers.</li>
       </ol>
       <section title="Well-Known TCP/IP Port" anchor="TLSPort">
         <t>
           All data exchanged by TACACS+ Peers MUST be encrypted, including the authentication of the Peers.
           Therefore, TLS Hello MUST be initiated by the client immediately upon the establishment of the TCP/IP connection.
         </t>
         <t>
           This document favors the predictable use of TLS security for a deployment, see (<xref target="wellknown"/>).
           TACACS+ TLS will therefore follow <xref target="RFC7605"/>, where a different well-known system TCP/IP port is assigned by IANA, port <xref target="ICTBD">[TBD]</xref> with the service name <xref target="ICTBD">[TBDN]</xref>, for TLS connections.
         </t>
         <t>
           TACACS+ TLS could use any other TCP port by operator configuration, though <xref target="wellknown"/> should still be considered.
         </t>
       </section>
       <section title="TLS Connection" anchor="TLSConn">
         <t>
           A TACACS+ Client initiates a TLS connection by making a TCP connection to a configured Server on the TACACS+ TLS well-known port ([TBD]) (<xref target="TLSPort"/>).
           Once the TCP connection is established, the Client MUST immediately begin the TLS negotiation before sending any TACACS+ protocol data.
         </t>
         <t>
	   Implementations MUST support <xref target="RFC8446">TLS 1.3</xref> and MAY permit TLS 1.3 session resumption.
	   If resumption is supported, the resumption ticket_lifetime SHOULD be configurable, including a zero seconds lifetime.
         </t>
         <t>
	   Once the TLS connection is established, the exchange of TACACS+ data proceeds as normal, except that it is transmitted over TLS as TLS application data and without TACACS+ obfuscation (see <xref target="ObsolescenceOfTACACSObfuscation"/>)
         </t>
         <t>
	   The connection persists until the Server or Client closes it.
	   It might be closed due to an error or at the conclusion of the TACACS+ Session.
	   If Single Connection Mode has been negotiated, it might remain open after a successful Session, until an error or an inactivity timeout occurs.
	   Why it closed has no bearing on TLS resumption, unless closed by a TLS error, in which case the ticket might be invalidated.
         </t>
       <section title="Cipher Requirements">
         <t>
	   Implementations MUST support the TLS 1.3 mandatory cipher suites (See <xref target="RFC8446">TLS 1.3</xref> Section 9.1).
	   The cipher suites offered or accepted SHOULD be configurable so that operators can adapt.
         </t>
         <t>
	   This document makes no cipher suite recommendations, but recommendations can be found in the TLS Cipher Suites section of the <xref target="TLSCSREC"/>.
         </t>
       </section>
       <section title="TLS Authentication">
         <t>
	  Implementations MUST support certificate-based TLS authentication and certificate revocation bi-directionally for authentication, identity verification and policy purposes.
          Certificate path verification as described in <xref target="CertPV"/> MUST be supported.
         </t>
         <t>
           If this succeeds, the authentication is successful and the connection is permitted.
           Policy MAY impose further constraints upon the Peer, allowing or denying the connection based on certificate fields or any other parameters exposed by the implementation.
         </t>
         <t>
	   Unless disabled by configuration, a Peer MUST disconnect a Peer that offers an invalid TLS Certificate.
         </t>
         <section title="TLS Certificate Path Verification" anchor="CertPV">
         <t>
           Implementations MUST support certificate Path verification as described in <xref target="RFC5280"/>.
         </t>
         <t>
           Because a Peer could be isolated from a remote Peer's Certificate Authority (CA), implementations MUST support certificate chains (aka. bundles or chains of trust), where the entire chain of the remote's certificate is stored on the local Peer.
         </t>
         </section>
       </section>
       </section>
       <section title="TLS Identification">
         <t>
           In addition to authentication of TLS certificates, implementations MUST support policy consideration of Peer-identifying certificate fields and policy used to verify that the Peer is a valid source for the received certificate and that it is permitted access to TACACS+.
           Implementations MUST support either:
	 </t>
	 <t>Network location based validation methods as described in <xref target="RFC5425" section="5.2" sectionFormat="comma"/>.
	 </t>
         <t>or</t>
         <t>
 	   Device Identity based validation methods where the peer’s identity is used in the certificate subjectName. This is applicable in deployments where the device securely supports an identity which is shared with its peer.
           This approach allows a peer's network location to be reconfigured without issuing a new client certificate.
           Only the local server mapping needs to be updated.
         </t>
         <t>
           Implementations SHOULD support the TLS Server Name Indication extension (<xref target="RFC6066" section="3" sectionFormat="comma"/>).
           Policy can be applied to this attribute and it can be useful for load balancing or multiplexing at the server.
         </t>
       </section>


       <section title="Application-Layer Protocol Negotiation" anchor="ALPN">
         <t>
              An ALPN number is registered for Secured TACACS+ <xref target="RFC7301"/>.
              Implementations MUST use it, in accordance to the guideleines in <xref target="RFC9325"/>
         </t>
       </section>
     </section>

     <section title="Obsolescence of TACACS+ Obfuscation" anchor="ObsolescenceOfTACACSObfuscation">
       <t>
         The original draft of TACACS+ described the Obfuscation mechanism, documented in <xref target="RFC5425" section="5.2" sectionFormat="comma"/>.
         It is insufficient for modern purposes.
       </t>
       <t>
         The introduction of TLS PSK, certificate Peer authentication, and TLS encryption to TACACS+ replaces these former mechanisms and so Obfuscation is hereby obsoleted.
         This section describes how the TACACS+ client and servers MUST operate with regards to the obfuscation mechanism.
       </t>
       <t>
         Peers MUST NOT use Obfuscation with TLS.
       </t>
       <t>
         A TACACS+ client initiating a TACACS+ TLS connection MUST set the TAC_PLUS_UNENCRYPTED_FLAG bit, thereby asserting that Obfuscation is not used for the Session.
         All subsequent packets MUST have the TAC_PLUS_UNENCRYPTED_FLAG set.
       </t>
       <t>
        A TACACS+ server that receives a packet with the TAC_PLUS_UNENCRYPTED_FLAG not set (cleared) over a TLS connection, MUST return an error of TAC_PLUS_AUTHEN_STATUS_ERROR, TAC_PLUS_AUTHOR_STATUS_ERROR, or TAC_PLUS_ACCT_STATUS_ERROR as appropriate for the TACACS+ message type, with the TAC_PLUS_UNENCRYPTED_FLAG set, and terminate the Session.
        This behavior corresponds to that defined in <xref target="RFC8907">RFC8907 Section 4.5. Data Obfuscation</xref> for TAC_PLUS_UNENCRYPTED_FLAG or key mismatches.
       </t>
       <t>
	A TACACS+ client that receives a packet with the TAC_PLUS_UNENCRYPTED_FLAG not set (cleared), MUST terminate the Session, and SHOULD log this error.
       </t>
     </section>

     <section title="Security Considerations" anchor="Security">
       <section title="TLS">
         <t>
           This document improves the confidentiality, integrity, and authentication of the connection and network traffic between TACACS+ Peers by adding TLS support.
         </t>
         <t>
             Simply adding TLS support to the protocol does not guarantee the protection
             of the server and clients. It is essential for the operators and equipment vendors
             to adhere to the latest best practices for ensuring the integrity of network devices
             and selecting secure TLS key and encryption algorithms.
         </t>
           <t>
            <xref target="RFC9325"/>. offers substantial guidance for implementing protocols that use
            TLS and their deployment. Those implementing and deploying Secure TACACS+
            must adhere to the recommendations relevant to TLS 1.3 outlined in <xref target="RFC9325"/>,
            or its subsequent versions.
           </t>
           <t>
           This document outlines additional restrictions permissible under <xref target="RFC9325"/>.
            For example, any recommendations referring to TLS 1.2, including the mandatory
            support, are not relevant for Secure TACACS+ as TLS 1.3 or above is mandated.
           </t>
         <section title="TLS Use" anchor="TLSUSE">
           <t>
               TLS encryption SHOULD be used in deployments where both the clients and servers
               support it. TACACS+ servers that have TLS support MUST NOT allow non-TLS connections
               from clients that do not support TLS, because of the threat of downgrade attacks,
               as described in Section 5.2. Instead, separate non-TLS TACACS+ servers
               can be set up to cater for these clients.
         </t>
         <t>
               Further, TLS TACACS+ Servers and non-TLS TACACS+ servers SHOULD NOT be deployed
               on the same host. Non-TLS Connections would be better served by deploying the
               required Non-TLS TACACS+ Servers on separate hosts.
           </t>

           <t>
             It is NOT RECOMMENDED to deploy TACACS+ without TLS authentication and encryption, including TLS using the NULL algorithm, except for within test and debug environments.
             Also see <xref target="RFC3365"/>.
           </t>
         </section>
         <section title="TLS 0-RTT">
           <t>
	     TLS 1.3 resumption and PSK techniques make it possible to send Early Data, aka. 0-RTT data, data that is sent before the TLS handshake completes.
	     Replay of this data is possible.
	     Given the sensitivity of TACACS+ data, a Client MUST NOT send data until the full TLS handshake completes; that is, Clients MUST NOT send 0-RTT data and Servers MAY abruptly disconnect Clients that do.
           </t>
         </section>
         <section title="TLS PSK">
           <t>
	     Implementations MAY support TLS authentication with Pre-Shared Keys (PSKs), also known as external PSKs in TLS 1.3, which are not resumption PSKs.
	     PSKs SHOULD NOT be shared among Clients or Servers to limit exposure of a compromised key and to ease key rotation.
	     Also see <xref target="RFC8773"/> and <xref target="I-D.ietf-tls-external-psk-guidance"/>.
           </t>
           <t>
	     PSKs are otherwise considered out-of-scope for this document.
           </t>
         </section>
         <section title="TLS Options">
           <t>
	     Implementors and operators SHOULD make use of the various RFCs to determine which TLS versions and algorithms should be supported, deprecated, obsoleted, or abandoned, in the absence of updates to this document.
	     </t>
             <t>Recommendations in <xref target="RFC9325"/> Section 4, or any RFCs which obsolete it, MUST be followed.</t>
         <t>
             Other useful examples are the TLS specifications themselves (<xref target="RFC8446">TLS 1.3</xref>), which prescribes mandatory support in Section 9, and TLS Recommendations <xref target="RFC7525"/>.
           </t>
         </section>
         <section title="Unreachable Certificate Authority (CA)" anchor="CAcache">
           <t>
	     Operators SHOULD be cognizant of the potential of Server and/or Client isolation from their Peer's CA by network failures.
	     Isolation from a public key certificate's CA will cause the verification of the certificate to fail and thus TLS authentication of the Peer to fail.
             Operators SHOULD consider loading certificate chains on devices and servers to avoid this failure.
           </t>
           <t>
	     Certificate caching and <xref target="RFC7250">Raw Public Keys</xref> are other methods to help address this, but both are out of scope for this document.
             Certificate fingerprints are another option.
           </t>
         </section>
         <section title="TLS Server Name Indicator (SNI)" anchor="TLSSNISec">
           <t>
             Operators SHOULD be aware that the TLS SNI extension is part of the TLS client hello, and is therefore subject to eavesdropping.
             Also see <xref target="RFC6066" section="11.1" sectionFormat="comma"/>.
           </t>
             <t>If TLS Encrypted Client Hello becomes standardized and applicable to TLS 1.3, then it SHOULD be included in Secure TACACS+ implementation.</t>
         </section>
       </section>
         <section title="TACACS+ Configuration" anchor="TACACSConfiguration">
           <t>
            Implementors MUST ensure that the configuration scheme introduced
            for enabling TLS is straightforward and leaves no room for ambiguity regarding whether
            TLS or non-TLS will be used between the TACACS+ client and the TACACS+ server.
          </t>
          <t>
             This document introduces a separate port that TLS enabled TACACS+ Servers
             will listen to. Where deployments have not overridden the defaults explicitly,
             TACACS+ client implementations MUST use the correct values:
          </t>
          <ul>
             <li>for non-TLS connection TACACS+: Port 49.</li>
             <li>for TLS connection TACACS+: (TBD).</li>
          </ul>

          <t>
             Implementors MAY offer a single option for TACACS+ clients and servers to disable all
             non-TLS TACACS+ operations. When enabled on a TACACS+ server, it will
             not respond to any requests from non-TLS TACACS+ client connections. When enabled on
             a TACACS+ client, it will not establish any non-TLS TACACS+ server connections.
          </t>
       </section>

       <section title="Well-Known TCP/IP Port" anchor="wellknown">
         <t>
           A new port is considered appropriate and superior to a "STARTTLS" command or other negotiation method because it allows:
         </t>
         <ul>
           <li>ease of blocking the unobfuscated or obfuscated connections by the TCP/IP port number,</li>
           <li>passive Intrusion Detection Systems (IDSs) monitoring the unobfuscated to be unaffected by the introduction of TLS,</li>
           <li>avoidance of Man in the Middle (MitM) attacks that can interfere with STARTTLS,</li>
           <li>and helps prevent the accidental exposure of sensitive information due to misconfiguration.</li>
         </ul>
         <t>
           However, co-existence of inferior authentication and obfuscated, whether an Non-TLS Connection or deprecated parts that compose TLS, also presents opportunity for down-grade attacks.
           Causing failure of connections to the TLS-enabled service or the negotiation of shared algorithm support are two such down-grade attacks.
         </t>
         <t>
           The simplest way to address exposure from Non-TLS Connection methods is to refuse Non-TLS Connections at the server entirely, perhaps using separate servers for Non-TLS Connections and TLS.
         </t>
         <t>
           Another approach is mutual configuration that requires TLS.
           Clients and Servers SHOULD support configuration that requires Peers, globally and individually, use TLS.
           Furthermore, Peers SHOULD be configurable to limit offered or recognized TLS versions and algorithms to those recommended by standards bodies and implementers.
         </t>
       </section>
     </section>

       <section title="Operator Considerations" anchor="OPSCONS">
           <t>
               Operational and deployment considerations are spread throughout the
               document. While avoiding repetition, it is useful for the impatient
               to direct particular attention to Section 5.2 and Section 5.1.5.
               However, it is important that the entire Section 5 is observed.
           </t>
           <section title="Migration" anchor="MIGRATION">
               <t>
                   In section 5.2, it is mentioned that for an optimal deployment of TLS TACACS+,
                   TLS should be universally applied throughout the deployment. However, during
                   the migration process from a non-TLS TACACS+ deployment, operators may need
                   to support both TLS and Non-TLS TACACS+ Servers. This migration phase allows
                   operators to gradually transition their deployments from an insecure state to
                   a more secure one, but it is important to note that it is vulnerable to
                   downgrade attacks. Therefore, the migration phase should be considered
                   insecure until it is fully completed. To mitigate this hazard:
               </t>
               <ul>
                   <li>the period where any client is configured with both TLS and non-TLS servers SHOULD be
                       minimized.
                   </li>
                   <li>the operator MUST consider the impact of mixed TLS and Non-TLS on security.</li>
               </ul>
           </section>

           <section title="Maintaining Non-TLS TACACS+ Clients" anchor="NONTLS">
               <t>
                   Some TACACS+ client devices in a deployment may not implement TLS.
                   These devices will require access to Non-TLS TACACS+ Servers.
                   Operators MUST follow the recommendation of section <xref target="TLSUSE"/> and deploy
                   separate TACACS+ Servers for these Non-TLS clients from those used
                   for the TLS clients.
               </t>
           </section>
       </section>

       <section title="IANA Considerations" anchor="ICTBD">
       <t>
         The authors request that, when this draft is accepted by the working group, the OPSAWG Chairs submit a request to IANA for an early allocation, per <xref target="RFC4020"/> and <xref target="RFC6335"/>, of a new well-known system TCP/IP port number for the service name "tacacss" (referenced in this document also as "TACACS+ TLS well-known port ([TBD])"), described as "TACACS+ over TLS".
         The service name "tacacss" follows the common practice of appending an "s" to the name given to the non-TLS well-known port name.
         This allocation is justified in <xref target="wellknown"/>.
       </t>
       <t>
         RFC EDITOR: this port number should replace "[TBD]" and the service name should replace "[TBDN]" within this document.
       </t>
     </section>

     <section title="Acknowledgments">
       <t>
         The author(s) would like to thank Russ Housley, Steven M. Bellovin, Stephen Farrell, Alan DeKok, Warren Kumari, and Tom Petch for their support, insightful review, and/or comments.
         <xref target="RFC5425"/> was also used as a basis for the approach to TLS.
       </t>
     </section>

   </middle>

   <back>
     <references title="Normative References">
       <referencegroup anchor="BCP14" target="https://www.rfc-editor.org/bcp/bcp14.txt">
         <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
         <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
       </referencegroup>
       <?rfc include="reference.RFC.5280.xml"?>
       <?rfc include="reference.RFC.5425.xml"?>
       <?rfc include="reference.RFC.6066.xml"?>
       <?rfc include="reference.RFC.7301.xml"?>
       <?rfc include="reference.RFC.7525.xml"?>
       <?rfc include="reference.RFC.8446.xml"?>
       <?rfc include="reference.RFC.8773.xml"?>
       <?rfc include="reference.RFC.8907.xml"?>
     </references>
     <references title="Informative References">
       <xi:include href="http://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-tls-external-psk-guidance.xml"/>
       <?rfc include="reference.RFC.3365.xml"?>
       <?rfc include="reference.RFC.4020.xml"?>
       <?rfc include="reference.RFC.6335.xml"?>
       <?rfc include="reference.RFC.7250.xml"?>
       <?rfc include="reference.RFC.7605.xml"?>
       <?rfc include="reference.RFC.9325.xml"?>
       <reference anchor="TLSCSREC" target="https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4">
         <front>
           <title>Transport Layer Security (TLS) Parameters</title>
           <author fullname="IANA"></author>
         </front>
       </reference>
     </references>

   </back>
</rfc>
