RFC 7204 INFORMATIONAL NFS · ACCESS CONTROL · SECURITY

Labeled NFS Requirements: Requirements for Labeled NFS

What a network file system has to do so that mandatory access control still works across the network.

On rfc-editor.org ↗
PUBLISHED
April 2014
AUTHORS
T. Haynes
STREAM
IETF
MODES OF OPERATION
Full, Limited Server and Guest
GENERAL REQUIREMENTS
4
SECURITY SERVICES REQUIRED
Authentication, integrity and privacy
SENSITIVITY LEVELS IN THE EXAMPLE
Unclassified, Secret and Top Secret
DOCUMENT STATUS
Informational
DOI
10.17487/RFC7204

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Internet Engineering Task Force (IETF)                         T. Haynes
Request for Comments: 7204                                        NetApp
Category: Informational                                       April 2014
ISSN: 2070-1721


                      Requirements for Labeled NFS

Abstract

   This memo outlines high-level requirements for the integration of
   flexible Mandatory Access Control (MAC) functionality into the
   Network File System (NFS) version 4.2 (NFSv4.2).  It describes the
   level of protections that should be provided over protocol components
   and the basic structure of the proposed system.  The intent here is
   not to present the protocol changes but to describe the environment
   in which they reside.

Status of This Memo

   This document is not an Internet Standards Track specification; it is
   published for informational purposes.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Not all documents
   approved by the IESG are a candidate for any level of Internet
   Standard; see Section 2 of RFC 5741.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   http://www.rfc-editor.org/info/rfc7204.

Copyright Notice

   Copyright (c) 2014 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) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1. Introduction ....................................................3
   2. Definitions .....................................................3
      2.1. Requirements Language ......................................4
   3. Requirements ....................................................4
      3.1. General ....................................................4
      3.2. Security Services ..........................................5
      3.3. Label Encoding, Label Format Specifiers, and Label
           Checking Authorities .......................................5
      3.4. Labeling ...................................................6
           3.4.1. Client Labeling .....................................6
           3.4.2. Server Labeling .....................................7
      3.5. Policy Enforcement .........................................7
           3.5.1. Client Enforcement ..................................7
           3.5.2. Server Enforcement ..................................8
      3.6. Namespace Access ...........................................8
      3.7. Upgrading Existing Server ..................................9
   4. Modes of Operation ..............................................9
      4.1. Full Mode ..................................................9
      4.2. Limited Server Mode .......................................10
      4.3. Guest Mode ................................................10
   5. Use Cases ......................................................11
      5.1. Full MAC Labeling Support for Remotely Mounted
           File Systems ..............................................11
      5.2. MAC Labeling of Virtual Machine Images Stored on
           the Network ...............................................11
      5.3. Simple Security Label Storage .............................12
      5.4. Diskless Linux ............................................12
      5.5. Multi-Level Security ......................................13
           5.5.1. Full Mode - MAC-Functional Client and Server .......13
           5.5.2. MAC-Functional Client ..............................14
           5.5.3. MAC-Functional Server ..............................15
   6. Security Considerations ........................................15
      6.1. Trust Needed for a Community ..............................15
      6.2. Guest Mode ................................................15
      6.3. MAC-Functional Client Configuration .......................16
   7. References .....................................................16
      7.1. Normative References ......................................16
      7.2. Informative References ....................................16
   Appendix A. Acknowledgments .......................................18

1.  Introduction

   Mandatory Access Control (MAC) systems (as defined in [RFC4949]) have
   been mainstreamed in modern operating systems such as Linux, FreeBSD,
   and Solaris.  MAC systems bind security attributes to subjects
   (processes) and objects within a system.  These attributes are used
   with other information in the system to make access control
   decisions.

   Access control models such as Unix permissions or Access Control
   Lists (ACLs) are commonly referred to as Discretionary Access Control
   (DAC) models.  These systems base their access decisions on user
   identity and resource ownership.  In contrast, MAC models base their
   access control decisions on the label on the subject (usually a
   process) and the object it wishes to access.  These labels may
   contain user identity information but usually contain additional
   information.  In DAC systems, users are free to specify the access
   rules for resources that they own.  MAC models base their security
   decisions on a system-wide policy established by an administrator or
   organization that the users do not have the ability to override.  DAC
   systems offer some protection against unauthorized users running
   malicious software.  However, even an authorized user can execute
   malicious or flawed software with those programs running with the
   full permissions of the user executing it.  Inversely, MAC models can
   confine malicious or flawed software and usually act at a finer
   granularity than their DAC counterparts.

   Besides describing the requirements, this document records the
   functional requirements for the client imposed by the preexisting
   security models on the client.  This document may help those outside
   the NFS community understand those issues.

2.  Definitions

   Foreign Label:  a label in a format other than the format that a MAC
      implementation uses for encoding.

   Label Format Specifier (LFS):  an identifier used by the client to
      establish the syntactic format of the security label and the
      semantic meaning of its components.

   MAC-Aware:  a server that can transmit and store object labels.

   MAC-Functional:  a client or server that is Labeled NFS enabled.
      Such a system can interpret labels and apply policies based on the
      security system.

   Multi-Level Security (MLS):  a traditional model where objects are
      given a sensitivity level (Unclassified, Secret, Top Secret, etc.)
      and a category set [RH_MLS].

   Object:  a passive resource within the system that we wish to
      protect.  Objects can be entities such as files, directories,
      pipes, sockets, and many other system resources relevant to the
      protection of the system state.

   Policy Identifier (PI):  an optional part of the definition of a
      Label Format Specifier.  The PI allows clients and servers to
      identify specific security policies.

   Subject:  an active entity, usually a process, that is requesting
      access to an object.

