RFC 9289

Towards Remote Procedure Call Encryption by Default

๐Ÿ“… published September 2022, from ietf

1. Introduction ๐ŸŒธ

Okay bestie, here's the vibe. This RFC is RFC 9289: Towards Remote Procedure Call Encryption by Default ๐ŸŽ€. It was written by T. Myklebust from Hammerspace and C. Lever, Ed. from Oracle. It's a Standards Track document from the IETF, dated September 2022, with ISSN 2070-1721. It updates RFC 5531 ๐Ÿ”ฅ, which is the RPC version 2 spec.

Abstract ๐Ÿ’–

This document describes a mechanism that uses opportunistic Transport Layer Security (TLS) to encrypt Remote Procedure Call (RPC) transactions while they're in transit โœจ. The proposed mechanism plays nicely with Open Network Computing (ONC) RPC implementations that don't support it yet ๐Ÿซถ. This document updates RFC 5531.

Status of This Memo ๐Ÿ“‹

This is an Internet Standards Track document. It's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community ๐ŸŒˆ. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG). For more on Internet Standards, check Section 2 of RFC 7841.

Info about the current status of this document, any errata, and how to send feedback lives at https://www.rfc-editor.org/info/rfc9289 ๐Ÿ’œ.

Copyright (c) 2022 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) as they're in effect on the date of publication. Please actually read these, because they describe your rights and restrictions for this document ๐Ÿ™ˆ. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Revised BSD License.

Table of Contents ๐Ÿ“œ

   1.  Introduction
   2.  Requirements Language
   3.  Terminology
   4.  RPC-with-TLS in Operation
     4.1.  Discovering Server-Side TLS Support
     4.2.  Authentication
       4.2.1.  Using TLS with RPCSEC_GSS
   5.  TLS Requirements
     5.1.  Base Transport Considerations
       5.1.1.  Protected Operation on TCP
       5.1.2.  Protected Operation on UDP
       5.1.3.  Protected Operation on Other Transports
     5.2.  TLS Peer Authentication
       5.2.1.  X.509 Certificates Using PKIX Trust
         5.2.1.1.  Extended Key Usage Values
       5.2.2.  Pre-shared Keys
   6.  Security Considerations
     6.1.  The Limitations of Opportunistic Security
       6.1.1.  STRIPTLS Attacks
       6.1.2.  Privacy Leakage before Session Establishment
     6.2.  TLS Identity Management on Clients
     6.3.  Security Considerations for AUTH_SYS on TLS
     6.4.  Best Security Policy Practices
   7.  IANA Considerations
     7.1.  RPC Authentication Flavor
     7.2.  ALPN Identifier for SunRPC
     7.3.  Object Identifier for PKIX Extended Key Usage
     7.4.  Object Identifier for ASN.1 Module
   8.  References
     8.1.  Normative References
     8.2.  Informative References
   Appendix A.  Known Weaknesses of the AUTH_SYS Authentication Flavor
   Appendix B.  ASN.1 Module
   Acknowledgments
   Authors' Addresses

1. Introduction ๐ŸŒธ

Okay so back in 2014 the IETF put out a doc called "Pervasive Monitoring Is an Attack" [RFC7258]. It pointed out that unauthorized snooping on network traffic had gotten super widespread and was a subversive threat to everyone using the Internet ๐Ÿ˜ญ. It strongly recommended that newly defined Internet protocols should make a genuine effort to mitigate monitoring attacks. Usually that mitigation means encrypting data in transit ๐Ÿ”.

RPC version 2 has been a Proposed Standard for three whole decades (see [RFC5531] and its antecedents) ๐Ÿ‘‘. Over twenty years ago, Eisler et al. first brought in RPCSEC_GSS as an in-transit encryption mechanism for RPC [RFC2203]. The tea, though? Experience has shown that RPCSEC_GSS with in-transit encryption can be a real challenge to use in practice, mainly because of the following:

  • Parts of each RPC header stay in cleartext, which is a loss of metadata confidentiality ๐Ÿ™ˆ.
  • Offloading the Generic Security Service (GSS) privacy service isn't practical in large multi-user deployments, since each message is encrypted using a key based on the issuing RPC user ๐Ÿ’€.

Here's the thing: however strong GSS-provided confidentiality is, it can't do anything for security if the hassle of using it means people just don't deploy it at all ๐Ÿ˜ค.

