<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc4251 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4251.xml">
<!ENTITY rfc4252 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4252.xml">
<!ENTITY rfc4253 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml">
<!ENTITY rfc5647 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5647.xml">
<!ENTITY rfc5656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5656.xml">
<!ENTITY rfc8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY rfc8268 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8268.xml">
<!ENTITY rfc8332 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8332.xml">
<!ENTITY rfc8603 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8603.xml">
]>

<!-- Extra statement used by XSLT processors to control the output style. -->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>


<!-- Information about the document. -->
<rfc category="info" ipr="trust200902" docName="draft-gajcowski-cnsa-ssh-profile-01" >

    <!-- Processing Instructions- PIs (for a complete list and description,
          see file http://xml.resource.org/authoring/README.html and below... -->
    
    <?rfc strict="yes" ?>
    <?rfc comments="no" ?> 
    <?rfc inline="no" ?>
    <?rfc editing="no" ?>

    <!-- Table of Contents (ToC) options. --> 
   <?rfc toc="yes"?>
   <?rfc tocompact="yes"?>
   <?rfc tocdepth="2"?> 

    <!-- References options. --> 
    <?rfc symrefs="yes"?>
    <?rfc sortrefs="yes" ?>
    
    <!-- Vertical spacing options. -->
    <?rfc compact="yes" ?>
    <?rfc subcompact="no" ?>
    
    <!-- end of list of popular I-D processing instructions -->

<front>
    <title abbrev="CNSA Suite SSH Profile">Commercial National Security Algorithm (CNSA) Suite Cryptography for Secure Shell (SSH)</title>

    <author fullname="Nicholas Gajcowski" initials="N." surname="Gajcowski">
        <organization abbrev="NSA">National Security Agency</organization>
        <address><email>nhgajco@uwe.nsa.gov</email></address>
    </author>

    <author fullname="Michael Jenkins" initials="M." surname="Jenkins">
        <organization abbrev="NSA">National Security Agency</organization>
        <address><email>mjjenki@cyber.nsa.gov</email></address>
    </author>
    
    <date year="2021"/>


<abstract>

<t>The United States Government has published the NSA Commercial National Security Algorithm (CNSA) Suite, which defines cryptographic algorithm policy for national security applications. This document specifies the conventions for using the United States National Security Agency's CNSA Suite algorithms with the Secure Shell Transport Layer Protocol and the Secure Shell Authentication Protocol. It applies to the capabilities, configuration, and operation of all components of US National Security Systems that employ IPSec. US National Security Systems are described in NIST Special Publication 800-59. It is also appropriate for all other US Government systems that process high-value information. It is made publicly available for use by developers and operators of these and any other system deployments.
</t>

</abstract>

</front>


<middle>

<section anchor="intro" title="Introduction">

<t>This document specifies conventions for using the United States National Security Agency's CNSA Suite algorithms <xref target="CNSA" /> with Secure Shell Transport Layer Protocol <xref target="RFC4253" /> and the Secure Shell Authentication Protocol <xref target="RFC4252" />. It applies to the capabilities, configuration, and operation of all components of US National Security Systems that employ IPSec. US National Security Systems are described in NIST Special Publication 800-59 <xref target="SP80059" />. It is also appropriate for all other US Government systems that process high-value information. It is made publicly available for use by developers and operators of these and any other system deployments.
</t>

</section>  <!-- intro -->


<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 BCP 14 <xref target="RFC2119" /> <xref target="RFC8174" /> when, and only when, they appear in all capitals, as shown here.
</t>

</section>  <!-- terminology -->


<section anchor="cnsa" title="The Commercial National Security Algorithm Suite">

<t>The National Security Agency (NSA) profiles commercial cryptographic algorithms and protocols as part of its mission to support secure, interoperable communications for US Government National Security Systems. To this end, it publishes guidance both to assist with the US Government transition to new algorithms, and to provide vendors - and the Internet community in general - with information concerning their proper use and configuration.
</t>

<t>Recently, cryptographic transition plans have become overshadowed by the prospect of the development of a cryptographically-relevant quantum computer. NSA has established the Commercial National Security Algorithm (CNSA) Suite to provide vendors and IT users near-term flexibility in meeting their IA interoperability requirements. The purpose behind this flexibility is to avoid vendors and customers making two major transitions in a relatively short timeframe, as we anticipate a need to shift to quantum-resistant cryptography in the near future.
</t>

<t>NSA is authoring a set of RFCs, including this one, to provide updated guidance concerning the use of certain commonly available commercial algorithms in IETF protocols. These RFCs can be used in conjunction with other RFCs and cryptographic guidance (e.g., NIST Special Publications) to properly protect Internet traffic and data-at-rest for US Government National Security Systems.
</t>

</section> <!-- cnsa -->


<section anchor="cnsa-and-ssh" title="CNSA and Secure Shell">

<t>Several RFCs have documented how each of the CNSA components are to be integrated into Secure Shell (SSH):

<list style="empty">
  <t>kex algorithms
  <list style="empty">
    <t>ecdh-sha2-nistp384           <xref target="RFC5656" /></t>
    <t>diffie-hellman-group15-sha512	<xref target="RFC8268" /></t>
    <t>diffie-hellman-group16-sha512	<xref target="RFC8268" /></t>
    </list></t>
  <t>public key algorithms
  <list style="empty">
    <t>ecdsa-sha2-nistp384          <xref target="RFC5656" /></t>
    <t>rsa-sha2-512 		<xref target="RFC8332" /></t>
    </list></t>
  <t>encryption algorithms (both client_to_server and server_to_client)
  <list style="empty">
    <t>AEAD_AES_256_GCM             <xref target="RFC5647" /></t>
    </list></t>
  <t>MAC algorithms (both client_to_server and server_to_client)
  <list style="empty">
    <t>AEAD_AES_256_GCM             <xref target="RFC5647" /></t>
    </list></t>
</list>
</t>

<t>The purpose of this document is to draw upon all of these documents to provide guidance for CNSA compliant implementations of Secure Shell. Note that while compliant Secure Shell implementations MUST follow the guidance in this document, that requirement does not in and of itself imply that a given implementation of Secure Shell is suitable for use national security systems. An implementation must be validated by the appropriate authority before such usage is permitted.
</t>

<section anchor="hash-funx" title="Hash Functions">

<t>The approved CNSA hash function for all purposes is SHA-384, as defined in <xref target="FIPS180" />.  However, SHA-512 (sha2-512) is recommended for the Diffie-Hellman kex algorithms and for RSA public key algorithms due to lack of specification of SHA-384 in <xref target="RFC8268" /> and <xref target="RFC8332" />.  Any hash algorithm other than SHA-384 or SHA-512 MUST NOT be used.
</t>

</section>  <!-- hash-funx -->

<section anchor="dig-sigs" title="Digital Signatures">

<t>Servers MUST be authenticated using digital signatures.  The public key algorithm implemented MUST be ecdsa-sha2-nistp384 or rsa-sha2-512. The RSA public key modulus MUST be 3072 or 4096 bits in size; clients MUST NOT accept RSA signatures from a public key modulus of any other size.
</t>

<t>Implementations MUST NOT employ a trust on first use (TOFU) security model where a client accepts the first public host key presented to it from a not yet verified server. This allows for the possibility of a man in the middle attack, where an attacker can present itself to the client as the server.
</t>

<t>The public host keys presented MUST be verified as belonging to the presenting party before the signature is accepted.  This certification SHOULD be done using certificates, provided the use of certificates has been approved for that environment.  Otherwise, the user MUST validate the presented public key (and/or certificate) by some other means, possibly through an offline mechanism. Certificates MUST be X.509v3 certificates and their use MUST comply with <xref target="RFC8603" />.  
</t>

</section>  <!-- dig-sigs -->

</section>  <!-- cnsa-and-ssh -->


<section anchor="sec-mech-neg-init" title="Security Mechanism Negotiation and Initialization">

<t>As described in <xref target="RFC4253" />, the exchange of SSH_MSG_KEXINIT between the server and the client establishes which key agreement algorithm, MAC algorithm, host key algorithm (server authentication algorithm), and encryption algorithm are to be used.  This section specifies the use of CNSA components in the Secure Shell algorithm negotiation, key agreement, server authentication, and user authentication.
</t>

<t>The choice of all but the user authentication methods are determined by the exchange of SSH_MSG_KEXINIT between the client and the server.
</t>

<t>The SSH_MSG_KEXINIT name lists can be used to constrain the choice of cryptographic algorithms in accordance with the guidance given in Section 2.  One of the following kex_algorithms MUST be used.

<list style="empty">
  <t>ecdh-sha2-nistp384              <xref target="RFC5656" /></t>
  <t>diffie-hellman-group15-sha512   <xref target="RFC8268" /></t>
  <t>diffie-hellman-group16-sha512   <xref target="RFC8268" /></t>
  </list>
</t>

<t>One of the name lists from the following list MUST be used for the encryption algorithms and mac algorithm.  This option MUST be used.

<list style="empty">
  <t>encryption_algorithm name_list  := { AEAD_AES_256_GCM   }</t>
  <t>mac_algorithm name_list         := { AEAD_AES_256_GCM   }</t>
  </list>
</t>

<t>One of the following public key algorithms MUST be used.

<list style="empty">
  <t>rsa-sha2-512                  <xref target="RFC8332" /></t>
  <t>ecdsa-sha2-nistp384           <xref target="RFC5656" /></t>
  </list>
</t>

</section>  <!-- sec-mech-neg-init -->


<section anchor="kex-and-svr-authn" title="Key Exchange and Server Authentication">

<t>Either ECDH or DH MUST be used to establish a shared secret value between the client and the server.  A signature on the exchange hash value derived from the newly established shared secret value is used to authenticate the server to the client.
</t>

<t>The key exchange to be used is determined by the name lists exchanged in the SSH_MSG_KEXINT packets as described in <xref target="RFC4253" />.
</t>

<t>A compliant system MUST NOT allow the reuse of ephemeral/exchange values in a key exchange algorithm due to security concerns related to this practice. Section 5.6.3.3 of <xref target="SP80056A" /> states that an ephemeral private key must be used in exactly one key establishment transaction and must be destroyed (zeroized) as soon as possible.  Section 5.8 of <xref target="SP80056A" /> states that such shared secrets must be destroyed (zeroized) immediately after its use.  CNSA compliant systems MUST follow these mandates.
</t>

<section anchor="ecdh-kex" title="ECDH Key Exchange">

<t>The key exchange begins with the SSH_MSG_KEXECDH_INIT message which contains the client's ephemeral public key used to generate a shared secret value.
</t>

<t>The server responds to a SSH_MSG_KEXECDH_INIT message with a SSH_MSG_KEXECDH_REPLY message which contains the server's ephemeral public key, the server's public host key, and a signature of the exchange hash value formed from the newly established shared secret value.  The public key algorithm MUST be ecdsa-sha2-nistp384 or rsa-sha2-512.
</t>

</section>  <!-- ecdh-kex -->


<section anchor="dh-kex" title="DH Key Exchange">

<t>The key exchange begins with the SSH_MSG_KEXDH_INIT message which contains the client's diffie-hellman exchange value used to generate a shared secret value.
</t>

<t>The server responds to a SSH_MSG_KEXDH_INIT message with a SSH_MSG_KEXDH_REPLY message. The SSH_MSG_KEXDH_REPLY contains the server's diffie-hellman exchange value, the server's public host key, and a signature of the exchange hash value formed from the newly established shared secret value.  The public key algorithm MUST be ecdsa-sha2-nistp384 or rsa-sha2-512.
</t>

</section>  <!-- dh-kex -->

</section>  <!-- kex-and-svr-authn -->

<section anchor="user-authn" title="User Authentication">

<t>The Secure Shell Transport Layer Protocol authenticates the server to the host but does not authenticate the user (or the user's host) to the server. All users MUST be authenticated, MUST follow <xref target="RFC4252" />, and SHOULD be authenticated using a public key method. Users MAY authenticate using passwords. Other methods of authentication MUST not be used, including "none".
</t>

<t>When authenticating with public key, the following public key algorithms MUST be used:

<list style="empty">
  <t>ecdsa-sha2-nistp384           <xref target="RFC5656" /></t>
  <t>rsa-sha2-512                  <xref target="RFC8332" /></t>
  </list>
</t>

<t>The server MUST verify that the presented key is a valid authenticator for the user. This SHOULD be done using certificates.  Certificates MUST be X.509v3 certificates and their use MUST comply with <xref target="RFC8603" />.
</t>

<t>If authenticating with RSA, the client's public key modulus MUST be 3072 or 4096 bits in size, and the server MUST NOT accept signatures from an RSA public key modulus of any other size.
</t>

<t>If authenticating by passwords, it is essential that passwords have sufficient entropy to protect against dictionary attacks. During authentication, the password MUST be protected in the established encrypted communications channel.  Additional guidelines are provided in <xref target="SP80063" />.
</t>

</section>  <!-- user-authn -->


<section anchor="pkt-conf-and-integ" title="Confidentiality and Data Integrity of SSH Binary Packets">

<t>Secure Shell transfers data between the client and the server using its own binary packet structure.  The SSH binary packet structure is independent of any packet structure on the underlying data channel. The contents of each binary packet and portions of the header are encrypted, and each packet is authenticated with its own message authentication code.  AES GCM will both encrypt the packet and form a 16-octet authentication tag to ensure data integrity.
</t>

<section anchor="gcm" title="Galois/Counter Mode">

<t>Use of AES GCM in Secure Shell is described in <xref target="RFC5647" />. CNSA complaint SSH implementations MUST support AEAD_AES_GCM_256 to provide confidentiality and ensure data integrity. No other confidentiality or data integrity algorithms are permitted.
</t>

<t>The AES GCM invocation counter is incremented mod 2^64. That is, after processing a binary packet:

<list style="empty">
  <t>invocation_counter = invocation_counter + 1 mod 2^64</t>
  </list>
</t>

<t>The invocation counter MUST NOT repeat a counter value.</t>

</section>  <!-- gcm -->

<section anchor="data-integ" title="Data Integrity">

<t>As specified in <xref target="RFC5647" />, all 16 octets of the authentication tag MUST be used as the SSH data integrity value of the SSH binary packet.
</t>

</section>  <!-- data-integ -->

</section>  <!-- pkt-conf-and-integ -->

<section anchor="rekeying" title="Rekeying">

<t>Secure Shell allows either the server or client to request that the Secure Shell connection be rekeyed.  The cipher suite being employed MUST NOT be changed when a rekey occurs.
</t>

</section>  <!-- rekeying -->


<section anchor="sec-considerations" title="Security Considerations">

<t>The security considerations of <xref target="RFC4251" />, <xref target="RFC4252" />, <xref target="RFC4253" />, <xref target="RFC5647" />, and <xref target="RFC5656" /> apply.
</t>

</section>  <!-- sec-considerations -->


<section anchor="iana" title="IANA Considerations">

<t>No IANA actions are requested.
</t>

</section> <!--  iana -->


</middle>


<back>     <!--  *****BACK MATTER ***** -->

<references title="Normative References">

  <reference anchor="CNSA" target="https://www.cnss.gov/CNSS/Issuances/Policies.htm">
    <front>
      <title>Use of Public Standards for Secure Information Sharing</title>
      <author><organization>Committee for National Security Systems</organization></author>
      <date month="October" year="2016"></date>
      </front>
    <seriesInfo name="CNSSP" value="15"></seriesInfo>
    </reference> <!-- CNSA -->
      
  <reference anchor="FIPS180" target="https://csrc.nist.gov/publications/detail/fips/180/4/final">
    <front>
      <title>Secure Hash Standard (SHS)</title>
      <author>
        <organization>National Institute of Standards and Technology</organization>
        </author>
      <date month="August" year="2015" />
      </front>
    <seriesInfo name="Federal Information Processing Standard" value="180-4" />
    </reference> <!-- FIPS180 -->


&rfc2119;
&rfc4251;
&rfc4252;
&rfc4253;
&rfc5647;
&rfc5656;
&rfc8174;
&rfc8268;
&rfc8332;
&rfc8603;

</references>  <!-- Normative -->

<references title="Informative References">

  <reference anchor="SP80056A" target="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf">
    <front>
      <title>Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography</title>
      <author>
        <organization>National Institute of Standards and Technology</organization>
        </author>
      <date month="April" year="2018" />
      </front>
    <seriesInfo name="NIST Special Publication" value="800-56A, Revision 3" />
    </reference>  <!-- SP80056A -->

  <reference anchor="SP80059" target="https://csrc.nist.gov/publications/detail/sp/800-59/final">
    <front>
      <title>Guideline for Identifying an Information System as a National Security System</title>
      <author>
        <organization>National Institute of Standards and Technology</organization>
        </author>
      <date month="August" year="2003" />
      </front>
    <seriesInfo name="Special Publication 800-59" value="" />
    </reference> <!-- SP80059 -->

  <reference anchor="SP80063" target="https://www.nist.gov/itl/tig/projects/special-publication-800-63">
    <front>
      <title>Digital Identity Guidelines</title>
      <author>
        <organization>National Institute of Standards and Technology</organization>
        </author>
      <date month="June" year="2017" />
      </front>
    <seriesInfo name="NIST Special Publication" value="800-63, Revision 3" />
    </reference>  <!-- SP80063 -->

</references>  <!-- Informative -->

</back>       <!--  ===== END BACK MATTER ===== -->

</rfc>