2.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 [RFC2119].

3.  Requirements

   The following initial requirements have been gathered from users and
   developers, and from previous development efforts in this area such
   as the Distributed Trusted Operating System [DTOS] and the NSA's
   experimental NFSv3 enhancements [SENFSv3].

3.1.  General

   A mechanism is required to provide security attribute information to
   NFSv4 clients and servers.  This mechanism has the following
   requirements:

   (1)  Clients MUST be able to convey to the server the client's
        privileges, i.e., the subject, for making the access request.
        The server may provide a mechanism to enforce MAC policy based
        on the requesting client's privileges.

   (2)  Servers MUST be able to store and retrieve the security
        attribute of exported files as requested by the client.

   (3)  Servers MUST provide a mechanism for notifying clients of
        attribute changes of files on the server.

   (4)  Clients and Servers MUST be able to negotiate Label Formats and
        provide a mechanism to translate between them as needed.

3.2.  Security Services

   Labeled NFS or the underlying system on which the Labeled NFS
   operates MUST provide the following security services for all NFSv4.2
   messaging:

   o  Authentication

   o  Integrity

   o  Privacy

   Mechanisms and algorithms used in the provision of security services
   MUST be configurable so that appropriate levels of protection may be
   flexibly specified per mandatory security policy.

   Strong mutual authentication is required between the server and the
   client for Full Mode operation (Section 4.1).

   MAC security labels and any related security state MUST always be
   protected by these security services when transferred over the
   network, as MUST the binding of labels and state to associated
   objects and subjects.

   Labeled NFS SHOULD support authentication on a context granularity so
   that different contexts running on a client can use different
   cryptographic keys and facilities.

3.3.  Label Encoding, Label Format Specifiers, and Label Checking
      Authorities

   Encoding of MAC labels and attributes passed over the network MUST be
   specified in a complete and unambiguous manner while maintaining the
   flexibility of MAC implementations.  To accomplish this, the labels
   MUST consist of a format-specific component bound with a Label Format
   Specifier (LFS).  The LFS component provides a mechanism for
   identifying the structure and semantics of the opaque component.
   Meanwhile, the opaque component is the security label that will be
   interpreted by the MAC models.

   MAC models base access decisions on security attribute privileges
   bound to subjects and objects, respectively.  With a given MAC model,
   all systems have semantically coherent labeling -- a security label
   MUST always mean exactly the same thing on every system.  While this
   may not be necessary for simple MAC models, it is recommended that
   most Label Formats assigned an LFS incorporate semantically coherent
   labeling into their Label Format.

   Labeled NFS SHOULD define an initial negotiation scheme with the
   primary aims of simplicity and completeness.  This is to facilitate
   practical deployment of systems without being weighed down by complex
   and overgeneralized global schemes.  Future extensibility SHOULD also
   be taken into consideration.

   Labeled NFS MUST provide a means for servers and clients to identify
   their LFSs for the purposes of authorization, security service
   selection, and security label interpretation.

   Labeled NFS MUST provide a means for servers and clients to identify
   their mode of operation (see Section 4).

   A negotiation scheme SHOULD be provided, allowing systems from
   different Label Formats to agree on how they will interpret or
   translate each other's foreign labels.  Multiple concurrent
   agreements may be current between a server and a client.

   All security labels and related security state transferred across the
   network MUST be tagged with a valid LFS.

   If the LFS supported on a system changes, the system SHOULD
   renegotiate agreements to reflect these changes.

   If a system receives any security label or security state tagged with
   an LFS it does not recognize or cannot interpret, it MUST reject that
   label or state.

   NFSv4.2 includes features that may cause a client to cross an LFS
   boundary when accessing what appears to be a single file system.  If
   LFS negotiation is supported by the client and the server, the server
   SHOULD negotiate a new, concurrent agreement with the client, acting
   on behalf of the externally located source of the files.

3.4.  Labeling

   Implementations MUST validate security labels supplied over the
   network to ensure that they are within a set of labels permitted from
   a specific peer and, if not, reject them.  Note that a system may
   permit a different set of labels to be accepted from each peer.

3.4.1.  Client Labeling

   At the client, labeling semantics for NFS mounted file systems MUST
   remain consistent with those for locally mounted file systems.  In
   particular, user-level labeling operations local to the client MUST
   be enacted locally via existing APIs, to ensure compatibility and
   consistency for applications and libraries.

   Note that this does not imply any specific mechanism for conveying
   labels over the network.

   When an object is newly created by the client, it will calculate the
   label for the object based on its policy.  Once that is done, it will
   send the request to the server, which has the ability to deny the
   creation of the object with that label based on the server's policy.
   In creating the file, the server MUST ensure that the label is bound
   to the object before the object becomes visible to the rest of the
   system.  This ensures that any access control or further labeling
   decisions are correct for the object.

