RFC 7861

Remote Procedure Call (RPC) Security Version 3

πŸ“… published November 2016, from ietf

RFC 7861 πŸ’– Remote Procedure Call (RPC) Security Version 3 πŸ¦‹

Authors: W. Adamson (NetApp) and N. Williams (Cryptonector) ✨ Category: Standards Track πŸ‘‘ Date: November 2016 πŸ“… Updates: RFC 5403 πŸ”₯ (the header lists no obsoletes) ISSN: 2070-1721

Abstract ✨

okay so this doc specifies version 3 of the Remote Procedure Call (RPC) security protocol, which we call RPCSEC_GSS 🧚. it's giving multi-principal authentication of client hosts and user principals to a server (built by generic composition πŸ’…), security label assertions for multi-level security and type enforcement, structured privilege assertions, and channel bindings. this document updates RFC 5403 🌸.

Status of This Memo πŸŽ€

this is an Internet Standards Track document πŸ‘‘.

it's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community 🫢. it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). if you want more on Internet Standards, check Section 2 of RFC 7841.

for the current status, any errata, and how to send feedback, look at http://www.rfc-editor.org/info/rfc7861 πŸ’œ.

Copyright (c) 2016 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 (http://trustee.ietf.org/license-info) as in effect on the date of publication. please read these carefully, bestie, because they describe your rights and restrictions for this document πŸ™ˆ. any Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License ⚠️.

Table of Contents 🧚

   1. Introduction and Motivation .....................................2
      1.1. Requirements Language ......................................3
      1.2. Added Functionality ........................................4
      1.3. XDR Code Extraction ........................................5
   2. The RPCSEC_GSSv3 Protocol .......................................6
      2.1. Compatibility with RPCSEC_GSSv2 ............................6
      2.2. Version Negotiation ........................................6
      2.3. New Reply Verifier .........................................7
      2.4. XDR Code Preliminaries .....................................8
      2.5. RPCSEC_GSS_BIND_CHANNEL Operation .........................10
      2.6. New auth_stat Values ......................................10
      2.7. New Control Procedures ....................................10
           2.7.1. New Control Procedure - RPCSEC_GSS_CREATE ..........12
           2.7.2. New Control Procedure - RPCSEC_GSS_LIST ............20
      2.8. Extensibility .............................................21
   3. Operational Recommendation for Deployment ......................21
   4. Security Considerations ........................................21
   5. IANA Considerations ............................................22
      5.1. New RPC Authentication Status Numbers .....................22
      5.2. Structured Privilege Name Definitions .....................23
           5.2.1. Initial Registry ...................................24
           5.2.2. Updating Registrations .............................24
   6. References .....................................................25
      6.1. Normative References ......................................25
      6.2. Informative References ....................................26
   Acknowledgments ...................................................26
   Authors' Addresses ................................................26

1. Introduction and Motivation 🌸

the original RPC security protocol (RPCSEC_GSS) [RFC2203] let RPC clients and servers authenticate each other using the Generic Security Service Application Programming Interface (GSS-API) [RFC2743] πŸ¦‹. then the second version of RPCSEC_GSS [RFC5403] added support for channel bindings [RFC5056] πŸ’–.

the existing GSS-API mechanisms just aren't enough for sending certain authorization and authentication info to a server 😭. the GSS-API and its mechanisms could honestly be extended to fix this, but this spec handles it at the application layer instead, meaning inside RPCSEC_GSS itself ✨.

a big reason for version 3 of RPCSEC_GSS (RPCSEC_GSSv3) is adding support for multi-level (labeled) security and server-side copy for NFSv4 πŸ”₯.

Multi-Level Security (MLS) is a traditional model where subjects (processes) get a security level (Unclassified, Secret, Top Secret, etc.) and objects (files) get security labels that control whether a subject can access an object (see Section 9.1 of [RFC7862]) πŸ‘‘.

Labeled NFS (see Section 9 of [RFC7862]) uses an MLS policy with Mandatory Access Control (MAC) systems as defined in [RFC4949] 🧚. Labeled NFS stores MAC file object labels on the NFS server and lets clients use Guest Mode MAC as described in Section 9.5.3 of [RFC7862] πŸ’…. RPCSEC_GSSv3 label assertions state a client's MAC process subject labels so Full Mode MAC works when combined with Labeled NFS, as described in Section 9.5.1 of [RFC7862] ✨.

a traditional inter-server file copy means the user gets access to a file on the source, reads it, and writes it to a file on the destination πŸ™ˆ. in secure NFSv4 inter-server server-side copy (see Section 4 of [RFC7862]), the user first secures access to both the source and destination files, then uses the NFSv4.2-defined RPCSEC_GSSv3 structured privileges to authorize the destination to copy the file from the source on the user's behalf 🫢.

multi-principal authentication can help with shared cache poisoning attacks (see Section 9 of [AFS-RXGK]) on the client cache by a user ⚠️. as described in Section 7 of [AFS-RXGK], multi-user machines with a single cache manager can fetch and cache data on one user's behalf and then re-display it for another user from the cache without refetching it from the server πŸ’œ. the first user's credentials authenticate the initial data acquisition, so if only that user's credentials are used, a malicious user (or users) might be able to "poison" the cache for everyone else by sneaking bogus data in 😭.

another use of the multi-principal assertion is securely passing along privilege info for processes running with more (or even less) privilege than the user would normally get πŸ‘‘.

1.1. Requirements Language πŸ“œ

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] πŸ’….

