Towards Remote Procedure Call Encryption by Default
RFC 9289
Document | Type |
RFC
- Proposed Standard
(September 2022)
Updates RFC 5531
|
|
---|---|---|---|
Authors | Trond Myklebust , Chuck Lever | ||
Last updated | 2022-09-13 | ||
RFC stream | Internet Engineering Task Force (IETF) | ||
Formats | |||
Additional resources | Mailing list discussion | ||
IESG | Responsible AD | Magnus Westerlund | |
Send notices to | (None) |
RFC 9289
#x27;s authorization to communicate (e.g., a set of allowed values in subjectAltName:URI, a set of allowed X.509v3 Certificate Policies, or a set of extended key usages). When the configured set of trust anchors changes (e.g., removal of a Certification Authority (CA) from the list of trusted CAs; issuance of a new Certificate Revocation List (CRL) for a given CA), implementations SHOULD reevaluate the certificate originally presented in the context of the new configuration and terminate the TLS session if the certificate is no longer trustworthy. 5.2.1.1. Extended Key Usage Values Section 4.2.1.12 of [RFC5280] specifies the extended key usage X.509 certificate extension. This extension, which may appear in end- entity certificates, indicates one or more purposes for which the certified public key may be used in addition to or in place of the basic purposes indicated in the key usage extension. The current document defines two new KeyPurposeId values: one that identifies the RPC-with-TLS peer as an RPC client, and one that identifies the RPC-with-TLS peer as an RPC server. The inclusion of the RPC server value (id-kp-rpcTLSServer) indicates that the certificate has been issued for allowing the holder to process RPC transactions. The inclusion of the RPC client value (id-kp-rpcTLSClient) indicates that the certificate has been issued for allowing the holder to request RPC transactions. 5.2.2. Pre-shared Keys This mechanism is OPTIONAL to implement. In this mode, the RPC peer can be uniquely identified by keying material that has been shared out of band (see Section 2.2 of [RFC8446]). The PSK Identifier SHOULD be exposed at the RPC layer. 6. Security Considerations One purpose of the mechanism described in the current document is to protect RPC-based applications against threats to the confidentiality of RPC transactions and RPC user identities. A taxonomy of these threats appears in Section 5 of [RFC6973]. Also, Section 6 of [RFC7525] contains a detailed discussion of technologies used in conjunction with TLS. Section 8 of [RFC5280] covers important considerations about handling certificate material securely. Implementers should familiarize themselves with these materials. Once a TLS session is established, the RPC payload carried on TLS version 1.3 is forward secure. However, implementers need to be aware that replay attacks can occur during session establishment. Remedies for such attacks are discussed in detail in Section 8 of [RFC8446]. Further, the current document does not provide a profile that defines the use of 0-RTT data (see Appendix E.5 of [RFC8446]). Therefore, RPC-with-TLS implementations MUST NOT use 0-RTT data. 6.1. The Limitations of Opportunistic Security Readers can find the definition of Opportunistic Security in [RFC7435]. A discussion of its underlying principles appears in Section 3 of that document. The purpose of using an explicitly opportunistic approach is to enable interoperation with implementations that do not support RPC- with-TLS. A range of options is allowed by this approach, from "no peer authentication or encryption" to "server-only authentication with encryption" to "mutual authentication with encryption". The actual security level may indeed be selected based on policy and without user intervention. In environments where interoperability is a priority, the security benefits of TLS are partially or entirely waived. Implementations of the mechanism described in the current document must take care to accurately represent to all RPC consumers the level of security that is actually in effect, and are REQUIRED to provide an audit log of RPC-with-TLS security mode selection. In all other cases, the adoption, implementation, and deployment of RPC-based upper-layer protocols that enforce the use of TLS authentication and encryption (when similar RPCSEC_GSS services are not in use) is strongly encouraged. 6.1.1. STRIPTLS Attacks The initial AUTH_TLS probe occurs in cleartext. An on-path attacker can alter a cleartext handshake to make it appear as though TLS support is not available on one or both peers. Client implementers can choose from the following to mitigate STRIPTLS attacks: * A TLSA record [RFC6698] can alert clients that TLS is expected to work, and provide a binding of a hostname to the X.509 identity. If TLS cannot be negotiated or authentication fails, the client disconnects and reports the problem. When an opportunistic security policy is in place, a client SHOULD check for the existence of a TLSA record for the target server before initiating an RPC-with-TLS association. * Client security policy can require that a TLS session is established on every connection. If an attacker spoofs the handshake, the client disconnects and reports the problem. This policy prevents an attacker from causing the association to fall back to cleartext silently. If TLSA records are not available, this approach is strongly encouraged. 6.1.2. Privacy Leakage before Session Establishment As mentioned earlier, communication between an RPC client and server appears in the clear on the network prior to the establishment of a TLS session. This cleartext information usually includes transport connection handshake exchanges, the RPC NULL procedure probing support for TLS, and the initial parts of TLS session establishment. Appendix C of [RFC8446] discusses precautions that can mitigate exposure during the exchange of connection handshake information and TLS certificate material that might enable attackers to track the RPC client. Note that when PSK authentication is used, the PSK identifier is exposed during the TLS handshake and can be used to track the RPC client. Any RPC traffic that appears on the network before a TLS session has been established is vulnerable to monitoring or undetected modification. A secure client implementation limits or prevents any RPC exchanges that are not protected. The exception to this edict is the initial RPC NULL procedure that acts as a STARTTLS message, which cannot be protected. This RPC NULL procedure contains no arguments or results, and the AUTH_TLS authentication flavor it uses does not contain user information, so there is negligible privacy impact from this exception. 6.2. TLS Identity Management on Clients The goal of RPC-with-TLS is to hide the content of RPC requests while they are in transit. RPC-with-TLS protocol by itself cannot protect against exposure of a user's RPC requests to other users on the same client. Moreover, client implementations are free to transmit RPC requests for more than one RPC user using the same TLS session. Depending on the details of the client RPC implementation, this means that the client's TLS credentials are potentially visible to every RPC user that shares a TLS session. Privileged users may also be able to access this TLS identity. As a result, client implementations need to carefully segregate TLS credentials so that local access to it is restricted to only the local users that are authorized to perform operations on the remote RPC server. 6.3. Security Considerations for AUTH_SYS on TLS Using a TLS-protected transport when the AUTH_SYS authentication flavor is in use addresses several longstanding weaknesses in AUTH_SYS (as detailed in Appendix A). TLS augments AUTH_SYS by providing both integrity protection and confidentiality that AUTH_SYS lacks. TLS protects data payloads, RPC headers, and user identities against monitoring and alteration while in transit. TLS guards against in-transit insertion and deletion of RPC messages, thus ensuring the integrity of the message stream between RPC client and server. DTLS does not provide full message stream protection, but it does enable receivers to reject nonparticipant messages. In particular, transport-layer encryption plus peer authentication protects receiving eXternal Data Representation (XDR) decoders from deserializing untrusted data, a common coding vulnerability. However, these decoders would still be exposed to untrusted input in the case of the compromise of a trusted peer or Certification Authority. 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 still acts 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. TLS without authentication is an improvement from AUTH_SYS without encryption, but it leaves a critical security exposure. In light of the above, when AUTH_SYS is used, the use of a TLS mutual authentication mechanism is RECOMMENDED to prove that the RPC client is known to the RPC server. The server can then determine whether the UIDs and GIDs in AUTH_SYS requests from that client can be accepted, based on the authenticated identity of the client. The use of TLS does not enable RPC clients to detect compromise that leads to the impersonation of RPC users. Also, 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. 6.4. Best Security Policy Practices RPC-with-TLS implementations and deployments are strongly encouraged to adhere to the following policies to achieve the strongest possible security with RPC-with-TLS. * When using AUTH_NULL or AUTH_SYS, both peers are RECOMMENDED to have DNSSEC TLSA records, keys with which to perform mutual peer authentication using one of the methods described in Section 5.2, and a security policy that requires mutual peer authentication and rejection of a connection when host authentication fails. * RPCSEC_GSS provides integrity and privacy services that are largely redundant when TLS is in use. These services SHOULD be disabled in that case. 7. IANA Considerations 7.1. RPC Authentication Flavor Following Appendix B of [RFC5531], an entry has been added to the "RPC Authentication Flavor Numbers" registry. The purpose of the new authentication flavor is to signal the use of TLS with RPC. This new flavor is not a pseudo-flavor. The fields in the new entry have been assigned as follows: Identifier String: AUTH_TLS Flavor Name: TLS Value: 7 Description: Indicates support for RPC-with-TLS Reference: RFC 9289 7.2. ALPN Identifier for SunRPC Following Section 6 of [RFC7301], the following value has been allocated in the "TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs" registry. The "sunrpc" string identifies SunRPC when used over TLS. Protocol: SunRPC Identification Sequence: 0x73 0x75 0x6e 0x72 0x70 0x63 ("sunrpc") Reference: RFC 9289 7.3. Object Identifier for PKIX Extended Key Usage Per the Specification Required policy defined in Section 4.6 of [RFC8126], the following new values have been registered in the "SMI Security for PKIX Extended Key Purpose" registry (1.3.6.1.5.5.7.3) (see Section 5.2.1.1 and Appendix B). +=========+====================+===========+ | Decimal | Description | Reference | +=========+====================+===========+ | 33 | id-kp-rpcTLSClient | RFC 9289 | +---------+--------------------+-----------+ | 34 | id-kp-rpcTLSServer | RFC 9289 | +---------+--------------------+-----------+ Table 1 7.4. Object Identifier for ASN.1 Module Per the Specification Required policy defined in Section 4.6 of [RFC8126], the following new value has been registered in the "SMI Security for PKIX Module Identifier" registry (1.3.6.1.5.5.7.0) (see Appendix B). +=========+========================+===========+ | Decimal | Description | Reference | +=========+========================+===========+ | 105 | id-mod-rpcWithTLS-2021 | RFC 9289 | +---------+------------------------+-----------+ Table 2 8. References 8.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>. [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007, <https://www.rfc-editor.org/info/rfc5056>. [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, <https://www.rfc-editor.org/info/rfc5280>. [RFC5531] Thurlow, R., "RPC: Remote Procedure Call Protocol Specification Version 2", RFC 5531, DOI 10.17487/RFC5531, May 2009, <https://www.rfc-editor.org/info/rfc5531>. [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 2011, <https://www.rfc-editor.org/info/rfc6125>. [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, "Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, July 2014, <https://www.rfc-editor.org/info/rfc7301>. [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 2015, <https://www.rfc-editor.org/info/rfc7525>. [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/info/rfc8126>. [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>. [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <https://www.rfc-editor.org/info/rfc8446>. [RFC9147] Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", RFC 9147, DOI 10.17487/RFC9147, April 2022, <https://www.rfc-editor.org/info/rfc9147>. [RFC9266] Whited, S., "Channel Bindings for TLS 1.3", RFC 9266, DOI 10.17487/RFC9266, July 2022, <https://www.rfc-editor.org/info/rfc9266>. [X.509] International Telecommunication Union, "Information technology - Open Systems Interconnection - The Directory: Public-key and attribute certificate frameworks", ISO/ IEC 9594-8, ITU-T Recommendation X.509, October 2019. [X.680] ITU-T, "Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation", ITU-T Recommendation X.680, February 2021, <https://www.itu.int/rec/T-REC-X.680>. [X.690] ITU-T, "Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)", ITU-T Recommendation X.690, February 2021, <https://www.itu.int/rec/T-REC-X.690>. 8.2. Informative References [RFC1833] Srinivasan, R., "Binding Protocols for ONC RPC Version 2", RFC 1833, DOI 10.17487/RFC1833, August 1995, <https://www.rfc-editor.org/info/rfc1833>. [RFC2203] Eisler, M., Chiu, A., and L. Ling, "RPCSEC_GSS Protocol Specification", RFC 2203, DOI 10.17487/RFC2203, September 1997, <https://www.rfc-editor.org/info/rfc2203>. [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 2012, <https://www.rfc-editor.org/info/rfc6698>. [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., Morris, J., Hansen, M., and R. Smith, "Privacy Considerations for Internet Protocols", RFC 6973, DOI 10.17487/RFC6973, July 2013, <https://www.rfc-editor.org/info/rfc6973>. [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 2014, <https://www.rfc-editor.org/info/rfc7258>. [RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection Most of the Time", RFC 7435, DOI 10.17487/RFC7435, December 2014, <https://www.rfc-editor.org/info/rfc7435>. [RFC8166] Lever, C., Ed., Simpson, W., and T. Talpey, "Remote Direct Memory Access Transport for Remote Procedure Call Version 1", RFC 8166, DOI 10.17487/RFC8166, June 2017, <https://www.rfc-editor.org/info/rfc8166>. [RFC8167] Lever, C., "Bidirectional Remote Procedure Call on RPC- over-RDMA Transports", RFC 8167, DOI 10.17487/RFC8167, June 2017, <https://www.rfc-editor.org/info/rfc8167>. [RFC8899] Fairhurst, G., Jones, T., Tüxen, M., Rüngeler, I., and T. Völker, "Packetization Layer Path MTU Discovery for Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, September 2020, <https://www.rfc-editor.org/info/rfc8899>. [RFC9110] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "HTTP Semantics", STD 97, RFC 9110, DOI 10.17487/RFC9110, June 2022, <https://www.rfc-editor.org/info/rfc9110>. Appendix A. Known Weaknesses of the AUTH_SYS Authentication Flavor The ONC RPC protocol, as specified in [RFC5531], provides several modes of security, commonly referred to as "authentication flavors". Some of these flavors provide much more than an authentication service. We refer to these as authentication flavors, security flavors, or simply, flavors. One of the earliest and most basic flavors is AUTH_SYS, also known as AUTH_UNIX. Appendix A of [RFC5531] specifies AUTH_SYS. AUTH_SYS assumes that the RPC client and server both use POSIX-style user and group identifiers (each user and group can be distinctly represented as a 32-bit unsigned integer). It also assumes that the client and server both use the same mapping of user and group to an integer. One user ID, one primary group ID, and up to 16 supplemental group IDs are associated with each RPC request. The combination of these identifies the entity on the client that is making the request. A string identifies peers (hosts) in each RPC request. [RFC5531] does not specify any requirements for this string other than that it is no longer than 255 octets. It does not have to be the same from request to request. Also, it does not have to match the DNS hostname of the sending host. For these reasons, even though most implementations fill in their hostname in this field, receivers typically ignore its content. Appendix A of [RFC5531] contains a brief explanation of security considerations: | It should be noted that use of this flavor of authentication does | not guarantee any security for the users or providers of a | service, in itself. The authentication provided by this scheme | can be considered legitimate only when applications using this | scheme and the network can be secured externally, and privileged | transport addresses are used for the communicating end-points (an | example of this is the use of privileged TCP/UDP ports in UNIX | systems -- note that not all systems enforce privileged transport | address mechanisms). It should be clear, therefore, that AUTH_SYS by itself (i.e., without strong client authentication) offers little to no communication security: 1. It does not protect the confidentiality or integrity of RPC requests, users, or payloads, relying instead on "external" security. 2. It does not provide authentication of RPC peer machines, other than inclusion of an unprotected domain name. 3. The use of 32-bit unsigned integers as user and group identifiers is problematic because these data types are not cryptographically signed or otherwise verified by any authority. In addition, the mapping of these integers to users and groups has to be consistent amongst a server and its cohort of clients. 4. Because the user and group ID fields are not integrity protected, AUTH_SYS does not provide non-repudiation. Appendix B. ASN.1 Module The following module adheres to ASN.1 specifications [X.680] and [X.690]. <CODE BEGINS> RPCwithTLS-2021 { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-rpcWithTLS-2021(105) } DEFINITIONS IMPLICIT TAGS ::= BEGIN -- OID Arc id-kp OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) kp(3) } -- Extended Key Usage Values id-kp-rpcTLSClient OBJECT IDENTIFIER ::= { id-kp 33 } id-kp-rpcTLSServer OBJECT IDENTIFIER ::= { id-kp 34 } END <CODE ENDS> Acknowledgments Special mention goes to Charles Fisher, author of "Encrypting NFSv4 with Stunnel TLS" <https://www.linuxjournal.com/content/encrypting- nfsv4-stunnel-tls>. His article inspired the mechanism described in the current document. Many thanks to Benjamin Coddington, Tigran Mkrtchyan, and Rick Macklem for their work on prototype implementations and feedback on the current document. Also, thanks to Benjamin Kaduk for his expert guidance on the use of PKIX and TLS and to Russ Housley for his ASN.1 expertise and for providing other proper finishing touches. In addition, the authors thank the other members of the IESG for their astute review comments. These contributors made this a significantly better document. Thanks to Derrell Piper for numerous suggestions that improved both this simple mechanism and the current document's security-related discussion. Many thanks to Transport Area Director Magnus Westerlund for his sharp questions and careful reading of the final revisions of the current document. The text of Section 5.1.2 is mostly his contribution. The authors are additionally grateful to Bill Baker, David Black, Alan DeKok, Lars Eggert, Olga Kornievskaia, Greg Marsden, Alex McDonald, Justin Mazzola Paluska, Tom Talpey, Martin Thomson, and Nico Williams for their input and support of this work. Finally, special thanks to NFSV4 Working Group Chair and document shepherd David Noveck, NFSV4 Working Group Chairs Spencer Shepler and Brian Pawlowski, and NFSV4 Working Group Secretary Thomas Haynes for their guidance and oversight. Authors' Addresses Trond Myklebust Hammerspace Inc. 4300 El Camino Real, Suite 105 Los Altos, CA 94022 United States of America Email: trond.myklebust@hammerspace.com Charles Lever (editor) Oracle Corporation United States of America Email: chuck.lever@oracle.com