3.4.2.  Server Labeling

   The server MUST provide the capability for clients to retrieve
   security labels on all exported file system objects where possible.
   This includes cases where only in-core and/or read-only security
   labels are available at the server for any of its exported file
   systems.

   The server MUST honor the ability for a client to specify the label
   of an object on creation.  If the server is MAC enabled, it may
   choose to reject the label specified by the client, due to
   restrictions in the server policy.  The server SHOULD NOT attempt to
   find a suitable label for an object in the event of different
   labeling rules on its end.  The server is allowed to translate the
   label but MUST NOT change the semantic meaning of the label.

3.5.  Policy Enforcement

   The MAC-Functional client determines if a process request is sent to
   the remote server.  Upon a successful response from the server, it
   must use its own policies on the object's security labels to
   determine if the process can be given access.  The client SHOULD NOT
   need to be cognizant of whether the server is a Limited Server or is
   fully MAC-Functional.

3.5.1.  Client Enforcement

   The client MUST apply its own policy to remotely located objects,
   using security labels for the objects obtained from the server.  It
   MUST be possible to configure the maximum length of time a client may
   cache state regarding remote labels before revalidating that state
   with the server.

   If the server's policy changes, the client MUST flush all object
   state back to the server.  The server MUST ensure that any flushed
   state received is consistent with current policy before committing it
   to stable storage.

   Any local security state associated with cached or delegated objects
   MUST also be flushed back to the server when any other state of the
   objects is required to be flushed back.

   The implication here is that if the client holds a delegation on an
   object, then it enforces policy to local changes based on the object
   label it got from the server.  When it tries to commit those changes
   to the server, it SHOULD be prepared for the server to reject those
   changes based on the policies of the server.

3.5.2.  Server Enforcement

   A MAC-Functional server MUST enforce its security policy over all
   exported objects, for operations that originate both locally and
   remotely.

   Requests from authenticated clients MUST be processed using security
   labels and credentials supplied by the client as if they originated
   locally.

   As with labeling, the system MUST also take into account any other
   volatile client security state, such as a change in process security
   context via dynamic transition.  Access decisions SHOULD also be made
   based upon the current client security label accessing the object,
   rather than the security label that opened it, if different.

   The server SHOULD recall delegation of an object if the object's
   security label changes.

3.6.  Namespace Access

   The server SHOULD provide a means to authorize selective access to
   the exported file system namespace based upon client credentials and
   according to security policy.

   This is a common requirement of MLS-enabled systems, which often need
   to present selective views of namespaces based upon the clearances of
   the subjects.

3.7.  Upgrading Existing Server

   Note that under the MAC model, all objects MUST have labels.
   Therefore, if an existing server is upgraded to include Labeled NFS
   support, then it is the responsibility of the security system to
   define the behavior for existing objects.

4.  Modes of Operation

   In a Labeled NFS client and server interaction, we can describe three
   modes of operation:

   1.  Full

   2.  Limited Server

   3.  Guest

   These modes arise from the level of MAC functionality in the clients
   and servers.  The clients can be non-MAC-Functional and
   MAC-Functional.  The servers can be non-MAC-Functional, MAC-Aware,
   and MAC-Functional.

   A MAC-Functional client MUST be able to determine the level of MAC
   functionality in the server.  Likewise, a MAC-Functional server MUST
   be able to determine whether or not a client is MAC-Functional.  As
   discussed in Section 3.3, the protocol MUST provide for the client
   and server to make those determinations.

4.1.  Full Mode

   The server and the client have mutually recognized MAC functionality
   enabled, and full Labeled NFS functionality is extended over the
   network between both client and server.

   An example of an operation in Full Mode is as follows.  On the
   initial lookup, the client requests access to an object on the
   server.  It sends its process security context over to the server.
   The server checks all relevant policies to determine if that process
   context from that client is allowed to access the resource.  Once
   this has succeeded, the object, with its associated security
   information, is released to the client.  Once the client receives the
   object, it determines if its policies allow the process running on
   the client access to the object.

   On subsequent operations where the client already has a handle for
   the file, the order of enforcement is reversed.  Since the client
   already has the security context, it may make an access decision
   against its policy first.  This enables the client to avoid sending
   requests to the server that it knows will fail, regardless of the
   server's policy.  If the client passes its policy checks, then it
   sends the request to the server, where the client's process context
   is used to determine if the server will release that resource to the
   client.  If both checks pass, the client is given the resource and
   everything succeeds.

   In the event that the client does not trust the server, it may opt to
   use an alternate labeling mechanism, regardless of the server's
   ability to return security information.

4.2.  Limited Server Mode

   The server is MAC-Aware, and the clients are MAC-Functional.  The
   server can store and transmit labels.  It cannot enforce labels.  The
   server MUST inform clients when an object label changes for a file
   the client has open.

   In this mode, the server may not be aware of the format of any of its
   object labels.  Indeed, it may service several different security
   models at the same time.  A client MUST process foreign labels as
   discussed in Section 3.3.  As with the Guest Mode, this mode's level
   of trust can be degraded if non-MAC-Functional clients have access to
   the server.