1.2. Added Functionality 🌈

RPCSEC_GSS version 3 (RPCSEC_GSSv3) is the same as RPCSEC_GSSv2 [RFC5403], except that these assertions of authority were added πŸŽ€:

  • Security labels for Full Mode security type enforcement, and other labeled security models (see Section 9.5.1 of [RFC7862]).
  • Application-specific structured privileges. These let an RPC application client pass structured info to the matching application code on a server, to control how the privilege gets used and under what conditions it can be exercised. For an example, check out server-side copy as described in [RFC7862] πŸ¦‹.
  • Multi-principal authentication of the client host and user to the server, done by binding two RPCSEC_GSS handles πŸ‘‘.
  • Simplified channel binding ✨.

the server evaluates the asserted labels and privileges, and it may then map those values to other values, all according to server-side policy 🧚. see [RFC7862] πŸ’–.

there's an option for enumerating server-supported Label Format Specifiers (LFSs) πŸ“. see Section 9.1 of [RFC7862].

ok real talk, there is no RPCSEC_GSS_CREATE payload that is REQUIRED to implement πŸ™ˆ. RPCSEC_GSSv3 implementations are feature driven. Besides implementing the RPCSEC_GSS_CREATE operation and the payloads for the features you want, all RPCSEC_GSSv3 implementations MUST implement:

  • The new RPCSEC_GSS version number (Section 2.2).
  • The new reply verifier (Section 2.3).
  • The new auth_stat values (Section 2.6).

an RPCSEC_GSSv3 target that implements a desired feature MUST also implement the RPCSEC_GSS_LIST operation, and the RPCSEC_GSS_CREATE operation replies for unsupported features go like this 🌸:

  • For label assertions, the target says it doesn't support them by returning the new RPCSEC_GSS_LABEL_PROBLEM auth_stat value (see Section 2.7.1.3).
  • For structured privilege assertions, the target says no support by returning the new RPCSEC_GSS_UNKNOWN_MESSAGE auth_stat value (see Section 2.7.1.4).
  • For multi-principal authentication (Section 2.7.1.1), the target says no support by not including an rgss3_gss_mp_auth value in the rgss3_create_res.
  • For channel bindings (Section 2.7.1.2), the target says no support by not including an rgss3_chan_binding value in the rgss3_create_res.

1.3. XDR Code Extraction 🧚

this document has the External Data Representation (XDR) [RFC4506] definitions for the RPCSEC_GSSv3 protocol πŸ’œ. the XDR description is laid out so it's easy to pull out into a form that's ready to compile 🫢. you can feed this document into the following shell script to produce the machine-readable XDR description of RPCSEC_GSSv3:

<CODE BEGINS>

#!/bin/sh
grep "^  *///" | sed 's?^  */// ??' | sed 's?^  *///$??'

<CODE ENDS>

so if that script is saved as "extract.sh" and this document is saved as "spec.txt", you can run:

<CODE BEGINS>

    sh extract.sh < spec.txt > rpcsec_gss_v3.x

<CODE ENDS>

the script just strips leading white space from each line, plus a sentinel sequence of "///" πŸŽ€.

2. The RPCSEC_GSSv3 Protocol πŸ‘‘

RPCSEC_GSS version 3 (RPCSEC_GSSv3) is very similar to RPCSEC_GSS version 2 (RPCSEC_GSSv2) [RFC5403] πŸ¦‹. the difference is that the new support for assertions and channel bindings works through a different mechanism ✨.

we're not presenting the whole RPCSEC_GSSv3 protocol here. only the differences between RPCSEC_GSSv3 and RPCSEC_GSSv2 get shown πŸ’….

RPCSEC_GSSv3 works like this 🌈:

  • A client uses an existing RPCSEC_GSSv3 context handle, set up in the usual way (see Section 5.2 of [RFC2203]), to protect RPCSEC_GSSv3 exchanges. this one is called the "parent" handle πŸ“.
  • The server issues a "child" RPCSEC_GSSv3 handle in the RPCSEC_GSS_CREATE response. the child uses the underlying GSS-API security context of the parent handle in all later exchanges that use the child handle 🧚.
  • An RPCSEC_GSSv3 child handle MUST NOT be used as the parent handle in an RPCSEC_GSS3_CREATE control message πŸ™ˆ.

2.1. Compatibility with RPCSEC_GSSv2 πŸ’–

the functionality of RPCSEC_GSSv2 [RFC5403] is fully supported by RPCSEC_GSSv3, with one exception: the RPCSEC_GSS_BIND_CHANNEL operation isn't supported when RPCSEC_GSSv3 is in use (see Section 2.5) 😭.

2.2. Version Negotiation

An initiator that supports version 3 of RPCSEC_GSS just sends an RPCSEC_GSS request with the rgc_version field set to RPCSEC_GSS_VERS_3. ✨ If the target doesn't recognize RPCSEC_GSS_VERS_3, it will send back an RPC error per Section 5.1 of [RFC2203]. πŸ¦‹

The initiator MUST NOT try to use an RPCSEC_GSS handle that a version 3 target handed out with version 1 or version 2 of that same target. πŸ™…β€β™€οΈ The initiator also MUST NOT try to use an RPCSEC_GSS handle that version 1 or version 2 handed out with version 3 of that same target. Keep your handles in their lane, bestie! πŸ’…

