Remote Procedure Call Encryption By Default
Hammerspace Inc
4300 El Camino Real Ste 105Los AltosCA94022United States of Americatrond.myklebust@hammerspace.comOracle CorporationUnited States of Americachuck.lever@oracle.com
Transport
Network File System Version 4
This document describes a mechanism that enables
encryption of in-transit Remote Procedure Call (RPC)
transactions with minimal administrative overhead and
full interoperation with ONC RPC implementations that
do not support this mechanism.
This document updates RFC 5531.
In 2014 the IETF published
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 and its antecedants).
Eisler et al. first introduced an in-transit encryption mechanism
for RPC with RPCSEC GSS over twenty years ago
.
However, experience has shown that RPCSEC GSS
is difficult to deploy:
Per-client deployment and administrative costs
are not scalable.
Keying material must be provided for each RPC client,
including transient clients.
Parts of the RPC header remain in clear-text,
and can constitute a significant security exposure.
On-host cryptographic manipulation of data payloads can
exact a significant CPU cost on both clients and the server.
Host identity management and user identity management
must be carried out in the same security realm.
In certain environments, different authorities
might be responsible for provisioning client systems versus
provisioning new users.
However strong a privacy service is,
it can not provide any security if the difficulties
of deploying and 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
(TLS) is a well-established Internet building block that
protects many common Internet protocols such as
the Hypertext Transport Protocol (http)
.
Encrypting at the RPC transport layer
enables several significant benefits.
In-transit encryption can be enabled
without additional administrative actions such as
identifying the host system to a trust authority,
generating additional key material, or
provisioning a secure network tunnel.
The imposition of encryption at the transport layer protects
any Upper Layer protocol that employs RPC,
without alteration of that protocol.
RPC transport layer encryption can protect
recent versions of NFS such as NFS version 4.2
and indeed legacy NFS versions such as NFS version 3
and NFS side-band protocols such as the MNT protocol
.
TLS can be used to authenticate hosts using certificates
while other security mechanisms can handle user authentictation.
The use of a well-established transport encryption mechanism
that is also employed by other very common network protocols
makes it likely that a hardware encryption implementation
will be available to offload encryption and decryption.
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
when, and only when, they appear in all capitals, as shown here.
This document adopts the terminology introduced in Section 3 of
and assumes a working knowledge of
the Remote Procedure Call (RPC) version 2 protocol
and
the Transport Layer Security (TLS) version 1.3 protocol
.
Note also that the NFS community uses the term "privacy"
where other Internet communities use "confidentiality".
In this document the two terms are synonymous.
In this section we cleave to the convention that a "client"
is the peer host that actively initiates a connection, and
a "server" is the peer host that passively accepts a connection request.
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.
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 length of the opaque data constituting the credential
sent in the 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 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:
If the RPC server does not recognise the AUTH_TLS authentication flavor,
it responds with a reject_stat of AUTH_ERROR.
The RPC client then knows that this server does not support TLS.
If the RPC server accepts the NULL RPC procedure,
but fails to return an AUTH_NONE verifier containing the
string "STARTTLS",
the RPC client knows that this server does not support TLS.
If the RPC server accepts the NULL RPC procedure,
and returns an AUTH_NONE verifier containing the string "STARTTLS",
the RPC client SHOULD proceed with TLS negotiation.
If an RPC client attempts to use AUTH_TLS
for anything other than the NULL RPC procedure,
the RPC server responds with a reject_stat of AUTH_ERROR.
In addition, a client MUST NOT attempt a TLS handshake
after the initial exchange.
Once the TLS handshake is complete,
the RPC client and server will have established
a secure channel for communicating
and can proceed to use standard security flavors within that channel,
presumably after negotiating down the
irrelevant RPCSEC_GSS privacy and integrity services
and applying channel binding
.
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.
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.
Toward these ends, there are two deployment modes.
In a basic deployment,
a server possesses a unique global identity
(e.g., a certificate that is self-signed
or signed by a well-known trust anchor)
while its clients are anonymous
(i.e., present no identifier).
In this situation, the client SHOULD authenticate the server host
using the presented TLS identity,
but the server cannot authenticate connecting clients.
Here, a TLS session is established
and the RPC requests in transit carry user and group identities
according to the conventions of the RPC protocol.
In this type of deployment,
both the server and its clients possess unique identities
(e.g., certificates).
As part of the TLS handshake, both peer hosts SHOULD authenticate
using the presented TLS identities.
Should authentication of either peer fail,
or should authorization based on those identities block access
to the server, the connection MAY be rejected.
However, once a TLS session is established,
the server MUST NOT utilize TLS identity for the purpose of authorizing
RPC requests.
In some cases, a client might choose to present a certificate
that represents a user rather than one that is bound to the client host.
As above, the server MUST NOT utilize this identity for the purpose
of authorizing RPC requests.
The TLS identities of the peer hosts are fully independent
of RPC user identities.
RPCSEC GSS can provide
integrity
or
privacy (also known as confidentiality) services.
When operating over a TLS session, these services become redundant.
Each RPC implementation is responsible for using channel binding
for detecting when GSS integrity or privacy is unnecessary and can
therefore be disabled.
See Section 2.5 of for details.
Note that 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:
Implementations MUST NOT negotiate TLS versions prior to v1.3
.
Support for mandatory-to-implement ciphersuites for
the negotiated TLS version is REQUIRED.
Implementations MUST support certificate-based mutual authentication.
Support for TLS-PSK mutual authentication
is OPTIONAL.
See
for further details.
Negotiation of a ciphersuite providing for confidentiality as
well as integrity protection is REQUIRED.
Support for and negotiation of compression is OPTIONAL.
RPC over TCP is protected by using TLS
.
As soon as a client completes the TCP handshake,
it uses the mechanism described in
to discover TLS support and then negotiate a TLS session.
RPC over UDP is protected using DTLS
.
As soon as a client initializes a socket for use with
an unfamiliar server,
it uses the mechanism described in
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.
RPC-over-RDMA
can make use of Transport Layer Security below the RDMA transport layer
.
The exact mechanism is not within the scope of this document.
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 client is uniquely identified
by the tuple (serial number of presented client certificate;Issuer).
Implementations MUST allow the configuration of a list of
trusted Certification Authorities for incoming connections.
Certificate validation MUST include the verification rules as per
.
Implementations SHOULD indicate their trusted Certification
Authorities (CAs).
Peer validation always includes a check on whether the
locally configured expected DNS name or IP address of the
server that is contacted matches its presented certificate.
DNS names and IP addresses can be contained in the Common
Name (CN) or subjectAltName entries.
For verification, only one of these entries is to be considered.
The following precedence applies: for DNS name validation,
subjectAltName:DNS has precedence over CN; for IP address
validation, subjectAltName:iPAddr has precedence over CN.
Implementors of this specification are advised to read
Section 6 of
for more details on DNS name validation.
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
or a set of allowed X509v3 Certificate Policies).
When the configured trust base changes (e.g., removal of a
CA from the list of trusted CAs; issuance of a new CRL for
a given CA), implementations MAY renegotiate the TLS
session to reassess the connecting peer's continued
authorization.
Having identified 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:
Originating IP address
Certificate Fingerprint
Issuer
Subject
all X509v3 Extended Key Usage
all X509v3 Subject Alternative Name
all X509v3 Certificate Policies
This mechanism is OPTIONAL to implement.
In this mode, an RPC client is uniquely identified
by the fingerprint of the presented client 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 client is uniquely identified by its TLS
identifier.
At least the following parameters of the TLS connection should be exposed:
Originating IP address
TLS Identifier
This mechanism is OPTIONAL to implement.
In this mode, an RPC client 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
.
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
.
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.
The Linux Foundation
https://www.kernel.org
Prototype software based on early versions of this document.
The bulk of this specification is implemented.
The use of DTLS functionality is not implemented.
GPLv2
No comments from implementors.
DESY
https://desy.de
Prototype software based on early versions of this document.
The bulk of this specification is implemented.
The use of DTLS functionality is not implemented.
Freely distributable with acknowledgment.
No comments from implementors.
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
.
In addition, Section 6 of
contains a detailed discussion
of technologies used in conjunction with TLS.
Implementers should familiarize themselves with these materials.
The NFS version 4 protocol permits more than one user to
use an NFS client at the same time
.
Typically that NFS client will conserve connection resources
by routing RPC transactions from all of its users over a few
or a single connection.
In circumstances where the users on that NFS client belong
to multiple distinct security domains,
the client MUST establish independent TLS sessions
for each distinct security domain.
Ever since the IETF NFSV4 Working Group took over
the maintenance of the NFSv4 family of protocols
(currently specified in
,
,
and
,
among others),
it has encouraged the use of RPCSEC GSS over AUTH_SYS.
For various reasons,
unfortunately AUTH_SYS continues to be
the primary authentication mechanism deployed by NFS administrators.
As a result, NFS security remains in an unsatisfactory state.
A deeper purpose of this document is to attempt to address
some of the shortcomings of AUTH_SYS so that,
where it has been impractical to deploy RPCSEC GSS,
better NFSv4 security can nevertheless be achieved.
When AUTH_SYS is used with TLS and no client certificate is available,
the RPC server is still acting on RPC requests for which there is
no trustworthy authentication.
In-transit traffic is protected, but the client itself can still
misrepresent user identity without detection.
This is an improvement from AUTH_SYS without encryption, but it
leaves a critical security exposure.
Therefore, the RECOMMENDED deployment mode is that
clients have certificate material configured and used
so that servers can have a degree of trust
that clients are acting responsibly.
In accordance with Section 6 of
,
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.
SunRPC
0x73 0x75 0x6e 0x72 0x70 0x63 ("sunrpc")
RFC-TBD
.
Special mention goes to Charles Fisher, author of
"Encrypting NFSv4 with Stunnel TLS"
.
His article inspired the mechanism described in this document.
The authors are grateful to
Bill Baker,
David Black,
Alan DeKok,
Lars Eggert,
Benjamin Kaduk,
Greg Marsden,
Alex McDonald,
Tigran Mkrtchyan,
David Noveck,
Justin Mazzola Paluska,
and
Tom Talpey
for their input and support of this work.
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.