4.3.  Guest Mode

   Only one of the server or client is MAC-Functional enabled.

   In the case of the server only being MAC-Functional, the server
   enforces its policy and may selectively provide standard NFS services
   to clients based on their authentication credentials and/or
   associated network attributes (e.g., IP address, network interface)
   according to security policy.  The level of trust and access extended
   to a client in this mode is configuration-specific.

   In the case of the client only being MAC-Functional, the client MUST
   operate as a standard NFSv4.2 (see [NFSv4_2]) client and SHOULD
   selectively provide processes access to servers based upon the
   security attributes of the local process, and network attributes of
   the server, according to policy.  The client may also override
   default labeling of the remote file system based upon these security
   attributes or other labeling methods such as mount point labeling.

   In other words, the Guest Mode is standard NFSv4.2 over the wire,
   with the MAC-Functional system mapping the non-MAC-Functional
   system's processes or objects to security labels based on other
   characteristics in order to preserve its MAC guarantees.

5.  Use Cases

   MAC labeling is meant to allow NFSv4.2 to be deployed in site-
   configurable security schemes.  The LFS and opaque data scheme allows
   for flexibility to meet these different implementations.  In this
   section, we provide some examples of how NFSv4.2 could be deployed to
   meet existing needs.  This is not an exhaustive listing.

5.1.  Full MAC Labeling Support for Remotely Mounted File Systems

   In this case, we assume a local networked environment where the
   servers and clients are under common administrative control.  All
   systems in this network have the same MAC implementation and
   semantically identical MAC security labels for objects (i.e., labels
   mean the same thing on different systems, even if the policies on
   each system may differ to some extent).  Clients will be able to
   apply fine-grained MAC policy to objects accessed via NFS mounts and
   thus improve the overall consistency of MAC policy application within
   this environment.

   An example of this case would be where user home directories are
   remotely mounted, and fine-grained MAC policy is implemented to
   protect, for example, private user data from being read by malicious
   web scripts running in the user's browser.  With Labeled NFS, fine-
   grained MAC labeling of the user's files will allow the MAC policy to
   be implemented and provide the desired protection.

5.2.  MAC Labeling of Virtual Machine Images Stored on the Network

   Virtualization is now a commonly implemented feature of modern
   operating systems, and there is a need to ensure that MAC security
   policy is able to protect virtualized resources.  A common
   implementation scheme involves storing virtualized guest file systems
   on a networked server; these file systems are then mounted remotely
   by guests upon instantiation.  In this case, there is a need to
   ensure that the local guest kernel is able to access fine-grained MAC
   labels on the remotely mounted file system so that its MAC security
   policy can be applied.

5.3.  Simple Security Label Storage

   In this case, a mixed and loosely administered network is assumed,
   where nodes may be running a variety of operating systems with
   different security mechanisms and security policies.  It is desired
   that network file servers be simply capable of storing and retrieving
   MAC security labels for clients that use such labels.  The Labeled
   NFS protocol would be implemented here solely to enable transport of
   MAC security labels across the network.  It should be noted that in
   such an environment, overall security cannot be as strongly enforced
   as when the server is also enforcing and that this scheme is aimed at
   allowing MAC-capable clients to function with its MAC security policy
   enabled rather than perhaps disabling it entirely.

5.4.  Diskless Linux

   A number of popular operating system distributions depend on a
   Mandatory Access Control (MAC) model to implement a kernel-enforced
   security policy.  Typically, such models assign particular roles to
   individual processes, which limit or permit performing certain
   operations on a set of files, directories, sockets, or other objects.
   While the enforcing of the policy is typically a matter for the
   diskless NFS client itself, the file system objects in such models
   will typically carry MAC labels that are used to define policy on
   access.  These policies may, for instance, describe privilege
   transitions that cannot be replicated using standard NFS ACL-based
   models.

   For instance, on a SYSV-compatible system (see [SYSV]), if the 'init'
   process spawns a process that attempts to start the 'NetworkManager'
   executable, there may be a policy that sets up a role transition if
   the 'init' process and 'NetworkManager' file labels match a
   particular rule.  Without this role transition, the process may find
   itself having insufficient privileges to perform its primary job of
   configuring network interfaces.

   In setups of this type, a lot of the policy targets (such as sockets
   or privileged system calls) are entirely local to the client.  The
   use of RPCSEC_GSSv3 ([RPC_SEC]) for enforcing compliance at the
   server level is therefore of limited value.  The ability to
   permanently label files and have those labels read back by the client
   is, however, crucial to the ability to enforce that policy.

5.5.  Multi-Level Security

   In an MLS system, objects are generally assigned a sensitivity level
   and a set of compartments.  The sensitivity levels within the system
   are given an order ranging from lowest to highest classification
   level.  Read access to an object is allowed when the sensitivity
   level of the subject "dominates" the object it wants to access.  This
   means that the sensitivity level of the subject is higher than that
   of the object it wishes to access and that its set of compartments is
   a superset of the compartments on the object.

   The rest of this section will just use sensitivity levels.  In
   general, the example is a client that wishes to list the contents of
   a directory.  The system defines the sensitivity levels as
   Unclassified (U), Secret (S), and Top Secret (TS).  The directory to
   be searched is labeled Top Secret, which means access to read the
   directory will only be granted if the subject making the request is
   also labeled Top Secret.