2.3. New Reply Verifier

RPCSEC_GSSv3 needs a brand-new reply verifier, and the reason is kind of dramatic 😭. The child and parent handles both use the same GSS context, so a child handle and its parent handle could end up with the same RPCSEC_GSS sequence numbers. Older versions of RPCSEC_GSS compute the reply verifier as a Message Integrity Code (MIC) over just the sequence number, and that leaves room for man-in-the-middle attacks. Not okay! πŸ’€

So version 3 fixes it by building the verifier from exactly the same input used for the request verifier, with one change: mtype goes from CALL to REPLY. 🧩 The new reply verifier computes a MIC over the following RPC reply header data:

unsigned int xid;
msg_type mtype;    /* set to REPLY */
unsigned int rpcvers;
unsigned int prog;
unsigned int vers;
unsigned int proc;
opaque_auth  cred; /* binds the RPCSEC_GSS handle */

2.4. XDR Code Preliminaries

This code fragment replaces the matching preliminary code from Figure 1 of [RFC5403]. The values in the code fragment in Section 2.6 are additions to the auth_stat enumeration. Any later code fragments are additions to the version 2 code that support the new version 3 procedures. πŸŽ€

Here's the code πŸ‘€

///  /*
///   * Copyright (c) 2016 IETF Trust and the persons
///   * identified as the authors.  All rights reserved.
///   *
///   * The authors of the code are identified in RFC 2203,
///   * RFC 5403, and RFC 7861.
///   *
///   * Redistribution and use in source and binary forms,
///   * with or without modification, are permitted
///   * provided that the following conditions are met:
///   *
///   * o Redistributions of source code must retain the above
///   *   copyright notice, this list of conditions and the
///   *   following disclaimer.
///   *
///   * o Redistributions in binary form must reproduce the
///   *   above copyright notice, this list of
///   *   conditions and the following disclaimer in
///   *   the documentation and/or other materials
///   *   provided with the distribution.
///   *
///   * o Neither the name of Internet Society, IETF or IETF
///   *   Trust, nor the names of specific contributors, may be
///   *   used to endorse or promote products derived from this
///   *   software without specific prior written permission.
///   *
///   *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
///   *   AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
///   *   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
///   *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
///   *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
///   *   EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
///   *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
///   *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
///   *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
///   *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
///   *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
///   *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
///   *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
///   *   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
///   *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///   */
///
///  /*
///   * This code was derived from RFC 2203, RFC 5403,
///   * and RFC 7861.  Please reproduce this note if possible.
///   */
///
///  enum rpc_gss_service_t {
///          /* Note: The enumerated value for 0 is reserved. */
///          rpc_gss_svc_none         = 1,
///          rpc_gss_svc_integrity    = 2,
///          rpc_gss_svc_privacy      = 3,
///          rpc_gss_svc_channel_prot = 4
///  };
///
///  enum rpc_gss_proc_t {
///           RPCSEC_GSS_DATA          = 0,
///           RPCSEC_GSS_INIT          = 1,
///           RPCSEC_GSS_CONTINUE_INIT = 2,
///           RPCSEC_GSS_DESTROY       = 3,
///           RPCSEC_GSS_BIND_CHANNEL  = 4, /* Not used */
///           RPCSEC_GSS_CREATE        = 5, /* New */
///           RPCSEC_GSS_LIST          = 6  /* New */
///  };
///
///  struct rpc_gss_cred_vers_1_t {
///          rpc_gss_proc_t    gss_proc; /* Control procedure */
///          unsigned int      seq_num;  /* Sequence number */
///          rpc_gss_service_t service;  /* Service used */
///          opaque            handle<>; /* Context handle */
///  };
///
///  const RPCSEC_GSS_VERS_1 = 1;
///  const RPCSEC_GSS_VERS_2 = 2;
///  const RPCSEC_GSS_VERS_3 = 3; /* New */
///
///  union rpc_gss_cred_t switch (unsigned int rgc_version) {
///  case RPCSEC_GSS_VERS_1:
///  case RPCSEC_GSS_VERS_2:
///  case RPCSEC_GSS_VERS_3: /* New */
///          rpc_gss_cred_vers_1_t rgc_cred_v1;
///  };
///

As you can see above, the RPCSEC_GSSv3 credential has the same format as the RPCSEC_GSSv1 [RFC2203] and RPCSEC_GSSv2 [RFC5403] credential. 🧁 Setting the rgc_version field to 3 tells you the initiator and target support the new RPCSEC_GSSv3 control procedures. 🫢

2.5. RPCSEC_GSS_BIND_CHANNEL Operation

RPCSEC_GSSv3 has a channel-binding assertion that takes over for the RPCSEC_GSSv2 RPCSEC_GSS_BIND_CHANNEL operation. πŸ”„

The RPCSEC_GSS_BIND_CHANNEL operation is NOT supported on RPCSEC_GSS version 3 handles. 🚫 If a server gets an RPCSEC_GSS_BIND_CHANNEL operation on an RPCSEC_GSSv3 handle, it MUST return a reply status of MSG_ACCEPTED with an accept_stat of PROC_UNAVAIL [RFC5531]. Oof, that's a hard no. πŸ’€

