Network File System Version 4 | T. Myklebust |
Internet-Draft | Hammerspace |
Updates: 5531 (if approved) | C. Lever, Ed. |
Intended status: Standards Track | Oracle |
Expires: March 25, 2020 | September 22, 2019 |
Remote Procedure Call Encryption By Default
draft-ietf-nfsv4-rpc-tls-03
This document describes a mechanism that, through the use of opportunistic Transport Layer Security (TLS), enables encryption of in-transit Remote Procedure Call (RPC) transactions while interoperating with ONC RPC implementations that do not support this mechanism. This document updates RFC 5531.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on March 25, 2020.
Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.
In 2014 the IETF published [RFC7258] which recognized that unauthorized observation of network traffic had become widespread and was a subversive threat to all who make use of the Internet at large. It strongly recommended that newly defined Internet protocols make a real effort to mitigate monitoring attacks. Typically this mitigation is done by encrypting data in transit.
The Remote Procedure Call version 2 protocol has been a Proposed Standard for three decades (see [RFC5531] and its antecedants). Eisler et al. first introduced an in-transit encryption mechanism for RPC with RPCSEC GSS over twenty years ago [RFC2203]. However, experience has shown that RPCSEC GSS can be difficult to deploy:
However strong a privacy service is, it cannot provide any security if the challenges of using it result in it not being used at all.
An alternative approach is to employ a transport layer security mechanism that can protect the privacy of each RPC connection transparently to RPC and Upper Layer protocols. The Transport Layer Security protocol [RFC8446] (TLS) is a well-established Internet building block that protects many common Internet protocols such as the Hypertext Transport Protocol (http) [RFC2818].
Encrypting at the RPC transport layer enables several significant benefits.
This document specifies the use of RPC on a TLS-protected transport in a fashion that is transparent to upper layer protocols based on RPC. It provides policies in line with [RFC7435] that enable RPC-on-TLS to be deployed opportunistically in environments with RPC implementations that do not support TLS. Specifications for RPC-based upper layer protocols are free to require stricter policies to guarantee that TLS with encryption or TLS with host authentication and encryption is used for every connection.
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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This document adopts the terminology introduced in Section 3 of [RFC6973] and assumes a working knowledge of the Remote Procedure Call (RPC) version 2 protocol [RFC5531] and the Transport Layer Security (TLS) version 1.3 protocol [RFC8446].
Note also that the NFS community uses the term "privacy" where other Internet communities use "confidentiality". In this document the two terms are synonymous.
We adhere to the convention that a "client" is a network host that actively initiates an association, and a "server" is a network host that passively accepts an association request.
RPC documentation historically refers to the authentication of a connecting host as "machine authentication" or "host authentication". TLS documentation refers to the same as "peer authentication". In this document there is little distinction between these terms.
The term "user authentication" in this document refers specifically to the RPC caller's credential, provided in the "cred" and "verf" fields in each RPC Call.
The mechanism described in this document interoperates fully with RPC implementations that do not support TLS. The use of TLS is automatically disabled in these cases.
<CODE BEGINS> enum auth_flavor { AUTH_NONE = 0, AUTH_SYS = 1, AUTH_SHORT = 2, AUTH_DH = 3, AUTH_KERB = 4, AUTH_RSA = 5, RPCSEC_GSS = 6, AUTH_TLS = 7, /* and more to be defined */ }; <CODE ENDS>
To achieve this, we introduce a new RPC authentication flavor called AUTH_TLS. This new flavor is used to signal that the client wants to initiate TLS negotiation if the server supports it. Except for the modifications described in this section, the RPC protocol is largely unaware of security encapsulation.
The flavor value of the verifier received in the reply message from the server MUST be AUTH_NONE. The bytes of the verifier's string encode the fixed ASCII characters "STARTTLS".
When an RPC client is ready to begin sending traffic to a server, it starts with a NULL RPC request with an auth_flavor of AUTH_TLS. The NULL request is made to the same port as if TLS were not in use.
The RPC server can respond in one of three ways:
Once the TLS handshake is complete, the RPC client and server will have established a secure channel for communicating. The client MUST switch to a security flavor other than AUTH_TLS within that channel, presumably after negotiating down redundant RPCSEC_GSS privacy and integrity services and applying channel binding [RFC7861].
If TLS negotiation fails for any reason -- say, the RPC server rejects the certificate presented by the RPC client, or the RPC client fails to authenticate the RPC server -- the RPC client reports this failure to the calling application the same way it would report an AUTH_ERROR rejection from the RPC server.
If an RPC client attempts to use AUTH_TLS for anything other than the NULL RPC procedure, the RPC server MUST respond with a reject_stat of AUTH_ERROR. If the client sends a STARTTLS after it has sent other non-encrypted RPC traffic or after a TLS session has already been negotiated, the server MUST silently discard it.
Both RPC and TLS have their own variants of authentication, and there is some overlap in capability. The goal of interoperability with implementations that do not support TLS requires that we limit the combinations that are allowed and precisely specify the role that each layer plays. We also want to handle TLS such that an RPC implementation can make the use of TLS invisible to existing RPC consumer applications.
Each RPC server that supports RPC-over-TLS MUST possess a unique global identity (e.g., a certificate that is signed by a well-known trust anchor). Such an RPC server MUST request a TLS peer identity from each client upon first contact. There are two different modes of client deployment:
In either of these modes, RPC user authentication is not affected by the use of transport layer security. Once a TLS session is established, the server MUST NOT utilize the client peer's TLS identity for the purpose of authorizing individual RPC requests.
RPCSEC GSS can provide per-request integrity or privacy (also known as confidentiality) services. When operating over a TLS session, these services become redundant. A TLS-capable RPC implementation uses GSS channel binding for detecting when GSS integrity or privacy is unnecessary and can therefore be avoided. See Section 2.5 of [RFC7861] for details.
When employing GSS above TLS, a GSS service principal is still required on the server, and mutual GSS authentication of server and client still occurs after the TLS session is established.
When a TLS session is negotiated for the purpose of transporting RPC, the following restrictions apply:
RPC over TCP is protected by using TLS [RFC8446]. As soon as a client completes the TCP handshake, it uses the mechanism described in Section 4.1 to discover TLS support and then negotiate a TLS session.
After the TLS session is established, all traffic on the connection is encapsulated and protected until the TLS session is terminated. This includes reverse-direction operations (i.e., RPC requests initiated on the server-end of the connection). An RPC client receiving a reverse-direction operation on a connection outside of an existing TLS session MUST reject the request with a reject_stat of AUTH_ERROR.
An RPC peer terminates a TLS session by sending a TLS closure alert, or by closing the underlying TCP socket. After TLS session termination, a recipient MUST reject any subsequent RPC requests over the same connection with a reject_stat of AUTH_ERROR.
RPC over UDP is protected using DTLS [RFC6347]. As soon as a client initializes a socket for use with an unfamiliar server, it uses the mechanism described in Section 4.1 to discover DTLS support and then negotiate a DTLS session. Connected operation is RECOMMENDED.
Using a DTLS transport does not introduce reliable or in-order semantics to RPC on UDP. Also, DTLS does not support fragmentation of RPC messages. One RPC message fits in a single DTLS datagram. DTLS encapsulation has overhead which reduces the effective Path MTU (PMTU) and thus the maximum RPC payload size.
DTLS does not detect STARTTLS replay. A DTLS session can be terminated by sending a TLS closure alert. Subsequent RPC messages passing between the client and server will no longer be protected until a new TLS session is established.
RPC-over-RDMA can make use of Transport Layer Security below the RDMA transport layer [RFC8166]. The exact mechanism is not within the scope of this document. Because there might not be provisions to exchange client and server certificates, authentication material could be provided by facilites within a future RPC-over-RDMA transport.
Transports that provide intrinsic TLS-level security (e.g., QUIC) would need to be accommodated separately from the current document. In such cases, use of TLS might not be opportunitic as it is for TCP or UDP.
Peer authentication can be performed by TLS using any of the following mechanisms:
Implementations are REQUIRED to support this mechanism. In this mode, an RPC peer is uniquely identified by the tuple (serial number of presented certificate;Issuer).
Authenticating a connecting entity does not mean the RPC server necessarily wants to communicate with that client. For example, if the Issuer is not in a trusted set of Issuers, the RPC server may decline to perform RPC transactions with this client. Implementations that want to support a wide variety of trust models should expose as many details of the presented certificate to the administrator as possible so that the trust model can be implemented by the administrator. As a suggestion, at least the following parameters of the X.509 client certificate should be exposed:
This mechanism is OPTIONAL to implement. In this mode, an RPC peer is uniquely identified by the fingerprint of the presented certificate.
Implementations SHOULD allow the configuration of a list of trusted certificates, identified via fingerprint of the DER encoded certificate octets. Implementations MUST support SHA-1 as the hash algorithm for the fingerprint. To prevent attacks based on hash collisions, support for a more contemporary hash function, such as SHA-256, is RECOMMENDED.
This mechanism is OPTIONAL to implement. In this mode, an RPC peer is uniquely identified by key material that has been shared out-of-band or by a previous TLS-protected connection (see [RFC8446] Section 2.2). At least the following parameters of the TLS connection should be exposed:
This mechanism is OPTIONAL to implement. In this mode, an RPC peer is uniquely identified by a token.
Versions of TLS subsequent to TLS 1.2 feature a token binding mechanism which is nominally more secure than using certificates. This is discussed in further detail in [RFC8471].
This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs.
Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist.
One purpose of the mechanism described in this document is to protect RPC-based applications against threats to the privacy of RPC transactions and RPC user identities. A taxonomy of these threats appears in Section 5 of [RFC6973]. In addition, Section 6 of [RFC7525] contains a detailed discussion of technologies used in conjunction with TLS. Implementers should familiarize themselves with these materials.
A range of options is allowed by the opportunistic approach described in this document, from "no peer authentication or encryption" to "server-only authentication with encryption" to "mutual authentication with encryption". The security level may indeed be selected without user intervention based on a policy. Implementations must take care to accurately represent to all RPC consumers the level of security that is actually in effect.
A classic form of attack on network protocols that initiate an association in plain-text to discover support for TLS is a man-in-the-middle that alters the plain-text handshake to make it appear as though TLS support is not available on one or both peers. Clients implementers can choose from the following to mitigate STRIPTLS attacks:
To maintain the privacy of RPC users on a single client belonging to multiple distinct security realms, the client MUST establish an independent TLS session for each user identity domain, each using a distinct globally unique identity. The purpose of this separation is to prevent even privileged users in each security realm from monitoring RPC traffic emitted on behalf of users in other security realms on the same peer.
The use of a TLS-protected transport when the AUTH_SYS authentication flavor is in use addresses a number of longstanding weaknesses (as detailed in Appendix A). TLS augments AUTH_SYS by providing both integrity protection and a privacy service that AUTH_SYS lacks. This protects data payloads, RPC headers, and user identities against monitoring or alteration while in transit. TLS guards against the insertion or deletion of messages, thus also ensuring the integrity of the message stream between RPC client and server.
The use of TLS enables strong authentication of the communicating RPC peers, providing a degree of non-repudiation. When AUTH_SYS is used with TLS but the RPC client is unauthenticated, the RPC server is still acting on RPC requests for which there is no trustworthy authentication. In-transit traffic is protected, but the RPC client itself can still misrepresent user identity without server detection. This is an improvement from AUTH_SYS without encryption, but it leaves a critical security exposure.
In light of the above, it is RECOMMENDED that when AUTH_SYS is used, RPC clients present authentication material necessary for RPC servers they contact to have a degree of trust that the clients are acting responsibly.
The use of TLS does not enable detection of compromise on RPC clients that leads to impersonation of RPC users. In addition, there continues to be a requirement that the mapping of 32-bit user and group ID values to user identities is the same on both the RPC client and server.
In accordance with Section 6 of [RFC7301], the authors request that IANA allocate the following value in the "Application-Layer Protocol Negotiation (ALPN) Protocol IDs" registry. The "sunrpc" string identifies SunRPC when used over TLS.
The ONC RPC protocol as specified in [RFC5531] provides several modes of security, traditionally referred to as "authentication flavors", though some of these flavors provide much more than an authentication service. We will refer to these as authentication flavors, security flavors, or simply, flavors. One of the earliest and most basic flavor is AUTH_SYS, also known as AUTH_UNIX. AUTH_SYS is currently specified in Appendix A of [RFC5531].
AUTH_SYS assumes that both the RPC client and server use POSIX-style user and group identifiers (each user and group can be distinctly represented as a 32-bit unsigned integer), and that both client and server use the same mapping of user and group to integer. One user ID, one main group ID, and up to 16 supplemental group IDs are associated with each RPC request. The combination of these identify the entity on the client that is making the request.
Peers are identified by a string in each RPC request. RFC 5531 does not specify any requirements for this string other than that is no longer than 255 octets. It does not have to be the same from request to request, nor does it have to match the name of the sending host. For these reasons, though most implementations do fill in their hostname in this field, receivers typically ignore its content.
RFC 5531 Appendix A contains a brief explanation of security considerations:
It should be clear, therefore, that AUTH_SYS by itself offers little to no communication security:
Special mention goes to Charles Fisher, author of "Encrypting NFSv4 with Stunnel TLS" . His article inspired the mechanism described in this document.
Many thanks to Tigran Mkrtchyan for his work on the DESY prototype and resulting feedback to this document.
The authors are grateful to Bill Baker, David Black, Alan DeKok, Lars Eggert, Benjamin Kaduk, Olga Kornievskaia, Greg Marsden, Alex McDonald, David Noveck, Justin Mazzola Paluska, Tom Talpey, and Martin Thomson for their input and support of this work.
Lastly, special thanks go to Transport Area Director Magnus Westerlund, NFSV4 Working Group Chairs Spencer Shepler and Brian Pawlowski, and NFSV4 Working Group Secretary Thomas Haynes for their guidance and oversight.