5.5.1.  Full Mode - MAC-Functional Client and Server

   In the first part of this example, a process on the client is running
   at the Secret level.  The process issues a readdir() system call,
   which enters the kernel.  Before translating the readdir() system
   call into a request to the NFSv4.2 server, the host operating system
   will consult the MAC module to see if the operation is allowed.
   Since the process is operating at Secret and the directory to be
   accessed is labeled Top Secret, the MAC module will deny the request
   and an error code is returned to user space.

   Consider a second case where instead of running at Secret the process
   is running at Top Secret.  In this case, the sensitivity of the
   process is equal to or greater than that of the directory, so the MAC
   module will allow the request.  Now the readdir() is translated into
   the necessary NFSv4.2 call to the server.  For the remote procedure
   call (RPC) request, the client is using the proper credential to
   assert to the server that the process is running at Top Secret.

   When the server receives the request, it extracts the security label
   from the RPC session and retrieves the label on the directory.  The
   server then checks with its MAC module to see if a Top Secret process
   is allowed to read the contents of the Top Secret directory.  Since
   this is allowed by the policy, then the server will return the
   appropriate information back to the client.

   In this example, the policy on both the client and server is the
   same.  In the event that they were running different policies, a
   translation of the labels might be needed.  In this case, it could be
   possible for a check to pass on the client and fail on the server.
   The server may consider additional information when making its policy
   decisions.  For example, the server could determine that a certain
   subnet is only cleared for data up to Secret classification.  If that
   constraint was in place for the example above, the client would still
   succeed, but the server would fail, since the client is asserting a
   label that it is not able to use (Top Secret on a Secret network).

5.5.2.  MAC-Functional Client

   In these scenarios, the server is either non-MAC-Aware or MAC-Aware.
   The actions of the client will depend on whether it is configured to
   treat the MAC-Aware server in the same manner as the non-MAC-Aware
   one.  That is, does it utilize the approach presented in Section 4.3,
   or does it allow the MAC-Aware server to return labels?

   With a client that is MAC-Functional and using the example in the
   previous section, the result should be the same.  The one difference
   is that all decisions are made on the client.

5.5.2.1.  MAC-Aware Server

   A process on the client labeled Secret wishes to access a directory
   labeled Top Secret on the server.  This is denied, since Secret does
   not dominate Top Secret.  Note that there will be NFSv4.2 operations
   issued that return an object label for the client to process.

   Note that in this scenario, all of the clients must be
   MAC-Functional.  A single client that does not do its access control
   checks would violate the model.

5.5.2.2.  Non-MAC-Aware Server

   A process on the client labeled Secret wishes to access a directory
   that the client's policies label as Top Secret on the server.  This
   is denied, since Secret does not dominate Top Secret.  Note that
   there will not be NFSv4.2 operations issued.  If the process had a
   Top Secret process label instead of Secret, the client would issue
   NFSv4.2 operations to access the directory on the server.

5.5.3.  MAC-Functional Server

   With a MAC-Functional server and a client that is not, the client
   behaves as if it were in a normal NFSv4.2 environment.  Since the
   process on the client does not provide a security attribute, the
   server must define a mechanism for labeling all requests from a
   client.  Assume that the server is using the same criteria used in
   the first example.  The server sees the request as coming from a
   subnet that is a Secret network.  The server determines that all
   clients on that subnet will have their requests labeled with Secret.
   Since the directory on the server is labeled Top Secret and Secret
   does not dominate Top Secret, the server would fail the request with
   NFS4ERR_ACCESS.

6.  Security Considerations

6.1.  Trust Needed for a Community

   Labeled NFS is a transport mechanism for labels, a storage
   requirement for labels, and a definition of how to interpret labels.
   It defines the responsibilities of the client and the server in the
   various permutations of being MAC-Functional.  It does not, however,
   dictate in any manner whether assumptions can be made about other
   entities in the relationship.  For example, it does not define
   whether a MAC-Functional client can demand that a MAC-Aware server
   only accept requests from other MAC-Functional clients.  That is a
   policy based on a MAC model, and this document does not impose
   policies on systems.

   As the requirement is a policy, it can be met with the use of a MAC
   model.  Let L be an LFS that implements the Limited Server mode,
   i.e., a MAC-Aware server connected to MAC-Functional clients.  Then
   a new LFS, L', can be created that has the additional policy that
   the MAC-Aware server MUST NOT accept any requests from a
   non-MAC-Functional client.

6.2.  Guest Mode

   When either the client or server is operating in Guest Mode, it is
   important to realize that one side is not enforcing MAC protections.
   Alternate methods are being used to handle the lack of MAC support,
   and care should be taken to identify and mitigate threats from
   possible tampering outside of these methods.

6.3.  MAC-Functional Client Configuration

   We defined a MAC model as an access control decision made on a system
   in which normal users do not have the ability to override policies
   (see Section 1).  If the process labels are created solely on the
   client, then if a malicious user has sufficient access on that
   client, the Labeled NFS model is compromised.  Note that this is no
   different from:

   o  current implementations in which the server uses policies to
      effectively determine the object label for requests from the
      client, or

   o  local decisions made on the client by the MAC security system.

   Either the server must explicitly trust the client (as in [SENFSv3])
   or the MAC model should enforce that users cannot override policies,
   perhaps via an externally managed source.

   Once the labels leave the client, they can be protected by the
   transport mechanism as described in Section 3.2.

7.  References

7.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