Moreover, AUTH_SYS is still super common even though accepting User Identifiers (UIDs) and Group Identifiers (GIDs) from unauthenticated clients brings real problems with it ๐Ÿšฉ. It keeps sticking around partly because:

  • The only well-defined alternative to AUTH_SYS costs a lot per client at scale. For example, admins have to hand out keying material for each RPC client, transient clients included ๐Ÿ’ธ.
  • GSS host identity management and user identity management usually have to be enforced in the same security realm. But cloud providers, for instance, might want to stay in charge of host identity while letting tenants manage user identities inside their own private networks ๐Ÿงš.

So given all the challenges with the mechanisms we have right now for authenticating RPC transactions and protecting their confidentiality, this document specifies a transport-layer security mechanism that complements the existing ones ๐Ÿฆ‹. The TLS [RFC8446] and Datagram Transport Layer Security (DTLS) [RFC9147] protocols are well-established Internet building blocks that already protect lots of standard protocols, like the Hypertext Transfer Protocol (HTTP) [RFC9110] ๐Ÿ’œ.

Encrypting at the RPC transport layer comes with some major perks:

  • Encryption by Default: Transport encryption can be switched on without extra admin tasks, like identifying client systems to a trust authority and handing each one keying material ๐Ÿ”‘.
  • Encryption Offload: Hardware support for the GSS privacy service hasn't shown up in the marketplace. But using a well-established transport encryption mechanism, the same kind other ubiquitous network protocols use, makes encryption offload for RPC more likely to be practicable ๐ŸŒŸ.
  • Securing AUTH_SYS: This is the big one ๐Ÿ”ฅ. Transport encryption can significantly reduce several security issues that come with the current widespread use of AUTH_SYS (that is, accepting UIDs and GIDs generated by an unauthenticated client).
  • Decoupled User and Host Identities: TLS can authenticate peer hosts while other security mechanisms handle user authentication ๐ŸŽ€.
  • Compatibility: Imposing encryption at the transport layer protects any upper-layer protocol that uses RPC, without changing the upper-layer protocol itself ๐Ÿซถ.

Further, Section 6 of the current document defines policies in line with [RFC7435] that let RPC-with-TLS get deployed opportunistically in environments that have RPC implementations which don't support TLS ๐Ÿฆ‹. However, specifications for RPC-based upper-layer protocols should choose to require even stricter policies that guarantee encryption and host authentication are used for all RPC transactions, to guard against pervasive monitoring attacks [RFC7258]. Enforcing RPC-with-TLS is especially important for existing upper-layer protocols whose security infrastructure is weak ๐Ÿšจ.

The protocol specification in the current document assumes that support for ONC RPC [RFC5531], TLS [RFC8446], PKIX [RFC5280], DNSSEC/DNS-Based Authentication of Named Entities (DANE) [RFC6698], and optionally RPCSEC_GSS [RFC2203] is already available on the platform where RPC-with-TLS support is going to be added ๐Ÿงš.

2. Requirements Language ๐Ÿ”‘

Bestie, this part is about the capital-letter words. 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 read as described in BCP 14 [RFC2119] [RFC8174]. That only applies when, and only when, they show up in all capitals, exactly like that ๐Ÿ’….

3. Terminology ๐Ÿ“–

This document uses the terminology from Section 3 of [RFC6973], and it assumes you already know the RPC version 2 protocol [RFC5531] and the TLS version 1.3 protocol [RFC8446] ๐Ÿง .

Also, the NFS community adopted the word "privacy" a long time ago, from documents like [RFC2203]. In this document, "privacy" only refers to the historic GSS privacy service defined in [RFC2203]. Everywhere else, the authors say "confidentiality", which is what the modern security communities use ๐ŸŒธ.

We stick to the convention that a "client" is a network host that actively starts an association, and a "server" is a network host that passively accepts an association request ๐Ÿ’–.

RPC docs have historically called the authentication of a connecting host "machine authentication" or "host authentication". TLS docs call the same thing "peer authentication". In this document there's not much difference between these terms โœจ.

Finally, "user authentication" here refers specifically to the RPC caller's credential, which shows up in the cred and verf fields of each RPC Call ๐Ÿ”.

4. RPC-with-TLS in Operation ๐Ÿ”

Okay, we're getting into the good stuff now! ๐ŸŒˆ

4.1. Discovering Server-Side TLS Support โœจ