Heads up: a server that gets RPCSEC_GSS_BIND_CHANNEL on a v3 handle has to reply with PROC_UNAVAIL, full stop πŸ™ˆ

2.6. New auth_stat Values

RPCSEC_GSSv3 needs a few new values added to the auth_stat enumerated type. 🌈 You'll see how these new auth_stat values get used all through this document. πŸ¦‹

enum auth_stat {
        ...
        /*
         * RPCSEC_GSSv3 errors
         */
        RPCSEC_GSS_INNER_CREDPROBLEM = 15,
        RPCSEC_GSS_LABEL_PROBLEM     = 16,
        RPCSEC_GSS_PRIVILEGE_PROBLEM = 17,
        RPCSEC_GSS_UNKNOWN_MESSAGE   = 18
};

2.7. New Control Procedures

There are two brand-new RPCSEC_GSSv3 control procedures: RPCSEC_GSS_CREATE and RPCSEC_GSS_LIST. πŸ‘‘

The RPCSEC_GSS_CREATE procedure binds any combo of assertions (multi-principal authentication, labels, structured privileges, or channel bindings) to a new RPCSEC_GSSv3 context. That context comes back in the rgss3_create_res rcr_handle field. ✨

The RPCSEC_GSS_LIST procedure asks the target which assertions it supports. πŸ”

RPCSEC_GSS version 3 control messages are a lot like the RPCSEC_GSS version 1 and version 2 RPCSEC_GSS_DESTROY control message (see Section 5.4 of [RFC2203]). In both cases, the sequence number in the request must be valid, and so must the header checksum in the verifier. πŸ” Just like versions 1 and 2, the version 3 control messages may carry call data after the verifier in the body of the NULLPROC procedure. Basically, they look a lot like an RPCSEC_GSS data message with the header procedure set to NULLPROC. πŸ₯°

The client MUST use one of the following security services to protect the RPCSEC_GSS_CREATE or RPCSEC_GSS_LIST control message:

  • rpc_gss_svc_integrity
  • rpc_gss_svc_privacy

Specifically, the client MUST NOT use rpc_gss_svc_none. πŸ™…β€β™€οΈ

RPCSEC_GSS_LIST can also use rpc_gss_svc_channel_prot (see RPCSEC_GSSv2 [RFC5403]) if the request goes out on an RPCSEC_GSSv3 child handle with channel bindings turned on, as described in Section 2.7.1.2. πŸ¦‹

2.7.1. New Control Procedure - RPCSEC_GSS_CREATE

struct rgss3_create_args {
        rgss3_gss_mp_auth    *rca_mp_auth;
        rgss3_chan_binding   *rca_chan_bind_mic;
        rgss3_assertion_u    rca_assertions<>;
};

struct rgss3_create_res {
        opaque               rcr_handle<>;
        rgss3_gss_mp_auth    *rcr_mp_auth;
        rgss3_chan_binding   *rcr_chan_bind_mic;
        rgss3_assertion_u    rcr_assertions<>;
};

enum rgss3_assertion_type {
        LABEL = 0,
        PRIVS = 1
};

union rgss3_assertion_u
      switch (rgss3_assertion_type atype) {
case LABEL:
        rgss3_label  rau_label;
case PRIVS:
        rgss3_privs  rau_privs;
default:
        opaque       rau_ext<>;
};

The call data for an RPCSEC_GSS_CREATE request is an rgss3_create_args, which ties one or more items of several kinds to the returned rcr_handle RPCSEC_GSSv3 context handle (the child handle): πŸŽ€

  • Multi-principal authentication: another RPCSEC_GSS context handle
  • A channel binding
  • Authorization assertions: labels and/or privileges

The reply to this message is either an error or an rgss3_create_res structure. As noted in Sections 2.7.1.3 and 2.7.1.4, successful rgss3_assertions are listed in rcr_assertions, and they are REQUIRED to be listed in the same order they appeared in the rca_assertions argument. πŸ“‹ That order thing is non-negotiable, bestie! 😀

After a successful RPCSEC_GSS_CREATE, both the client and the server need to link the new child rcr_handle context handle to the parent context handle in their GSS context caches. That way, either side can look up the parent context from the child handle. πŸ”—

RPCSEC_GSSv3 child handles MUST be destroyed when their associated parent handle is destroyed. 🧹 No orphans allowed! πŸ‘»

Server implementation and policy MAY result in labels, privileges, and identities being mapped to concepts and values that are local to the server. πŸ—ΊοΈ Server policies should take into account the identity of the client and/or user as authenticated via the GSS-API. That's the main-character move for security, periodt! πŸ‘‘πŸ’…

2.7.1.1. Multi-Principal Authentication

okay bestie, this one is pure teamwork 🫢 multi-principal auth lets the RPC client host and a user prove who they are in the same call 🀝

///
///  struct rgss3_gss_mp_auth {
///          opaque          rgmp_handle<>; /* Inner handle */
///          opaque          rgmp_rpcheader_mic<>;
///  };
///

so RPCSEC_GSSv3 clients MAY assert a multi-principal authentication of the RPC client host principal and a user principal πŸ’– this is needed when a host wants to use authority assertions the server will only hand out if a user and the host are authenticated together πŸ” the server might refuse to grant requested authority to a user acting alone (like through an unprivileged user-space program), or to a host acting alone (like when the host is acting on behalf of a user). but it can grant that authority to a host acting for a user if the server identifies the user and trusts the host ✨