7.2.  Informative References

   [DTOS]     Smalley, S., "The Distributed Trusted Operating System
              (DTOS) Home Page", December 2000, <http://www.cs.utah.edu/
              flux/fluke/html/dtos/HTML/dtos.html>.

   [NFSv4_2]  Haynes, T., "NFS Version 4 Minor Version 2", Work in
              Progress, February 2014.

   [RFC4949]  Shirey, R., "Internet Security Glossary, Version 2", RFC
              4949, August 2007.

   [RH_MLS]   "Multi-Level Security (MLS)", "Deployment, configuration
              and administration of Red Hat Enterprise Linux 5, Edition
              10", Section 49.6, 2014, <http://docs.redhat.com/docs/
              en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/
              sec-mls-ov.html>.

   [RPC_SEC]  Adamson, W. and N. Williams, "Remote Procedure Call (RPC)
              Security Version 3", Work in Progress, February 2014.

   [SENFSv3]  Carter, J., "Implementing SELinux Support for NFS",
              <http://www.nsa.gov/research/_files/selinux/papers/
              nfsv3.pdf>.

   [SYSV]     AT&T, "System V Interface Definition (SVID)", Third
              Edition, Addison-Wesley, Reading, MA, 1989.

Appendix A.  Acknowledgments

   David Quigley was the early energy in motivating the entire Labeled
   NFS effort.

   James Morris, Jarrett Lu, and Stephen Smalley all were key
   contributors to both early versions of this document and to many
   conference calls.

   Kathleen Moriarty provided use cases for earlier versions of the
   document.

   Dan Walsh provided use cases for Secure Virtualization, Sandboxing,
   and NFS homedir labeling to handle process separation.

   Trond Myklebust provided use cases for secure diskless NFS clients.

   Both Nico Williams and Bryce Nordgren challenged assumptions during
   the review processes.

Author's Address

   Thomas Haynes
   NetApp
   495 East Java Dr.
   Sunnyvale, CA  94089
   USA

   Phone: +1 408 215 1519
   EMail: tdh@excfb.com

ISO Plain Language

On this page
PROBLEMMandatory access control decides access by comparing a label on the subject with a label on the object. Over NFS, the object lives on a server and the subject runs on a client, so the labels have to travel and both ends have to agree on what they mean.
MECHANISMThe RFC sets out the requirements: clients must convey their privileges, servers must store and return labels and notify of changes, and both must be able to negotiate and translate label formats. Labels carry a Label Format Specifier so that an opaque label can be interpreted, and three modes of operation are defined depending on which end enforces.
WHY IT MATTERSIt is an Informational RFC that records requirements rather than specifying a protocol. It also lists the trust assumptions that each mode needs, and warns that in Guest Mode one side is not enforcing anything at all.

§1Mandatory and Discretionary Access Control

Mandatory access control systems, as defined in the Internet Security Glossary, have been mainstreamed in modern operating systems such as Linux, FreeBSD and Solaris. They bind security attributes to subjects, which are processes, and to objects within the system, and those attributes are used with other information to make access control decisions.

Access control models such as Unix permissions or access control lists are commonly called discretionary access control. Those base their decisions on user identity and resource ownership. Mandatory models base their decisions on the label on the subject and on the object it wishes to reach. The labels may carry user identity information but usually carry more. In a discretionary system users are free to specify the access rules for the resources they own; a mandatory model bases its decisions on a system-wide policy that the users cannot override.

The RFC sets out the trade-off. Discretionary systems give some protection against unauthorized users running malicious software, but even an authorized user can execute malicious or flawed software with the program running at the full permissions of that user. Mandatory models can confine malicious or flawed software, and they usually act at a finer granularity than their discretionary counterparts.

Besides describing the requirements, the document records the functional requirements the client inherits from the security models already present on it. It says this may help readers outside the NFS community understand those issues.

Discretionary control lets a file's owner decide who may open it. Mandatory control puts the decision in a system-wide policy that the owner cannot overrule, and that is what lets a system contain broken or hostile software.

§2The Terms Used

The definitions carry most of the requirements, so they are worth stating precisely.

An object is a passive resource the system wants to protect: files, directories, pipes, sockets and many other system resources relevant to the protection of the system state. A subject is an active entity, usually a process, requesting access to an object.

Labels come in two flavours. A foreign label is a label in a format other than the one the local mandatory access control implementation uses for encoding. A Label Format Specifier is an identifier the client uses to establish the syntactic format of the security label and the semantic meaning of its components. An optional part of a Label Format Specifier is the Policy Identifier, which lets clients and servers identify specific security policies.

Two capability levels are defined for servers and clients. A server is MAC-Aware if it can transmit and store object labels. A client or server is MAC-Functional if it is Labeled NFS enabled, meaning it can interpret labels and apply policies based on the security system. Multi-Level Security is the traditional model in which objects are given a sensitivity level, such as Unclassified, Secret or Top Secret, and a category set.

A server that can only carry labels around is MAC-Aware. One that can read them and act on them is MAC-Functional. The Label Format Specifier is the tag that says how to read the label that follows it.

THE TERMS THE REQUIREMENTS TURN ON
  • Label Format SpecifierAn identifier the client uses to establish the syntax of a security label and the meaning of its components.
  • Foreign labelA label in a format other than the one the local mandatory access control implementation uses.
  • MAC-AwareA server that can transmit and store object labels.
  • MAC-FunctionalA client or server that can interpret labels and apply policies based on the security system.
  • Policy IdentifierAn optional part of a Label Format Specifier that lets clients and servers name a specific security policy.