Okay bestie, the mechanism in this doc plays perfectly with RPC implementations that don't support RPC-with-TLS at all ๐Ÿซถ. When an RPC-with-TLS-enabled peer runs into one of those, its policy settings decide whether RPC keeps going without TLS or gets shut down completely ๐Ÿ’….

To make that work, we introduce a brand-new RPC authentication flavor called AUTH_TLS ๐ŸŽ€. It basically says "hey, I'd love to start TLS if you're down" ๐Ÿ’–. Apart from the changes in this section, RPC is totally unaware of any security wrapping at the transport layer ๐Ÿ™ˆ. The value of AUTH_TLS is defined in Section 7.1.

First things first: an RPC client picks a transport and a destination port ๐Ÿฆ‹. That choice usually depends on which RPC program you want. The client might ask the RPC server's RPCBIND service to help with this choice (RPCBIND is described in [RFC1833]) ๐Ÿงš. This mechanism only works with TCP and UDP, no other RPC transports ๐Ÿ’…. And in every case, an RPC server MUST listen on the same ports for (D)TLS-protected RPC programs as the ports it uses when (D)TLS isn't available. Same ports, no drama ๐ŸŒธ.

To protect RPC traffic on a TCP port, the client opens a TCP connection to that port and sends a NULL RPC procedure with an auth_flavor of AUTH_TLS on that connection ๐Ÿ“. To protect RPC traffic on a UDP port, the client sends a UDP datagram to that port containing a NULL RPC procedure with an auth_flavor of AUTH_TLS ๐Ÿ’œ. The client builds this RPC procedure like so:

  • The length of the opaque data constituting the credential sent in the RPC Call message MUST be zero.
  • The verifier accompanying the credential MUST be an AUTH_NONE verifier of length zero.
  • The flavor value of the verifier in the RPC Reply message received from the server MUST be AUTH_NONE.
  • The length of the verifier's body field is eight.
  • The bytes of the verifier's body field encode the ASCII characters "STARTTLS" as a fixed-length opaque.

So the server says "yep, I do RPC-with-TLS" by replying with a reply_stat of MSG_ACCEPTED and an AUTH_NONE verifier containing the "STARTTLS" token ๐Ÿ”ฅ. The client SHOULD go ahead with TLS session establishment, even if the Reply's accept_stat is not SUCCESS ๐Ÿ™Œ. If the AUTH_TLS probe went over TCP, the RPC client MUST send the "ClientHello" message on that same connection. If the probe went over UDP, the RPC client MUST send the "ClientHello" message to that same UDP destination port ๐ŸŽฏ.

<rose>Now the not-so-fun case</rose>, which is the opposite. If the Reply's reply_stat is not MSG_ACCEPTED, if its verifier flavor is not AUTH_NONE, or if its verifier doesn't contain the "STARTTLS" token, the RPC client MUST NOT send a "ClientHello" message ๐Ÿ™…โ€โ™€๏ธ. RPC operation may continue, depending on local policy, but without the confidentiality, integrity, or peer authentication protection that (D)TLS would give ๐Ÿ˜ญ.

If the TLS handshake fails for any reason after a successful RPC AUTH_TLS probe, the RPC client reports that failure to the upper-layer application the same way it reports an AUTH_ERROR rejection from the RPC server. Don't let it slide, bestie ๐Ÿ‘€.

If an RPC client uses the AUTH_TLS flavor on any procedure other than the NULL procedure, or if it sends an RPC AUTH_TLS probe inside an existing (D)TLS session, the RPC server MUST reject that RPC Call by returning a reply_stat of MSG_DENIED with a reject_stat of AUTH_ERROR and an auth_stat of AUTH_BADCRED ๐Ÿšซ.

Once the TLS handshake is done, the RPC client and server have a secure channel for swapping RPC transactions ๐Ÿ”. But a successful AUTH_TLS probe on one port/transport tuple does NOT mean RPC-with-TLS is available on that same server using a different port/transport tuple. It also doesn't promise RPC-with-TLS will be available later on the port you probed. Main character energy is not a guarantee, babe ๐Ÿ’€.


4.2. Authentication

There's some overlap between what RPC and TLS can do for authentication ๐Ÿ‘ฏ. To stay interoperable with implementations that don't support TLS, we have to limit which combinations are allowed and spell out exactly what job each layer does ๐Ÿ“‹.