it's assumed that an unprivileged user-space program won't have the RPC client host credentials it needs to set up a GSS-API security context that authenticates the host to the server πŸ™ˆ so that program can't make an RPCSEC_GSSv3 RPCSEC_GSS_CREATE message that successfully binds a host and a user security context. no sneaking through, periodt πŸ’…

the multi-principal authentication call data has a second RPCSEC_GSS version 3 handle, the inner handle, sitting in the rgmp_handle field. on top of the parent handle from Section 2, that's the extra piece 🧩 clients using this MUST use an RPCSEC_GSSv3 context handle that matches a GSS-API security context authenticating the RPC client host for the parent handle. the inner context handle MUST use an RPCSEC_GSSv3 context handle that matches a GSS-API security context authenticating the user. the reverse (parent authenticates the user, inner handle authenticates the host) MUST NOT be used 🚫 other parent and inner combos might make sense someday, but they'd need a new revision of the RPCSEC_GSS protocol to show up 🌸

the child context handle from a successful multi-principal assertion ties the inner handle to the parent RPCSEC_GSS context handle. servers MUST treat it as authenticating the GSS-API initiator principal that the inner handle's security context authenticated πŸ‘‘ that principal can then get mapped to a server-side notion of user or principal, which is lowkey iconic πŸ¦‹

you do the binding by putting an assertion of type rgss3_gss_mp_auth into the rgss3_create_args call data of RPCSEC_GSS_CREATE. the inner handle goes in rgmp_handle. then you compute a MIC over the RPC header, up to and including the credential, using the GSS-API security context tied to the inner handle, and that MIC goes in rgmp_rpcheader_mic πŸŽ€ the rgmp_rpcheader_mic only identifies the client host's GSS context by its handle (the parent context handle) inside the RPC header, so keep that straight 🧠

an RPCSEC_GSS_CREATE control procedure with a multi-principal payload MUST use the rpc_gss_svc_privacy security service πŸ”’ this stops an attacker from intercepting the RPCSEC_GSS_CREATE control procedure, swapping out the (parent) context handle, and stealing the user's identity. honestly this is a 🚨 must-have 🚨

the target checks the multi-principal authentication in two steps. first it confirms the parent context is an RPC client host context. then it verifies rgmp_rpcheader_mic using the GSS-API security context tied to the rgmp_handle field ✨

when verification succeeds, the rgss3_gss_mp_auth field in the rgss3_create_res reply MUST be filled in, with the inner RPCSEC_GSSv3 context handle as rgmp_handle and a MIC over the RPC reply header (see Section 2.3). that MIC is computed using the GSS-API security context tied to the inner handle 🩷

on failure, the rgss3_gss_mp_auth field isn't sent, since it's an optional field πŸ™ƒ and a MSG_DENIED reply to the RPCSEC_GSS_CREATE call gets formulated the usual way πŸ’€

as Section 5.3.3.3 of [RFC2203] explains, the server keeps a list of contexts for the clients currently in session with it. sometimes a request comes in and there's no context matching its handle 😭 when that happens while processing an RPCSEC_GSS3_CREATE request for the parent handle, the server rejects the request with a reply status of MSG_DENIED, a reject_stat of AUTH_ERROR, and an auth_stat value of RPCSEC_GSS_CREDPROBLEM πŸ“

a brand-new value, RPCSEC_GSS_INNER_CREDPROBLEM, has been added to the auth_stat type 🌈 for a multi-principal request, the server must also have a context matching the inner context handle. if it doesn't, the server sends a reply status of MSG_DENIED, a reject_stat of AUTH_ERROR, and an auth_stat value of RPCSEC_GSS_INNER_CREDPROBLEM ⭐

and when the server is processing the multi-principal request and the GSS_VerifyMIC() call on rgmp_rpcheader_mic fails to return GSS_S_COMPLETE, same deal: the server sends MSG_DENIED, AUTH_ERROR, and RPCSEC_GSS_INNER_CREDPROBLEM πŸ’…


2.7.1.2. Channel Binding

///
///  typedef opaque rgss3_chan_binding<>;
///

RPCSEC_GSSv3 does channel binding a different way than RPCSEC_GSSv2 [RFC5403] πŸ¦‹ two big differences:

  1. RPCSEC_GSSv3 builds on RPCSEC_GSSv1 by reusing existing, established context handles, instead of inventing a new RPC security flavor just to set up context handles πŸ§ƒ
  2. channel-bindings data doesn't get hashed anymore, because everyone agrees the secure channel itself should make channel-bindings data of a manageable size πŸ™Œ

point 1 keeps RPCSEC_GSSv3 simple in general, not just for channel binding. point 2 keeps it simple specifically for channel binding πŸŽ€

here's how the binding goes down. the client prefixes the channel-bindings octet string with the channel type, as described in [RFC5056] 🌸 then it calls GSS_GetMIC() on that prefixed string, using the parent RPCSEC_GSSv3 context handle's GSS-API security context. the MIC goes in the rca_chan_bind_mic field of the RPCSEC_GSS_CREATE arguments (rgss3_create_args) πŸ’–