§3The Requirements

The requirements were gathered from users and developers and from earlier work in the area, such as the Distributed Trusted Operating System and the NSA's experimental NFSv3 enhancements.

The general requirements are four. Clients must be able to convey to the server the client's privileges, that is the subject making the request, so that the server may enforce a policy based on them. Servers must be able to store and retrieve the security attribute of exported files as the client requests. Servers must provide a mechanism for notifying clients of attribute changes of files. And clients and servers must be able to negotiate label formats and provide a mechanism to translate between them.

On security services, Labeled NFS or the system underneath it must provide authentication, integrity and privacy for all NFSv4.2 messaging, with the mechanisms configurable so that the level of protection can be set per mandatory security policy. Strong mutual authentication is required between server and client for Full Mode. Security labels and related state must always be protected by those services when they cross the network, as must the binding of labels and state to the objects and subjects they belong to.

On encoding, the encoding of labels and attributes passed over the network must be specified in a complete and unambiguous way while keeping the flexibility of the implementations. To do that, the labels must consist of a format-specific component bound with a Label Format Specifier, which identifies the structure and semantics of the opaque component, while the opaque component is the label the models will interpret. Because a given model requires a label to mean exactly the same thing on every system, it is recommended that most label formats incorporate semantically coherent labelling. Labeled NFS must provide a means for servers and clients to identify their Label Format Specifiers, and their mode of operation, and a negotiation scheme should let systems of different label formats agree how they will interpret or translate each other's foreign labels, with several concurrent agreements possible between a server and a client. All labels transferred across the network must be tagged with a valid Label Format Specifier, and a system that receives a label tagged with a specifier it does not recognise or cannot interpret must reject it.

On labelling, implementations must validate the labels supplied over the network against the set permitted from a specific peer and reject those that are not. At the client, labelling semantics for mounted file systems must stay consistent with those for locally mounted ones, with user-level labelling operations enacted locally through existing APIs. When an object is created by the client, the client calculates its label from its policy and sends the request, and the server may deny the creation with that label, and the server must bind the label to the object before the object becomes visible. The server must let clients retrieve security labels on all exported objects where possible, must honour a client-specified label on creation, and may reject it, and may translate a label but must not change its meaning.

On enforcement, a MAC-Functional client applies its own policy to remotely located objects using the labels it got from the server, and it must be possible to configure how long it may cache label state before revalidating it. If the server's policy changes, the client must flush all object state back to the server, and the server must check that flushed state against current policy before committing it. A MAC-Functional server must enforce its policy over all exported objects for operations that originate both locally and remotely, processing requests from authenticated clients using the labels and credentials the client supplied as if they had originated locally. The server should also recall a delegation when an object's label changes. The server should provide a way to authorize selective access to the exported namespace based on client credentials and policy, which is a common requirement of multi-level security systems that present selective views of namespaces based on subject clearances.

The client must say who is asking, the server must keep and return the labels and say when they change, and both ends must agree on how to read a label. Each side then applies its own policy to what the other returned.

§4Modes of Operation

A client and server interaction can be described by three modes, which arise from the level of mandatory access control functionality on each side. Clients can be non-MAC-Functional or MAC-Functional; servers can be non-MAC-Functional, MAC-Aware or MAC-Functional. A MAC-Functional client must be able to determine the level of functionality in the server, and a MAC-Functional server must be able to determine whether the client is MAC-Functional, and the protocol must provide for both determinations.

In Full Mode the server and client have mutually recognized mandatory access control functionality enabled and full Labeled NFS functionality is extended over the network. On the initial lookup the client requests access to an object and sends its process security context; the server checks its policies to see whether that process context from that client may reach the resource, and if so releases the object with its security information; the client then applies its own policy. On later operations, where the client already has a handle, the order is reversed: the client checks its own policy first, which saves it sending requests that would fail anyway, and then sends the request so the server can apply its policy using the client's process context. A client that does not trust the server may use an alternate labelling mechanism regardless of the server's ability to return security information.

In Limited Server Mode the server is MAC-Aware and the clients are MAC-Functional. The server can store and transmit labels but cannot enforce them, and it must inform clients when an object label changes for a file the client has open. The server may not know the format of any of its object labels and may service several different security models at once, so the client must handle foreign labels. As with Guest Mode, this mode's level of trust can be degraded if non-MAC-Functional clients can reach the server.

In Guest Mode only one of the server or client is MAC-Functional. If the server is the enforcing side, it applies its policy and may selectively provide standard NFS services to clients based on their authentication credentials or associated network attributes, such as IP address or network interface. If the client is the enforcing side, it must operate as a standard NFSv4.2 client and should selectively give processes access to servers according to policy, and it may override the default labelling of the remote file system. In both cases the wire protocol is standard NFSv4.2, and the enforcing side maps the other side's processes or objects onto security labels so that its own guarantees hold.

Three arrangements: both ends enforce, only the server stores labels and only the client enforces, or only one end enforces while the other is a guest. The protocol must let each side work out which arrangement it is in.