Each RPC server that supports RPC-with-TLS MUST have a unique global identity (for example, a certificate signed by a well-known trust anchor) ๐Ÿ‘‘. That server MUST also request a TLS peer identity from each client on first contact ๐Ÿชช. There are two modes of client deployment:

Server-Only Host Authentication In this deployment, the client can authenticate the server host using the server's TLS peer identity, but the server can't authenticate the client. So RPC-with-TLS clients are anonymous ๐Ÿซฅ. They don't present any globally unique identifier to the server peer.

Mutual Host Authentication In this deployment, the client has an identity backed by a trusted entity (for example, a pre-shared key or a certificate validated with a certification path) ๐Ÿ—๏ธ. During the TLS handshake, both peers authenticate using the TLS identities they present. If authentication of either peer fails, or if authorization based on those identities blocks access to the server, the peers MUST reject the association โ›”. More explanation is in Section 5.2.

In either of these modes, RPC user authentication is not affected by the use of transport layer security ๐Ÿ™…. When a client presents a TLS peer identity to an RPC server, the protocol extension in this doc gives the server no way to know whether that identity represents one RPC user on that client or is shared among many RPC users ๐Ÿคทโ€โ™€๏ธ. So a server implementation can't use the remote TLS peer identity to authenticate RPC users. Plot twist, but it's real ๐ŸŽญ.

4.2.1. Using TLS with RPCSEC_GSS

To use GSS, an RPC server has to have a GSS service principal ๐Ÿช„. On a TLS session, GSS mutual (peer) authentication happens as usual, but only after a TLS session has been set up for communication ๐Ÿงฉ. Authentication of RPCSEC_GSS users doesn't change because of TLS ๐Ÿ’….

RPCSEC_GSS can also do per-request integrity or confidentiality protection. When it runs over a TLS session, though, those GSS services become largely redundant ๐Ÿ˜Œ. An RPC implementation that can use TLS and RPCSEC_GSS at the same time MUST use Generic Security Service Application Program Interface (GSS-API) channel binding, as defined in [RFC5056], to figure out when the underlying transport gives a sufficient degree of confidentiality ๐Ÿ”. RPC-with-TLS implementations MUST provide the "tls-exporter" channel binding type, as defined in [RFC9266] โœจ.


5. TLS Requirements

When peers negotiate a TLS session that's going to carry RPC, the following restrictions apply ๐Ÿ“œ:

  • Implementations MUST NOT negotiate TLS versions prior to 1.3 (for TLS [RFC8446] or DTLS [RFC9147], respectively). Support for mandatory-to-implement cipher suites for the negotiated TLS version is REQUIRED ๐Ÿšซ.
  • Implementations MUST conform to the recommendations for TLS usage specified in BCP 195 [RFC7525]. Although RFC 7525 permits the use of TLS 1.2, the requirement to use TLS 1.3 or later for RPC-with-TLS takes precedence ๐Ÿฅ‡. Also, because TLS 1.3 ciphers are qualitatively different from cipher suites in previous versions of TLS, and RFC 7525 predates TLS 1.3, the cipher suite recommendations in RFC 7525 do not apply to RPC-with-(D)TLS ๐Ÿง. A strict TLS mode for RPC-with-TLS that protects against STRIPTLS attacks is discussed in detail in Section 6.1.1 ๐Ÿ˜ฑ.
  • Implementations MUST support certificate-based mutual authentication. Support for Pre-Shared Key (PSK) mutual authentication is OPTIONAL; see Section 5.2.2 for further details ๐Ÿ”‘.
  • Negotiation of a cipher suite that provides confidentiality as well as integrity protection is REQUIRED ๐Ÿ”’.

Client implementations MUST include the "application_layer_protocol_negotiation(16)" extension [RFC7301] in their "ClientHello" message, and MUST include the protocol identifier defined in Section 7.2 in that message's ProtocolNameList value ๐Ÿ’Œ.

Similarly, in response to the "ClientHello" message, server implementations MUST include the "application_layer_protocol_negotiation(16)" extension [RFC7301] in their "ServerHello" message, and MUST include only the protocol identifier defined in Section 7.2 in that message's ProtocolNameList value ๐Ÿค.