if rca_chan_bind_mic is set in an RPCSEC_GSS_CREATE control message, then the server MUST verify the client's channel-binding MIC, as long as it supports this feature πŸ” if verification succeeds, the server MUST generate a new MIC over the same channel bindings and put it in the rcr_chan_bind_mic field of the rgss3_create_res results πŸ₯° if verification fails, or the server doesn't support channel binding, the server MUST indicate that in its reply by leaving out an rgss3_chan_binding value in rgss3_create_res (rgss3_chan_binding is an optional field) πŸ™ƒ

the client MUST verify the result's rcr_chan_bind_mic value by calling GSS_VerifyMIC() with the given MIC and the channel-bindings data (including the channel-type prefix) πŸ•΅οΈβ€β™€οΈ if client-side verification fails, the client MUST call RPCSEC_GSS_DESTROY πŸ’€ if the client asked for channel binding but the server didn't include an rcr_chan_binding_mic field in the results, the client MAY continue using the resulting context handle as though channel binding had never been requested πŸ€·β€β™€οΈ but if the client considers channel binding critical, it MUST call RPCSEC_GSS_DESTROY πŸ›‘

as RPCSEC_GSSv2 [RFC5403] puts it:

Once a successful [channel-binding] procedure has been performed on an [RPCSEC_GSSv3] context handle, the initiator's implementation may map application requests for rpc_gss_svc_none and rpc_gss_svc_integrity to rpc_gss_svc_channel_prot credentials. And if the secure channel has privacy enabled, requests for rpc_gss_svc_privacy can also be mapped to rpc_gss_svc_channel_prot.

so any RPCSEC_GSSv3 child context handle that got bound to a secure channel this way SHOULD be used only with rpc_gss_svc_channel_prot, and SHOULD NOT be used with rpc_gss_svc_none or rpc_gss_svc_integrity πŸ¦„ if the secure channel doesn't provide privacy protection, the client MAY use rpc_gss_svc_privacy wherever privacy protection is needed or wanted πŸ”βœ¨


2.7.1.3. Label Assertions

///  struct rgss3_label {
///          rgss3_lfs       rl_lfs;
///          opaque          rl_label<>;
///  };
///
///  struct rgss3_lfs {
///          unsigned int rlf_lfs_id;
///          unsigned int rlf_pi_id;
///  };
///

first, the client finds out which LFSs the server supports by using the RPCSEC_GSS_LIST control message πŸ—‚οΈ full Mode MAC gets turned on when an RPCSEC_GSS version 3 process subject label assertion is combined with a file object label from the NFSv4.2 sec_label attribute 🌟 we're talking security labels being fully in charge, no cap πŸ‘‘

the label encoding mirrors the NFSv4.2 sec_label attribute described in Section 12.2.4 of [RFC7862] 🌷 the LFS is an identifier the client uses to figure out the syntactic format of the security label and what its components mean 🧠 the Policy Identifier (PI) is optional, and it's part of an LFS definition that lets clients and the server pin down specific security policies πŸ“œ the opaque label field (rgss3_label) depends on the MAC model to interpret and enforce it πŸ¦‹

if a label needs privacy protection (meaning the user has to be able to assert that the label is a secret), the client MUST use the rpc_gss_svc_privacy protection service for the RPCSEC_GSS_CREATE request πŸ™ˆπŸ”’

RPCSEC_GSSv3 clients MAY assert a set of subject security labels in some LFS by binding a label assertion to the RPCSEC_GSSv3 child context handle πŸŽ€ they do this by including an assertion of type rgss3_label in the rca_assertions call data of the rgss3_create_args for RPCSEC_GSS_CREATE πŸ’– the label assertion payload is the set of subject labels the calling NFS client process asserts. the resulting child context gets used for NFS requests that assert those client process subject labels 🫧 then the NFS server process handling those requests asserts the (client) process subject label(s) when it tries to access a file that has Labeled NFS object labels 🏷️

servers that support labeling in the requested LFS MAY map the requested subject label to a different one, as a result of server-side policy evaluation 🧐

the labels the target accepts and binds to the RPCSEC_GSSv3 context MUST be enumerated in the rcr_assertions field of the rgss3_create_res RPCSEC_GSS_CREATE reply πŸ“‹βœ¨

servers that don't support labeling, or don't support the requested LFS, reject the label assertion with a reply status of MSG_DENIED, a reject_status of AUTH_ERROR, and an auth_stat of RPCSEC_GSS_LABEL_PROBLEM πŸš«πŸ’…

2.7.1.4. Structured Privilege Assertions ✨

Okay bestie, so a structured privilege is a capability that a specific RPC application defines for itself πŸ’… When a client using that app asserts one to a server that also supports the app, the app may define its own private data structure. Clients and servers that implement the RPC application need to understand that structure 🫢

///
///  typedef opaque utf8string<>;   /* UTF-8 encoding */
///  typedef utf8string utf8str_cs; /* Case-sensitive UTF-8 */
///
///  struct rgss3_privs {
///          utf8str_cs      rp_name<>;
///          opaque          rp_privilege<>;
///  };

RPCSEC_GSSv3 clients MAY assert a structured privilege by binding it to the RPCSEC_GSSv3 context handle πŸ¦‹ To do that, you put an assertion of type rgss3_privs into the rca_assertions call data of the RPCSEC_GSS_CREATE rgss3_create_args request.