THE THREE MODES OF OPERATION
ModeWho enforcesWhat the other side does
FullBoth the client and the serverThe server checks the client's process context, then the client applies its own policy.
Limited ServerThe client onlyThe server is MAC-Aware: it stores and transmits labels and reports changes, but cannot enforce them.
GuestOne side onlyThe other side is plain NFSv4.2, and the enforcing side maps its processes or objects onto labels.

§5Use Cases

The RFC gives examples of how NFSv4.2 could be deployed in existing situations, and they are not meant to be exhaustive.

The first is full mandatory access control for remotely mounted file systems, in a local network where servers and clients are under common administration and all systems run the same implementation with semantically identical labels. An example is user home directories mounted remotely, where fine-grained policy protects private user data from being read by malicious web scripts running in the user's browser, which labelled NFS makes possible.

The second is labelling virtual machine images stored on the network. Guest file systems are commonly stored on a networked server and mounted by the guest at instantiation, and the guest kernel needs to read fine-grained labels on that file system so that its own policy applies.

The third is simple security label storage, in a mixed and loosely administered network where nodes run different operating systems with different security mechanisms. Here the file servers are simply able to store and return labels, and the protocol is implemented only to carry labels across the network. The RFC notes that overall security cannot be enforced as strongly in such an environment as when the server is also enforcing, and that the aim is to let MAC-capable clients keep their policy switched on rather than disable it.

The fourth is diskless Linux, where a distribution depends on a mandatory access control model to implement a kernel-enforced policy that assigns roles to processes and limits what they may do to files, directories, sockets and other objects. Enforcement is typically a matter for the diskless client itself, so using RPCSEC_GSSv3 to enforce compliance at the server is of limited value. Being able to label files permanently and have those labels read back by the client is what makes such policies work, including role transitions that standard NFS access control models cannot replicate.

The fifth is multi-level security, where objects get a sensitivity level and a set of compartments, and read access is allowed when the subject's level dominates the object's and its compartments are a superset. The example uses Unclassified, Secret and Top Secret levels and a directory labelled Top Secret, so only a Top Secret subject may read it. With a MAC-Functional client and server, a process running at Secret that calls readdir() is stopped by the client's MAC module before any request leaves the machine, while a process running at Top Secret passes, sends the request with the right credential, and the server checks its own module before returning the contents. If the two ends run different policies, a translation of the labels might be needed, and a check could pass on the client and fail on the server: a server that treats a subnet as cleared only up to Secret would refuse a client asserting Top Secret on it.

The RFC shows labels being used for remote home directories, for virtual machine images, as a simple store of labels on a mixed network, for diskless clients with role-based policies, and for classified networks where a clearance decides what can be read.

WHAT LABELED NFS IS USED FOR
Use caseWhat it assumesWhat Labeled NFS adds
Remote home directoriesOne administration and the same implementation everywhereFine-grained labels on remote files, so a policy can keep scripts in a browser away from private data.
Virtual machine imagesGuest file systems stored on a networked serverThe guest kernel can read the labels of the mounted file system and apply its policy.
Simple label storageA mixed network with many security modelsThe server only stores and returns labels; enforcement stays on the client.
Diskless LinuxThe client enforces the policy itselfLabels read back from the server, which is what makes role transitions possible.
Multi-level securitySensitivity levels and compartmentsBoth ends check the level, so a Secret process cannot read a Top Secret directory.

§6Security Considerations

Labeled NFS is a transport mechanism for labels, a storage requirement for labels, and a definition of how to interpret labels. It defines the responsibilities of client and server in the various permutations of being MAC-Functional, but it does not dictate whether assumptions can be made about other entities in the relationship. For example, it does not define whether a MAC-Functional client can demand that a MAC-Aware server accept requests only from other MAC-Functional clients. That is a policy based on a mandatory access control model, and the document does not impose policies on systems. Because the requirement is a policy, it can be met with the model itself: a new Label Format Specifier can be created that adds the rule that the MAC-Aware server must not accept any requests from a non-MAC-Functional client.

In Guest Mode one side is not enforcing mandatory access control protections. Alternate methods are used to handle the lack of support, and care should be taken to identify and mitigate threats from possible tampering outside those methods.

The third point is about the client's own configuration. If the process labels are created solely on the client, then a malicious user with sufficient access on that client compromises the model. This is no different from current implementations in which the server uses policies to determine the object label for requests from the client, or from local decisions made by the client's own security system. Either the server must explicitly trust the client, or the model must enforce that users cannot override the policies, perhaps through an externally managed source. Once the labels leave the client, the transport mechanism described in the requirements protects them.

The document does not decide who to trust. That is a policy choice for each deployment. What it does warn about is Guest Mode, where one side enforces nothing, and a client that creates its own labels, where a user with enough access to that client can break the whole scheme.

§7References

[RFC4949]RFC 4949Shirey, R., "Internet Security Glossary, Version 2", RFC 4949, August 2007.August 2007[RFC2119]RFC 2119Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.March 1997
[NFSv4_2]Haynes, T., "NFS Version 4 Minor Version 2", Work in Progress, February 2014.
[RPC_SEC]Adamson, W. and N. Williams, "Remote Procedure Call (RPC) Security Version 3", Work in Progress, February 2014.
[SENFSv3]Carter, J., "Implementing SELinux Support for NFS"