If the server responds incorrectly (for instance, if the "ServerHello" message doesn't meet the requirements above), the client MUST NOT establish a TLS session for use with RPC on this connection ๐Ÿ™…โ€โ™€๏ธ. See [RFC7301] for more details on forming these messages properly ๐Ÿ“š.

5.1. Base Transport Considerations

There's frequently a strong association between an RPC program and a particular destination port number ๐Ÿ”—. TLS or DTLS doesn't change that association. So it's often, though not always, the case that a single TLS session carries traffic for only one RPC program ๐ŸŽ€.

5.1.1. Protected Operation on TCP

Using the TLS protocol [RFC8446] protects RPC on TCP connections ๐Ÿ›ก๏ธ. Typically, once an RPC client completes the TCP handshake, it uses the mechanism in Section 4.1 to discover RPC-with-TLS support for that RPC program on that connection ๐Ÿ”Ž. Until an AUTH_TLS probe is done on a connection, the RPC server treats all traffic as RPC messages. If spurious traffic shows up on a TCP connection between the initial cleartext AUTH_TLS probe and the TLS session handshake, receivers MUST discard that data without responding, and then SHOULD drop the connection ๐Ÿงน.

The protocol convention in this doc assumes there can be no more than one concurrent TLS session per TCP connection ๐Ÿงต. That's true for current generations of TLS, but it might be different in a future version of TLS ๐Ÿ”ฎ.

Once a TLS session is established on a TCP connection, no further cleartext communication can happen on that connection until the session ends ๐Ÿšช. Using TLS doesn't change the RPC record framing used on TCP transports ๐Ÿ“ฆ.

Also, if an RPC server responds with PROG_UNAVAIL to an RPC Call inside an established TLS session, that doesn't mean the RPC server will reject the same RPC program on a different TCP connection ๐Ÿ™ƒ.

Reverse-direction operation only happens on connected transports such as TCP (see Section 2 of [RFC8167]) ๐Ÿ”„. To protect reverse-direction RPC operations, the RPC server doesn't set up a separate TLS session on the TCP connection. Instead, it uses the existing TLS session on that connection to protect these operations ๐Ÿซถ.

When operation is complete, an RPC peer ends a TLS session by sending a TLS closure alert ๐Ÿ‘‹. It may then close the TCP connection ๐Ÿ’–.

5.1.2. Protected Operation on UDP ๐Ÿฆ‹

okay so DTLS [RFC9147] is the thing that protects RPC riding along in UDP datagrams, and it's giving main character energy ๐Ÿ’… The second a client sets up a UDP socket to talk to an RPC service, it uses the discovery trick from Section 4.1 to check whether that RPC program on that port has RPC-with-DTLS support. If spurious traffic shows up on the same 5-tuple between the initial cleartext AUTH_TLS probe and the DTLS association handshake, receivers MUST discard that traffic without response ๐Ÿ™ˆ

Using DTLS does not add reliable or in-order semantics to RPC over UDP, so don't expect those guarantees bestie ๐Ÿ’€ Turning on DTLS record replay protection is REQUIRED whenever RPC traffic is being transported.

Each RPC message MUST fit in a single DTLS record. DTLS encapsulation has overhead, which shrinks the Packetization Layer Path MTU (PLPMTU) and therefore the maximum RPC payload size. A possible PLPMTU discovery mechanism is offered in [RFC8899] โœจ

The current document does not specify a mechanism that lets a server tell DTLS traffic apart from unprotected RPC traffic sent to the same port. To make the call, each peer matches ingress datagrams that appear to be DTLS traffic against its existing DTLS session state. Any datagram that fails the matching process is treated as an RPC message.

Multihomed RPC clients and servers may send protected RPC messages through network interfaces that were not involved in the handshake that established the DTLS session. So, when protecting RPC traffic, each DTLS handshake MUST include the connection_id(54) extension described in Section 9 of [RFC9147], and RPC-with-DTLS peer endpoints MUST provide a ConnectionID with a nonzero length. Endpoints implementing RPC programs that expect a significant number of concurrent clients SHOULD employ ConnectionIDs of at least 4 bytes in length ๐Ÿซถ

Sending a TLS closure alert terminates a DTLS session. Because neither DTLS nor UDP provide in-order delivery, after session closure there can be ambiguity about whether a datagram should be interpreted as DTLS-protected or not. Therefore, receivers MUST discard datagrams exchanged using the same 5-tuple that just terminated the DTLS session for long enough to make sure retransmissions have stopped and packets already in the network have been delivered. Without more specific data, 60 seconds is expected to suffice โฐ

5.1.3. Protected Operation on Other Transports ๐ŸŒˆ

Transports that provide intrinsic TLS-level security (e.g., QUIC) need to be addressed separately from this document ๐Ÿงš In those cases, using TLS is not opportunistic the way it can be for TCP or UDP.

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 other provisions to exchange client and server certificates, authentication material exchange needs to be provided by facilities within a future version of the RPC-over-RDMA transport protocol.


5.2. TLS Peer Authentication ๐Ÿ”‘

TLS can perform peer authentication using any of the following mechanisms.

5.2.1. X.509 Certificates Using PKIX Trust ๐Ÿ“œ

X.509 certificates are specified in [X.509]. [RFC5280] provides a profile of the Internet PKI X.509 public key infrastructure. RPC-with-TLS implementations are REQUIRED to support the PKIX mechanism described in [RFC5280].

The rules and guidelines defined in [RFC6125] apply to RPC-with-TLS certificates, with the following considerations:

  • The DNS-ID identifier type is a subjectAltName extension that contains a dNSName, as defined in Section 4.2.1.6 of [RFC5280]. Support for the DNS-ID identifier type is REQUIRED in RPC-with-TLS client and server implementations. Certification authorities that issue such certificates MUST support the DNS-ID identifier type.
  • To specify the identity of an RPC peer as a domain name, the certificate MUST contain a subjectAltName extension that contains a dNSName. DNS domain names in RPC-with-TLS certificates MUST NOT contain the wildcard character * within the identifier.
  • To specify the identity of an RPC peer as a network identifier (netid) or a universal network address (uaddr), the certificate MUST contain a subjectAltName extension that contains an iPAddress.

When validating a server certificate, an RPC-with-TLS client implementation takes the following into account:

  • Certificate validation MUST include the verification rules as per Section 6 of [RFC5280] and Section 6 of [RFC6125].
  • Server certificate validation MUST include a check on whether the locally configured expected DNS-ID or iPAddress subjectAltName of the server that is contacted matches its presented certificate.
  • For RPC services accessed by their netids and uaddrs, the iPAddress subjectAltName MUST be present in the certificate and MUST exactly match the address represented by the universal network address.

An RPC client's domain name and IP address are often assigned dynamically, so RPC servers can't rely on those to verify client certificates ๐Ÿ™ƒ That's why, when an RPC-with-TLS client presents a certificate to an RPC-with-TLS server, the server takes the following into account:

  • The server MUST use a procedure conformant to Section 6 of [RFC5280] to validate the client certificate's certification path.
  • The tuple (serial number of the presented certificate; Issuer) uniquely identifies the RPC client. The meaning and syntax of these fields is defined in Section 4 of [RFC5280].

RPC-with-TLS implementations MAY allow the configuration of a set of additional properties of the certificate to check for a peer'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 this 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, this document does not provide a profile that defines the use of 0-RTT data (see Appendix E.5 of [RFC8446]).

๐Ÿšจ Because of that, RPC-with-TLS implementations MUST NOT use 0-RTT data. No exceptions, bestie.

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 ๐Ÿซฃ

Okay so, like we said earlier, RPC clients and servers are out here chatting in the open before a TLS session even exists ๐Ÿ‘€. That cleartext stuff usually includes the transport connection handshake, the RPC NULL procedure that checks whether TLS is supported, and the first bits of TLS session setup. Appendix C of [RFC8446] covers precautions that can help with exposure during the connection handshake and the TLS certificate material, since that info could help attackers track the RPC client ๐Ÿ•ต๏ธโ€โ™€๏ธ. Also, if PSK authentication is being used, the PSK identifier shows up during the TLS handshake and can be used to track the RPC client, so keep that in mind ๐Ÿ”‘.

Any RPC traffic that shows up on the network before a TLS session is established is open to monitoring or undetected modification ๐Ÿ˜ฌ. A secure client implementation limits or prevents any RPC exchanges that aren't protected, bestie ๐Ÿ’….

The one exception is the initial RPC NULL procedure that acts as a STARTTLS message, and it can't be protected ๐Ÿ™ˆ. That RPC NULL procedure has no arguments or results, and the AUTH_TLS authentication flavor it uses doesn't contain user information, so the privacy impact from this exception is negligible ๐Ÿซถ.


6.2. TLS Identity Management on Clients ๐Ÿชช

The goal of RPC-with-TLS is to hide the content of RPC requests while they're in transit ๐Ÿงš. RPC-with-TLS by itself can't protect a user's RPC requests from being exposed to other users on the same client ๐Ÿ˜ค.

Also, client implementations are free to send RPC requests for more than one RPC user over the same TLS session ๐Ÿ’…. Depending on the details of the client RPC implementation, the client's TLS credentials could be visible to every RPC user sharing that session, and privileged users might be able to access this TLS identity too ๐Ÿ‘€. So client implementations need to carefully segregate TLS credentials, so that local access is limited to only the local users who are authorized to operate 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 long-standing weaknesses in AUTH_SYS (as detailed in Appendix A) โœจ. TLS adds the integrity protection and confidentiality that AUTH_SYS is missing ๐ŸŽ€. It 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, so the message stream between RPC client and server keeps its integrity ๐Ÿงฑ. DTLS doesn't provide full message stream protection, but it does let receivers reject nonparticipant messages ๐Ÿ™…. In particular, transport-layer encryption plus peer authentication protects receiving eXternal Data Representation (XDR) decoders from deserializing untrusted data, which is a common coding vulnerability ๐Ÿšจ. However, those decoders would still be exposed to untrusted input if a trusted peer or Certification Authority were compromised ๐Ÿ’€.

The use of TLS enables strong authentication of the communicating RPC peers, which gives 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 with no trustworthy authentication ๐Ÿ˜ฌ. In-transit traffic is protected, but the RPC client itself can still misrepresent user identity without the server detecting it.

TLS without authentication is an improvement over AUTH_SYS without encryption, but it leaves a critical security exposure โš ๏ธ.

In light of the above, when AUTH_SYS is used, a TLS mutual authentication mechanism is RECOMMENDED to prove that the RPC client is known to the RPC server ๐Ÿ‘‘. The server can then decide whether the UIDs and GIDs in AUTH_SYS requests from that client can be accepted, based on the client's authenticated identity ๐Ÿ”.

The use of TLS does not enable RPC clients to detect compromise that leads to the impersonation of RPC users ๐Ÿฅฒ. There's also still 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 follow the policies below to get 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 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

Here are all the normative references, exactly as they appear in the RFC ๐Ÿซถ.

[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 โœจ


Appendix A. Known Weaknesses of the AUTH_SYS Authentication Flavor ๐Ÿ™ˆ

okay so the ONC RPC protocol, as specified in [RFC5531], comes with a bunch of security modes that people call "authentication flavors" ๐Ÿ’… some of these do way more than just authentication, so we call them authentication flavors, security flavors, or just flavors. one of the earliest and most basic ones is AUTH_SYS, also known as AUTH_UNIX ๐Ÿฆ‹ Appendix A of [RFC5531] is where AUTH_SYS gets specified.

AUTH_SYS assumes that the RPC client and server both use POSIX-style user and group identifiers, where each user and group is a 32-bit unsigned integer ๐ŸŒธ it also assumes both sides use the same mapping from user and group to that integer. each RPC request carries one user ID, one primary group ID, and up to 16 supplemental group IDs. put together, those identify the entity on the client that's making the request ๐ŸŽ€

a string identifies the peer (the host) in each RPC request ๐Ÿ’œ [RFC5531] doesn't put any requirements on this string except that it's no longer than 255 octets. it doesn't have to stay the same from request to request, and it doesn't have to match the DNS hostname of the sending host either ๐Ÿ˜ญ so even though most implementations fill in their hostname there, receivers typically ignore what's in it.

Appendix A of [RFC5531] has a short explanation of its security considerations, and it's kind of a wake-up call:

   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).

so it should be super clear that AUTH_SYS on its own (meaning without strong client authentication) gives you little to no communication security ๐Ÿ’€

  1. it does not protect the confidentiality or integrity of RPC requests, users, or payloads, and instead relies on "external" security ๐Ÿ”ฅ
  2. it does not authenticate RPC peer machines, apart from including a domain name that isn't protected ๐Ÿ™ˆ
  3. using 32-bit unsigned integers as user and group identifiers is a problem, because those values are not cryptographically signed or verified by any authority. on top of that, the mapping from these integers to users and groups has to stay consistent across a server and its whole cohort of clients ๐Ÿ˜ฌ
  4. because the user and group ID fields aren't integrity protected, AUTH_SYS does not provide non-repudiation ๐Ÿ’…

Appendix B. ASN.1 Module ๐Ÿงš

this module follows the 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 their feedback on the current document โœจ thanks also 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 ๐Ÿ‘‘ the authors also 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
๐Ÿ“ฆ where this page comes from