The privilege gets identified by its description string πŸŽ€ RPCSEC_GSSv3 uses that string to identify the privilege and pass the private data between the relevant application-specific code. RPCSEC_GSSv3 doesn't have to know the details of the structure. So as far as RPCSEC_GSSv3 is concerned, the structure is just opaque data sent between client and server, in the rpc_gss3_privs rp_privilege field 🌸

Encoding, server verification, and any server policies for structured privileges are described by the RPC application definition πŸ“œ The rp_name field of rpc_gss3_privs carries the description string used to identify and list the privilege. The utf8str_cs definition is from [RFC7530].

A successful structured privilege assertion MUST be enumerated in the rcr_assertions field of the rgss3_create_res RPCSEC_GSS_CREATE reply πŸ”₯

If a server gets a structured privilege assertion it doesn't recognize, the assertion is rejected with a reply status of MSG_DENIED, a reject_status of AUTH_ERROR, and an auth_stat of RPCSEC_GSS_UNKNOWN_MESSAGE πŸ’€

It is assumed that a client asserting more than one structured privilege to be bound to a context handle would not require all the privilege assertions to succeed 🧚

The server MUST NOT reject RPCSEC_GSS_CREATE requests containing supported structured privilege assertions, even if some of those assertions are rejected (e.g., for local policy reasons) πŸ™ˆ

If a server receives an RPCSEC_GSS_CREATE request containing one or more unsupported structured privilege assertions, the request MUST be rejected with a reply status of MSG_DENIED, a reject_status of AUTH_ERROR, and an auth_stat of RPCSEC_GSS_PRIVILEGE_PROBLEM 😭

Section 4.9.1.1 of [RFC7862] ("Inter-Server Copy via ONC RPC with RPCSEC_GSSv3") shows an example of a structured privilege definition and use πŸ‘‘


2.7.2. New Control Procedure - RPCSEC_GSS_LIST πŸ“‹

///  enum rgss3_list_item {
///          LABEL = 0,
///          PRIVS = 1
///  };
///
///  struct rgss3_list_args {
///          rgss3_list_item      rla_list_what<>;
///  };
///
///  union rgss3_list_item_u
///        switch (rgss3_list_item itype) {
///  case LABEL:
///          rgss3_label          rli_labels<>;
///  case PRIVS:
///          rgss3_privs          rli_privs<>;
///  default:
///          opaque               rli_ext<>;
///  };
///
///  typedef rgss3_list_item_u rgss3_list_res<>;
///

The call data for an RPCSEC_GSS_LIST request is a list of integers (rla_list_what) saying which assertions you want listed 🌈 The reply is either an error or the list you asked for ✨

Asking for a list of rgss3_list_item LABEL objects gets you a list of LFSs supported by the server. You can then use that LFS list to assert labels through the RPCSEC_GSS_CREATE label assertions. See Section 2.7.1.3. 🏷️


2.8. Extensibility 🌸

Assertion types may be added in the future by adding arms to the "rgss3_assertion_u" union (Section 2.7.1) and the "rgss3_list_item_u" union (Section 2.7.2). Examples of other potential assertion types include:

  • Client-side assertions of identity:
    • Primary client/user identity.
    • Supplementary group memberships of the client/user, including support for specifying deltas to the membership list as seen on the server.

3. Operational Recommendation for Deployment πŸš€

RPCSEC_GSSv3 is a superset of RPCSEC_GSSv2 [RFC5403], which in turn is a superset of RPCSEC_GSSv1 [RFC2203]. So it can be used in all situations where RPCSEC_GSSv2 is used, or where RPCSEC_GSSv1 is used and channel-bindings functionality is not needed. RPCSEC_GSSv3 should be used when the new functionality is needed πŸ’–


4. Security Considerations πŸ”’

This entire document deals with security issues. 🚨

The RPCSEC_GSSv3 protocol allows for client-side assertions of data that is relevant to server-side authorization decisions. These assertions must be evaluated by the server in the context of whether the client and/or user are authenticated, whether multi-principal authentication was used, whether the client is trusted, what ranges of assertions are allowed for the client and the user (separately or together), and any relevant server-side policy πŸ›‘οΈ

The security semantics of assertions carried by RPCSEC_GSSv3 are application protocol-specific πŸ”

Note that RPCSEC_GSSv3 is not a complete solution for labeling. It conveys the labels of actors but not the labels of objects. RPC application protocols may require extending in order to carry object label information 🏷️

There may be interactions with NFSv4's callback security scheme and NFSv4.1's [RFC5661] GSS SSV (Secret State Verifier) mechanisms. Specifically, the NFSv4 callback scheme requires that the server initiate GSS-API security contexts, which does not work well in practice. In the context of client-side processes running as the same user but with different privileges and security labels, the NFSv4 callback security scheme seems particularly unlikely to work well 😬

NFSv4.1 has the server use an existing, client-initiated RPCSEC_GSS context handle to protect server-initiated callback RPCs. The NFSv4.1 callback security scheme lacks all the problems of the NFSv4 scheme. However, it is important that the server pick an appropriate RPCSEC_GSS context handle to protect any callbacks. Specifically, it is important that the server use RPCSEC_GSS context handles that authenticate the client to protect any callbacks related to server state initiated by RPCs protected by RPCSEC_GSSv3 contexts πŸ’œ

As described in Section 2.10.10 of [RFC5661], the client is permitted to associate multiple RPCSEC_GSS handles with a single SSV GSS context. RPCSEC_GSSv3 handles work well with SSV in that the man-in-the-middle attacks described in Section 2.10.10 of [RFC5661] are solved by the new reply verifier (Section 2.3). Using an RPCSEC_GSSv3 handle backed by a GSS-SSV mechanism context as a parent handle in an RPCSEC_GSS_CREATE call is permitted, but it is complicated by the lifetime rules of SSV contexts and their associated RPCSEC_GSS handles 🧩


5. IANA Considerations πŸ“œ

This section uses terms that are defined in [RFC5226].

5.1. New RPC Authentication Status Numbers ✨

The following new RPC Authentication Status Numbers have been added to the IANA registry:

  • RPCSEC_GSS_INNER_CREDPROBLEM (15) "No credentials for multi-principal assertion inner context user". See Section 2.7.1.1.
  • RPCSEC_GSS_LABEL_PROBLEM (16) "Problem with label assertion". See Section 2.7.1.3.
  • RPCSEC_GSS_PRIVILEGE_PROBLEM (17) "Problem with structured privilege assertion". See Section 2.7.1.4.
  • RPCSEC_GSS_UNKNOWN_MESSAGE (18) "Unknown structured privilege assertion". See Section 2.7.1.4.

5.2. Structured Privilege Name Definitions πŸŽ€

IANA has created a registry called the "RPCSEC_GSS Structured Privilege Names Registry" πŸ—‚οΈ

Structured privilege assertions (Section 2.7.1.4) are defined by a specific RPC application. The namespace identifiers for these assertions (the rp_name) are defined as string names. The RPCSEC_GSSv3 protocol does not define the specific assignment of the namespace for these structured privilege assertion names. The IANA registry promotes interoperability where common interests exist. While RPC application developers are allowed to define and use structured privileges as needed, they are encouraged to register structured privilege assertion names with IANA 🀝

The registry is to be maintained using the Standards Action policy as defined in Section 4.1 of [RFC5226].

Under the RPCSEC_GSS version 3 specification, the name of a structured privilege can in theory be up to 2^32 - 1 bytes in length. In practice, though, RPC application clients and servers will be unable to handle a string that long. IANA should reject any assignment request with a structured privilege name that exceeds 128 UTF-8 characters. To give the IESG the flexibility to set up bases of assignment of Experimental Use, the prefix "EXPE" is Reserved. The structured privilege with a zero-length name is Reserved 🚫

The prefix "PRIV" is allocated for Private Use. A site that wants to make use of unregistered named attributes without risk of conflicting with an assignment in IANA's registry should use the prefix "PRIV" in all of its structured privilege assertion names πŸ•ΆοΈ

Because some RPC application clients and servers have case-insensitive semantics, the fifteen additional lower-case and mixed-case permutations of each of "EXPE" and "PRIV" are Reserved (e.g., "expe", "expE", and "exPe" are Reserved). Similarly, IANA must not allow two assignments that would conflict if both structured privilege names were converted to a common case πŸ™…

The registry of structured privilege names is a list of assignments, each containing three fields for each assignment:

  1. A US-ASCII string name that is the actual name of the structured privilege. This name must be unique. This string name can be 1 to 128 UTF-8 characters long.
  2. A reference to the specification of the RPC-application-defined structured privilege. The reference can consume up to 256 bytes (or more if IANA permits).
  3. The point of contact of the registrant. The point of contact can consume up to 256 bytes (or more if IANA permits).

5.2.1. Initial Registry 🌟

The initial registry consists of the three structured privileges defined in [RFC7862].

  1. NAME: copy_to_auth, REFERENCE: RFC 7862, CONTACT: William A.(Andy) Adamson, andros@netapp.com
  2. NAME: copy_from_auth, REFERENCE: RFC 7862, CONTACT: William A.(Andy) Adamson, andros@netapp.com
  3. NAME: copy_confirm_auth, REFERENCE: RFC 7862, CONTACT: William A.(Andy) Adamson, andros@netapp.com

5.2.2. Updating Registrations πŸ”„

The registrant is always permitted to update the point of contact field. To make any other change will require Expert Review or IESG Approval 🫢


6. References πŸ“š

6.1. Normative References

Okay bestie, these are the must-read sources the spec leans on, so we're not skipping any of them πŸ“šβœ¨

6.2. Informative References

These ones are more like extra reading for the curious 🧠🌸 They aren't required to implement the spec, but they're iconic context.

Acknowledgments

Andy Adamson wants to thank NetApp, Inc. for funding his time on this project, which is such a W 🫢

We also thank Lars Eggert, Mike Eisler, Ben Kaduk, Bruce Fields, Tom Haynes, and Dave Noveck for their most helpful reviews. Iconic reviewers, no notes πŸ‘‘πŸ’–

Authors' Addresses

Here are the people who wrote it and how to reach them πŸ’Œ

William A. (Andy) Adamson
NetApp
3629 Wagner Ridge Ct.
Ann Arbor, MI  48103
United States of America

Phone: +1 734 665 1204
Email: andros@netapp.com


Nico Williams
cryptonector.com
13115 Tamayo Dr.
Austin, TX  78729
United States of America

Email: nico@cryptonector.com

That's the whole RFC, bestie, we made it πŸŒˆπŸ’…βœ¨

πŸ“¦ where this page comes from