Skip to contentSkip to conversation

Security Enhanced NFS (SENFS) Requirements - draft 05

RFC James Morris 3 participants 15 messages Jun 20, 2007 – Jun 26, 2007 3 messages not in the archive SELinux security module

lore
Share & tools
lore
#0 lore raw

Attached is a draft requirements document for the integration of SELinux and NFSv4 (SENFS). Also available at:

http://namei.org/selinux/nfs/senfs-requirements-draft-05.txt

This has been through a few internal iterations from the SELinux side, and we hope to now obtain feedback from a wider audience, particularly Linux NFS developers.

The goals at this stage are to ensure we have capture all of the requirements correctly, and that we're on the right track in general.

Low-level implementation details are not considered in this document, and are intended to be outlined in a subsequent functional specification, once the requirements have been nailed down.

Please reply with any feedback.

The intention is to get SENFS on the IETF standards track, so any assistance in that area would also be appreciated.

- James

Signature · 2 lines
James Morris
<[email protected]>

Draft 05
James Morris 20 June 2007

Security Enhanced NFS (SENFS) Requirements - Draft 05

1. Introduction

This document outlines high-level requirements for the integration of SELinux [1] functionality into NFSv4 [2].

SELinux, an implementation of the Flask security architecture [3], provides a flexible and comprehensive Mandatory Access Control (MAC) framework for the Linux operating system. This framework has been ported to several other operating systems, including Darwin [4] and BSD [5].

2. Problem Statement

SELinux currently supports per-object labeling of filesystem objects through the use of Linux Extended Attributes (EAs) [6]. This provides filesystem labeling portability, and a unified API and mechanism for storing and retrieving security labels associated with each filesystem object.

For filesystems which do not support EAs, other labeling mechanisms have been devised, such as genfs, which performs labeling based upon the filesystem type and optionally also by pathname; and mountpoint labeling, which allows the security labels for all objects within a filesystem to be specified as a mount option.

Labeling for NFS mounts under SELinux currently defaults to the genfs mechanism, and is often customized via mountpoint labeling. While this allows SELinux policy to provide coverage of NFS mounts, there are several limitations, including:

o Labeling granularity is generally too coarse when applied to the entire filesystem.

o Pathname labeling for NFS mounted files is not a general solution, and is only reliable if the exported namespace is static.

o Any underlying security labeling of the exported filesystem is not conveyed over the network.

o Security labels cannot be set on the remote filesystem by the client.

The broad purpose of SENFS is to address these limitations by providing distributed per-object security labeling of NFS mounted filesystems.

3. Requirements

The following initial requirements have been gathered from users, developers, and from previous development efforts in this area such as DTOS [7] and NSA's experimental NFSv3 enhancements [8].

3.1. Community Acceptance

SENFS must be designed and implemented in a manner which is acceptable to several upstream communities, including:

o SELinux

o Linux kernel

o Linux NFS

o IETF

o Non-Linux OSes with SE implementations

SENFS must be designed to ensure compliance with IETF extensibility requirements for NFSv4 and similarly for any related standards. A specification for SENFS should be developed with the aim of becoming an IETF standard.

The design and implementation also must pass acceptance in upstream development communities, and not require the use of external patches or modules.

Potential non-Linux implementors should be consulted for feedback on the design of SENFS.

3.2. Portability

SENFS must be designed with portability in mind, to facilitate implementations on non-Linux OSes which support the SELinux model.

3.3. Interoperability

SENFS must be designed and developed to facilitate interoperability between different SENFS implementations.

SENFS modifications to standard NFSv4 implementations must not adversely impact any existing interoperability of those implementations.

3.4. Performance

Security mechanisms often impact on system performance. SENFS should be designed and implemented in a way which avoids significant performance impact where possible.

3.5. Scalability

As NFSv4 is designed for large-scale distributed networking, SENFS should also be capable of scaling in a similar manner to underlying implementations where possible.

3.6. Resilience

SENFS should be respond in a robust manner to system and network outages associated with typical enterprise and Internet environments. At the very least, SENFS should always operate in a fail-safe manner, so that service disruptions do not cause or facilitate security vulnerabilities.

3.7. Security Services

SENFS must ensure that the following security services are provided for all NFSv4 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 will be required between the server and the client for Full Mode operation (see 3.11 Modes of Operation).

Security services should be implemented according to IETF or other appropriate standards.

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

SENFS should support authentication on a per-domain granularity so that different domains running on a client can use different cryptographic keys and facilities.

3.8. Encoding

Encoding of SELinux labels and attributes passed over the network must be specified in a complete and unambiguous manner.

3.9. Domains of Interpretation

In SELinux, a Domain of Interpretation (DOI) represents an administrative security boundary, where all systems within the DOI have semantically coherent labeling. That is, a security label must always mean exactly the same thing anywhere within the DOI. An SELinux DOI may be further demarcated for any other administrative purpose.

SENFS must provide a means for servers and clients to identify their DOIs for the purposes of authorization, security service selection, and security label interpretation.

A negotiation scheme should be provided, allowing systems from different DOIs to agree on how they will interpret or translate each others labels. Multiple concurrent DOI 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 DOI.

If the DOI of a system changes, it should renegotiate any DOI agreements to reflect the new DOI.

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

NFSv4 includes features which may cause a client to cross a DOI boundary when accessing what appears to be a single filesystem. If DOI negotiation is supported by the client and the server, the server should negotiate a new, concurrent DOI agreement with the client, acting on behalf of the externally located source of the files.

SENFS should define an initial DOI negotiation scheme and DOI format with the primary aims of simplicity and completeness. This is to facilitate practical deployment of multi-DOI systems without being weighed down by complex and over-generalized global schemes. Future extensibility should also be taken into consideration.

3.10. Auditing

The capability must exist for all security-relevant events within an SENFS implementation to be logged for audit purposes. SENFS should utilize the system's security audit subsystem if available, or otherwise default to logging via the most reliable mechanism available.

3.11. Modes of Operation

SENFS must cater for two potentially concurrent operating modes, depending on the state of SELinux functionality:

3.11.1 Full Mode

Both the server and the client have SELinux enabled, and full SENFS functionality is extended over the network between both client and server.

If the client is operating in permissive mode, any delegated server policy must still be enforced; otherwise all caching and delegation must be disabled.

If the server is running in permissive mode, access control extended over the network must operate as if enforcing mode is enabled. There is no permissive mode equivalent for client SENFS access.

If the client process specifies mountpoint labeling for an NFS mount, then it must not also operate in Full Mode for that mount, and instead operate in Guest Mode (see below). SENFS configuration must override mountpoint labeling requests, and if there is a conflict, the mount operation must fail.

3.11.2 Guest Mode

Only one of the server or client has SELinux enabled.

In the case of the server only having SELinux enabled, the server locally 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.

As for Full Mode, if the server is running in permissive mode, access control extended over the network must operate as if enforcing mode is enabled.

In the case of the client only having SELinux enabled, the client must operate as a standard NFSv4 client, and should selectively provide local domains access to servers based upon the security attributes of the local domains, and network attributes of the server, according to policy. The client may also override default labeling of the remote filesystem based upon these security attributes, according to policy.

In other words, Guest Mode is standard NFSv4 over the wire, but with the SELinux-enabled peer optionally using fine-grained mandatory policy to provide enhanced local security labeling and access control.

3.12. 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.12.1 Client Labeling

At the client, labeling semantics for NFS mounted filesystems must remain consistent with those for locally mounted filesystems. In particular, user-level labeling operations local to the client must be enacted locally via the Extended Attribute system call API, 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, the correct security label for the file must be determined by server policy (or overridden by the creating process's fscreate attribute if authorized by server policy), and 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.

All object labeling semantics must be identified in a complete manner, then mapped to SENFS operational behaviors.

3.12.2 Server Labeling

SENFS servers must not return a successful response if a client attempts to set a security label on a filesystem object where the underlying filesystem does not support stable storage of security labels.

Furthermore; any operation invoked by the client which involves any change to a security label on the server must not return successfully until that label is committed to stable storage.

The server must provide the capability for clients to retrieve security labels on all exported filesystem 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 filesystems.

The server must honor the fscreate attribute of a process on the client if permitted by server policy. The fscreate attribute is used by privileged security-aware applications, where created objects are labeled atomically with a specific security label instead of using local labeling policy.

Labeling on by the server must also take into account any other volatile client security state, such as a change in process security context via dynamic transition.

3.13. Policy Enforcement

3.13.1. Full Mode

The server must enforce its local security policy over all exported objects, for operations which 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 server 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 domain accessing the object, rather than the domain which opened it, if different.

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.

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

A mechanism must exist to allow the client to obtain access and labeling decisions from the server for locally cached and delegated objects, so that it may apply the server's policy to these objects. 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.

SENFS implementations should provide a mechanism to convey audit messages from the server to the client, so that a remote access denial or other significant event may be fully understood at the client.

3.13.2. Guest Mode

The server must not accept security labels or credentials provided by the client, and only enforce its local policy to exported objects.

3.14. Namespace Access

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

3.15. External Remote Filesystems

Under NFSv4, filesystems located externally to the server may be exported in the same namespace as locally exported filesystems.

SENFS will not support this initially in Full Mode, although for Guest Mode, the server may convey locally generated security labels to the client.

3.16. Referrals

SENFS will not initially provide explicit support for NFSv4.1 referrals, although may do so in a future version.

3.17. Server Mediation

Care must be taken to ensure that SELinux mediation of the NFS server is always correct in relation to whether it is acting on behalf of the client or itself, and that there are no mediation gaps arising from security bypasses intended for previously non-SENFS aware kernel components of the NFS subsystem, where applicable.

3.18. Preservation of Existing Behavior

SENFS modifications made to existing NFS implementations must ensure that existing behavior is preserved if SELinux is disabled at either compile or run time.

4. Next Steps

The intention is to subject these requirements to several iterations of review from an increasingly wider audience. Once there is consensus on the requirements, a functional specification will be designed and also subjected to review, ideally in parallel with prototyping.

5. Author Contact

James Morris <[email protected]>

6. Acknowledgments

The following people provided valuable feedback during the development of this document:

Stephen Smalley, NSA
James Carter, NSA
Karl MacMillan, Red Hat Inc.

7. References

[1] Security Enhanced Linux (SELinux)

      http://www.nsa.gov/selinux/

[2] RFC3530, Network File System (NFS) version 4 Protocol

      http://www.ietf.org/rfc/rfc3530.txt

[3] The Flask Security Architecture: System Support for Diverse Security Policies

http://www.cs.utah.edu/flux/papers/flask-usenixsec99-abs.html

[4] SEDarwin: Security Enhanced Darwin

http://www.sedarwin.org/

[5] SEBSD: Port of SELinux FLASK and Type Enforcement to TrustedBSD

http://www.trustedbsd.org/sebsd.html

[6] Linux Extended Attributes and ACLs

      http://acl.bestbits.at/

[7] The Distributed Trusted Operating System (DTOS) Home Page

http://www.cs.utah.edu/flux/fluke/html/dtos/HTML/dtos.html

[8] Implementing SELinux Support for NFS

http://www.nsa.gov/selinux/papers/nfsv3-abs.cfm

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 9 lines · J. Bruce Fields
Quoted 3 lines · James Morris

SENFS should support authentication on a per-domain granularity so that different domains running on a client can use different cryptographic keys and facilities.

Sorry, I'm not totally sure I understand what a "domain" is. I assume every rpc call will need to be associated with a domain? (Just one, or is it every more than one?) If you need a different credential for each domain, what kind of access control do you need for those credentials?

A domain in SELinux refers to a process running in a specific security context (i.e. with a specific security label). Processes running in the same domain are considered equivalent by SELinux from a security point of view.

An example of the above is that a process labeled as "unclassified" might not have access to the same keying material as a process labeled as "secret", and the system needs to differentiate on that basis.

Generally, the SELinux credentials need to be used as factors in authentication when providing NFS access.

Each RPC call would be associated with an individual process on the client, although SELinux would only make use of the SELinux labels, which are applied at domain granularity.

Per-domain access control needs to cover all security-relevant aspects of the interaction, and would be configured in SELinux security policy.

Quoted 9 lines
Quoted 7 lines

3.9. Domains of Interpretation

In SELinux, a Domain of Interpretation (DOI) represents an administrative security boundary, where all systems within the DOI have semantically coherent labeling. That is, a security label must always mean exactly the same thing anywhere within the DOI. An SELinux DOI may be further demarcated for any other administrative purpose.

Does the current SELinux have any notion of a DOI?

DOI is an attribute negotiated and used by the IPsec labeled networking in SELinux.

Quoted 2 lines

Would it be possible to ignore this problem in a first implementation, and just assume the client and server are always in the same DOI?

We want to build DOI support in from the start, rather than try and add it later. Identifying and checking DOIs is not difficult, although things like translation can be (and this aspect will not be mandatory).

Quoted 9 lines
Quoted 5 lines

3.14. Namespace Access

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

Could you give an example? Why is this necessary, and how does it go beyond the ordinary access control used for files in the exported filesystems?

Good point -- in general, SELinux access control would simply handle this correctly.

There are cases, though, where multi-level security folk might want to either hide part of the namespace completely, or even present a different view, based on the client domain. e.g. domains labeled as 'unclassified' objects only see:

server:/export

       |-- rfcs
       |-- usenet

while domains labeled as 'secret' only see:

server:/export

       |-- memos

In the MLS world, this kind of thing is a common requirement (where it's sometimes referred to as multilevel directories, or more generally, polyinstantiation).

Quoted 6 lines
Quoted 4 lines

3.15. External Remote Filesystems

Under NFSv4, filesystems located externally to the server may be exported in the same namespace as locally exported filesystems.

You're thinking of referrals here, or something else?

Yes.

Quoted 5 lines
Quoted 3 lines

SENFS will not support this initially in Full Mode, although for Guest Mode, the server may convey locally generated security labels to the client.

I don't understand.

If my understanding of multi-server name spaces & referrals is correct, then the NFS server may be exporting a filesystem from another machine as if it was its own.

In this case, we won't initially try and solve the potential SELinux issues here (e.g. conveying SELinux state between multiple parties, and across multiple security boundaries), and instead just allow the server to assign labels to the filesystem itself. This would likely be some default label for the entire referred fs.

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
Quoted 10 lines · James Morris
Quoted 5 lines
Quoted 3 lines

SENFS will not support this initially in Full Mode, although for Guest Mode, the server may convey locally generated security labels to the client.

I don't understand.

If my understanding of multi-server name spaces & referrals is correct, then the NFS server may be exporting a filesystem from another machine as if it was its own.

Quoted 5 lines

In this case, we won't initially try and solve the potential SELinux issues here (e.g. conveying SELinux state between multiple parties, and across multiple security boundaries), and instead just allow the server to assign labels to the filesystem itself. This would likely be some default label for the entire referred fs.

It seems my understanding here is wrong, after re-reading the 4.1 spec. I need to rework this section of the document.

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw
In reply to James Morris
Quoted 9 lines · --- James Morris

Attached is a draft requirements document for the integration of SELinux and NFSv4 (SENFS). Also available at:

http://namei.org/selinux/nfs/senfs-requirements-draft-05.txt

This has been through a few internal iterations from the SELinux side, and we hope to now obtain feedback from a wider audience, particularly Linux NFS developers.

Quoted 8 lines

The goals at this stage are to ensure we have capture all of the requirements correctly, and that we're on the right track in general.

Low-level implementation details are not considered in this document, and are intended to be outlined in a subsequent functional specification, once the requirements have been nailed down.

Please reply with any feedback.

Somewhere between 2000 and 2002 (it's all a blur to me now) SGI made the OB1 project available on oss.sgi.com. Included in this project was the source code for an extended attribute protocol to sit beside NFSv3. I have attached the code as a worked example of how one can go about implementing linux style* extended attributes in a distributed environment. This scheme does not address all of your requirements, it only addresses transport and storage, it does not address authentication or validation.

---
* Linux style extended attributes are closely modeled after Irix extended attributes.

Casey Schaufler
[email protected]

#5 lore raw
Quoted 2 lines · Casey Schaufler

Somewhere between 2000 and 2002 (it's all a blur to me now) SGI made the OB1 project available on oss.sgi.com.

I remember that :-)

Quoted 7 lines

Included in this
project was the source code for an extended attribute protocol to sit beside NFSv3. I have attached the code as a worked example of how one can go about implementing linux style* extended attributes in a distributed environment. This scheme does not address all of your requirements, it only addresses transport and storage, it does not address authentication or validation.

Interesting -- I gather you ran this over labeled networking?

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#6 lore raw
Quoted 15 lines · --- James Morris
Quoted 2 lines · Casey Schaufler

Somewhere between 2000 and 2002 (it's all a blur to me now) SGI made the OB1 project available on oss.sgi.com.

I remember that :-)

Quoted 7 lines

Included in this
project was the source code for an extended attribute protocol to sit beside NFSv3. I have attached the code as a worked example of how one can go about implementing linux style* extended attributes in a distributed environment. This scheme does not address all of your requirements, it only addresses transport and storage, it does not address authentication or validation.

Quoted 1 line

Interesting -- I gather you ran this over labeled networking?

You can, and we did, but we also ran it over unlabeled networks. It is a protocol that handles extended attributes, which Irix (vanilla Unix) used for ACLs and capabilities. The protocol is agnostic to the use to which the attributes are put and to their content, like any good file system. It doesn't do crypo. It does not do attribute validation or translation, but neither do other file systems.

I have ideas on those issues, but gotta run. I'll see about coming back to it.

Casey Schaufler
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 3 lines · Christoph Hellwig

I'd love to see having support for this protocol on Linux. There's a lot of demand both for security label and just general user extended attributes on NFS.

NFSv4 has named attributes, which are modeled on Solaris subfile-style extended attributes. Technically, I think we could emulate Linux style xattrs over named attributes, but it's ugly:

1. Semantics would need to be restricted to those of Linux xattrs, so that they act like strings rather than streams, don't allow subdirectories etc.

2. Named attributes are specified as being opaque to NFS and for use by applications. This conflicts with security labeling, where labels are typically manipulated and interpreted at the kernel level as well as the application level (similar issues exist for some other Linux xattr types such as 'system' and 'trusted').

3. Under Linux, xattr semantics are encoded into the xattr namespace. e.g. SELinux labels are in the "security.selinux" namespace, where both the security and selinux components specify semantics. Trying to emulate this over named attributes would further conflict with their opaque and user-managed characteristics. We'd need to do some ugly things like perhaps reserve a top-level namespace which implements Linux semantics, and try to prevent interoperability issues such as an unprivileged user on a Solaris client arbitrarily setting security xattrs on a Linux server.

4. SELinux labels, and potentially other kernel-managed Linux xattrs, require considerably more state than can be conveyed by any simple notion of attributes over the wire. xattrs are an appropriate local mechanism for security labeling, because they provide a consistent API and filesystem portability. However, other local security state is also utilized by the security system, such as the current security label of the process accessing the file (as opposed to the one which opened it) and its fscreate attribute. Once we start to distribute SELinux labeling, it becomes apparent that we need to a lot more than simply send file labels over the wire. In addition to managing volatile client security state, we need to cater to many other aspects of the system, including but not limited to: binding SELinux-specific authentication credentials to operations; allowing the client to obtain SELinux labeling and enforcement decisions from the server for cached/delegated objects; ensuring consistency when server policy changes; and conveying audit messages across the wire.

One approach would be to extend NFSv4 to support Linux-style xattrs as a distinct set of operations (e.g. SETXATTR, GETXATTR etc), which I understand would also be useful for a few other OSs.

This would certainly allow for a clean implementation of user-managed xattrs, potentially addressing the first three items above. However, it would not address the wider set of issues arising from kernel-managed labeling per the fourth item above.

xattrs over the wire are probably a good fit for user-managed xattrs, as the network protocol maps well to local filesystem operations, but they're not a good general solution for kernel-managed xattrs.

(Note that the Linux NFSv4 ACL implementation does not use xattrs over the wire, even though xattrs are used as a mechanism at the local filesystem level).

There are existing mechanisms in NFSv4 which are both extensible and likely to provide more natural mapping of requirements. e.g. extend SETATTR for the actual labeling, which has existing provisions for interoperability and is in fact described as a mechanism for modifiying authorization on objects. We don't need to create or adapt a separate mechanism in this case. Similar for GETATTR and potentially others.

So, what I think we have here are two separate problems to be solved:

a) Extending security labeling to NFSv4, where conveying security labels over the wire is a relatively small part of a complex project, and is not served optimally by a generalized NFS xattr scheme.

b) Implementing generalized user-managed xattrs with Linux/BSD semantics as set of new NFSv4 operations.

The focus of this work would be on (a), and I think that (b) is an entirely separate and somewhat simpler project.

Btw, I will be in Ottawa next week. Perhaps it might be worth organizing a lunch or similar for people who are there and interested in discussing this.

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 9 lines · --- "J. Bruce Fields
Quoted 3 lines · James Morris

NFSv4 has named attributes, which are modeled on Solaris subfile-style extended attributes. Technically, I think we could emulate Linux style xattrs over named attributes, but it's ugly:

Agreed.

I don't understand the argument against using xattrs for security labels, though:

Linux style xattrs work just fine on local file systems, agreed? Irix xattrs, which are a pretty difficult to distinguish from Linux xattrs, work on local and remote (NFSv3, CXFS) file systems and have for years. It seems to me that someone who says you can't do remote xattrs as an extension of existing protocols is going to have a tough row to hoe given the existance of the NFSv3 "helper" protocol I attached earlier and CXFS.

Quoted 18 lines
Quoted 17 lines

4. SELinux labels, and potentially other kernel-managed Linux xattrs, require considerably more state than can be conveyed by any simple notion of attributes over the wire. xattrs are an appropriate local mechanism for security labeling, because they provide a consistent API and filesystem portability. However, other local security state is also utilized by the security system, such as the current security label of the process accessing the file (as opposed to the one which opened it) and its fscreate attribute. Once we start to distribute SELinux labeling, it becomes apparent that we need to a lot more than simply send file labels over the wire. In addition to managing volatile client security state, we need to cater to many other aspects of the system, including but not limited to: binding SELinux-specific authentication credentials to operations; allowing the client to obtain SELinux labeling and enforcement decisions from the server for cached/delegated objects; ensuring consistency when server policy changes; and conveying audit messages across the wire.

Quoted 2 lines

This mostly seems to be an argument that we need something more than an xattr protocol on its own, which is obviously true.

The SELinux developers have made some design choices that do not distribute well and require additional mechanism to address. The attributes stored on an SELinux file system are meaningful only in relation to the policy against which they are generated. This has advantages but requires that enforcement engines sharing the data take steps to ensure consistancy.

An old fashioned MLS label (e.g. one the looks like a CISPO tag) can be shared more simply, all that is required is a common understanding between the machines about how users are assigned levels and categories.

Sharing SELinux labels will require a mechanism similar to IPSEC in both form and function to make the labels useful. Simpler labeling models, in which the label is either self contained, self describing, or obvious do not require that level of sophistication to safely share label data.

Quoted 4 lines

But I don't
understand why xattrs couldn't be used just for the purpose of getting and setting file labels. Maybe an example would help me understand the problems you're seeing?

They can and have been. It's a solved problem.

The problem is not transportation or storage. There are problems with protection of the data while it's in transit. There are problems with the label value stored by the client meaning something different to the server.

An interesting aside is that I have seen deployments where an NFS server running a "vanillia" Unix that supported extended attributes was used in conjuntion with MLS clients. It worked just fine and made backups much easier for the overall environment, taking advantage of the difference in access policy. Not reccomended for the faint of heart, of course.

I heartily recommend seperating the overall effort into three parts:

1. transportation and storage of general extended attributes.
2. protection and integrity of the information in #1.
3. translation and/or mutual policy enforcement negotiations.

For step 1 I have passed along a worked example.
For step 2 call to 1-800-GOTCRYPTO.
For step 3 you'll most likely want a framework so that machines with different SELinux policy files or other system differences (US DoD Secret is not the same as US DoE Secret) can figure out among themselves who gets to decide on a given access. That, or a mechanism for translating the attributes as they pass between machines. Or both.

Quoted 5 lines
Quoted 3 lines

Btw, I will be in Ottawa next week. Perhaps it might be worth organizing a lunch or similar for people who are there and interested in discussing this.

I'd be interested.--b.

Can't make it (again) this year.

Casey Schaufler
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#11 lore raw
Quoted 8 lines · Casey Schaufler

I heartily recommend seperating the overall effort into three parts:

1. transportation and storage of general extended attributes.
2. protection and integrity of the information in #1.
3. translation and/or mutual policy enforcement negotiations.

For step 1 I have passed along a worked example.
For step 2 call to 1-800-GOTCRYPTO.

NFSv4 security is based upon security at the RPC layer, and in practice will commonly utilize RPCSEC_GSS. It would not be impossible to use labeled IPSec, but it would not be acceptable as a general solution.

Quoted 1 line

From a user perspective, a labeled NFS mount should essentially "just

work" as it would for an unlabeled mount with say, kerberos security, and not require external IPsec configuration.

Note that further modifications would still need to be made to the protocol beyond step 1. As outlined, several aspects of security state need to be conveyed over the network and managed, and the labels on files are just one such aspect. Breaking this layer out is likely how we arrive at Paul Moore's labeled NFS (vs. SELinux specific).

Quoted 6 lines

For step 3 you'll most likely want a framework so that machines with different SELinux policy files or other system differences (US DoD Secret is not the same as US DoE Secret) can figure out among themselves who gets to decide on a given access. That, or a mechanism for translating the attributes as they pass between machines. Or both.

Indeed.

Quoted 13 lines
Quoted 6 lines
Quoted 4 lines

Btw, I will be in Ottawa next week. Perhaps it might be worth organizing a lunch or similar for people who are there and interested in discussing this.

I'd be interested.--b.

Can't make it (again) this year.

Casey Schaufler
[email protected]

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#12 lore raw
In reply to a message not in the archive
Quoted 5 lines · J. Bruce Fields

This mostly seems to be an argument that we need something more than an xattr protocol on its own, which is obviously true. But I don't understand why xattrs couldn't be used just for the purpose of getting and setting file labels. Maybe an example would help me understand the problems you're seeing?

I didn't say they couldn't be used.

NFSv4 has an existing extensible mechanism for modifying and retrieving authorization of objects (SETATTR/GETATTR), which maps well to the requirements e.g. the bitmap4 structure can be used to unambiguously signify whether security labels are supported.

If Linux-style xattrs are to be implemented in NFSv4, then they could be used, although I'm not sure it would be the cleanest approach.

I think network xattrs work well when they are opaque and user-managed, so that the semantics at the NFS layer are simple and consistent. With security labels, things are quite different in that they need to be interpreted and managed by the kernel, and that more generally, different types of kernel-managed labels may have vastly different semantics and are not necessarily a good case for a general solution. For example, consider xattrs used for other security mechanisms such as filesystem encryption or integrity labeling. I think there will be many instances of special case behavior with kernel-managed labels that do not fit cleanly with a generalized mechanism. Again, please note that ACLs do not use xattrs over the wire, even though they could technically and do at the local filesystem level.

It's not something I have extraordinarily strong feelings about. If the consensus is to do this with xattrs, then that's ok.

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#13 lore raw
In reply to a message not in the archive
Quoted 5 lines · J. Bruce Fields
Quoted 3 lines

Btw, I will be in Ottawa next week. Perhaps it might be worth organizing a lunch or similar for people who are there and interested in discussing this.

I'd be interested.--b.

Are any NFS discussions already planned?

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#14 lore raw
In reply to James Morris
Quoted 12 lines · James Morris

Attached is a draft requirements document for the integration of SELinux and NFSv4 (SENFS). Also available at:

http://namei.org/selinux/nfs/senfs-requirements-draft-05.txt

This has been through a few internal iterations from the SELinux side, and we hope to now obtain feedback from a wider audience, particularly Linux NFS developers.

The goals at this stage are to ensure we have capture all of the requirements correctly, and that we're on the right track in general.

Quoted 8 lines

Low-level implementation details are not considered in this document, and are intended to be outlined in a subsequent functional specification, once the requirements have been nailed down.

Please reply with any feedback.

The intention is to get SENFS on the IETF standards track, so any assistance in that area would also be appreciated.

Please understand the following is a bit of a nit, but I thought it might be a good idea to make this point now in an effort to make broader acceptance a bit easier ...

I realize the current motivation for this work is to enable SELinux, but considering section 3.1, "Community Acceptance", I wonder if the language in the document could be more implementation agnostic. I'm not a NFS expert, but in reading the requirements I did not see much that was specific to SELinux. Most of the requirements involved the careful binding of security labels to file objects and the honoring of those labels in both the security enforcement mechanisms of the NFS client and server. Granted there is language regarding per-domain authentication/configuration as well as SELinux DOIs but in reality I think the per-domain auth/config could be abstracted out to per-label auth/config and the concept of differing DOIs is not exclusive to SELinux. In fact I think that support of multiple DOIs is what could make this a very flexible mechanism, as we could abstract the NFS security label out to things other than SELinux contexts.

I believe that moving the requirement language from "SELinux NFS" to "labeled NFS" should eventually result in a cleaner design by forcing the implementation to treat the security label as an atomic attribute (a desire I often hear voiced about the SELinux context outside of the security server) as well as expanding the relevance of the standard to OS implementations that support labels but not SELinux style Domain Type Enforcement (i.e. conventional MLS systems, or other security models not yet envisioned). Granted, a general labeled NFS implementation would not be a magic bullet to solving interoperability, but it would at least provide a common mechanism for communication upon which DOI based translations could be built.

Signature · 7 lines
paul moore
linux security @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#15 lore raw
Quoted 40 lines · Paul Moore
Quoted 12 lines · James Morris

Attached is a draft requirements document for the integration of SELinux and NFSv4 (SENFS). Also available at:

http://namei.org/selinux/nfs/senfs-requirements-draft-05.txt

This has been through a few internal iterations from the SELinux side, and we hope to now obtain feedback from a wider audience, particularly Linux NFS developers.

The goals at this stage are to ensure we have capture all of the requirements correctly, and that we're on the right track in general.

Quoted 8 lines

Low-level implementation details are not considered in this document, and are intended to be outlined in a subsequent functional specification, once the requirements have been nailed down.

Please reply with any feedback.

The intention is to get SENFS on the IETF standards track, so any assistance in that area would also be appreciated.

Please understand the following is a bit of a nit, but I thought it might be a good idea to make this point now in an effort to make broader acceptance a bit easier ...

I realize the current motivation for this work is to enable SELinux, but considering section 3.1, "Community Acceptance", I wonder if the language in the document could be more implementation agnostic. I'm not a NFS expert, but in reading the requirements I did not see much that was specific to SELinux. Most of the requirements involved the careful binding of security labels to file objects and the honoring of those labels in both the security enforcement mechanisms of the NFS client and server. Granted there is language regarding per-domain authentication/configuration as well as SELinux DOIs but in reality I think the per-domain auth/config could be abstracted out to per-label auth/config and the concept of differing DOIs is not exclusive to SELinux. In fact I think that support of multiple DOIs is what could make this a very flexible mechanism, as we could abstract the NFS security label out to things other than SELinux contexts.

Quoted 10 lines

I believe that moving the requirement language from "SELinux NFS" to "labeled NFS" should eventually result in a cleaner design by forcing the implementation to treat the security label as an atomic attribute (a desire I often hear voiced about the SELinux context outside of the security server) as well as expanding the relevance of the standard to OS implementations that support labels but not SELinux style Domain Type Enforcement (i.e. conventional MLS systems, or other security models not yet envisioned). Granted, a general labeled NFS implementation would not be a magic bullet to solving interoperability, but it would at least provide a common mechanism for communication upon which DOI based translations could be built.

Ok, so what we could have is a generic Labled NFS specification and then develop an SELinux-specific profile.

One concern would be that after adding a generic abstraction layer, that it may still remain too SELinux-specific and not quite fit the needs of another scheme down the track.

Aside from that, I would not have a problem with the idea.

I've added Robert Watson to the cc list as he may have some useful feedback on this in relation to the requirements of Trusted BSD (as may Chris Vance).

- James

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#16 lore raw
Quoted 54 lines · James Morris
Quoted 41 lines · Paul Moore
Quoted 12 lines · James Morris

Attached is a draft requirements document for the integration of SELinux and NFSv4 (SENFS). Also available at:

http://namei.org/selinux/nfs/senfs-requirements-draft-05.txt

This has been through a few internal iterations from the SELinux side, and we hope to now obtain feedback from a wider audience, particularly Linux NFS developers.

The goals at this stage are to ensure we have capture all of the requirements correctly, and that we're on the right track in general.

Quoted 8 lines

Low-level implementation details are not considered in this document, and are intended to be outlined in a subsequent functional specification, once the requirements have been nailed down.

Please reply with any feedback.

The intention is to get SENFS on the IETF standards track, so any assistance in that area would also be appreciated.

Please understand the following is a bit of a nit, but I thought it might be a good idea to make this point now in an effort to make broader acceptance a bit easier ...

I realize the current motivation for this work is to enable SELinux, but considering section 3.1, "Community Acceptance", I wonder if the language in the document could be more implementation agnostic. I'm not a NFS expert, but in reading the requirements I did not see much that was specific to SELinux. Most of the requirements involved the careful binding of security labels to file objects and the honoring of those labels in both the security enforcement mechanisms of the NFS client and server. Granted there is language regarding per-domain authentication/configuration as well as SELinux DOIs but in reality I think the per-domain auth/config could be abstracted out to per-label auth/config and the concept of differing DOIs is not exclusive to SELinux. In fact I think that support of multiple DOIs is what could make this a very flexible mechanism, as we could abstract the NFS security label out to things other than SELinux contexts.

Quoted 11 lines

I believe that moving the requirement language from "SELinux NFS" to "labeled NFS" should eventually result in a cleaner design by forcing the implementation to treat the security label as an atomic attribute (a desire I often hear voiced about the SELinux context outside of the security server) as well as expanding the relevance of the standard to OS implementations that support labels but not SELinux style Domain Type Enforcement (i.e. conventional MLS systems, or other security models not yet envisioned). Granted, a general labeled NFS implementation would not be a magic bullet to solving interoperability, but it would at least provide a common mechanism for communication upon which DOI based translations could be built.

Quoted 8 lines

Ok, so what we could have is a generic Labled NFS specification and then develop an SELinux-specific profile.

One concern would be that after adding a generic abstraction layer, that it may still remain too SELinux-specific and not quite fit the needs of another scheme down the track.

Aside from that, I would not have a problem with the idea.

Great, I think it's a good goal to shoot for at this stage. I agree that it may be a bit foolish to try and predict the needs of some random, future security model; my point was that a generic label based approach has more of a chance than a strictly SELinux approach. I think a common NFS framework shared amongst different known labeled OS implementations/designs is a more realistic goal.

I'll be curious to see what others have to say during the review process.

Thanks.

Signature · 7 lines
paul moore
linux security @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#17 lore raw

[RFC] Security Enhanced NFS (SENFS) Requirements - draft 06

In reply to James Morris

Attached is a minor update of the SENFS requirements document, following initial feedback from the lists.

I'm leaving this document as SELinux-specific, as we need to capture the specific SELinux requirements regardless of whether a generic Labeled NFS scheme is implemented. This is the main area that we need further feedback on at this stage.

Also at:
http://namei.org/selinux/nfs/senfs-requirements-draft-06.txt

Changes:
- Removed "External Remote Filesystems", which was based on a misinterpretation of the NFSv4.1 draft.
- Added consideration of Labeled NFS as a generic security labeling layer upon which SENFS might be implemented.
- Added more detail to "3.14 Namespace Access", re. MLS polyinstantiation

Signature · 2 lines
James Morris
<[email protected]>

Draft 06
James Morris 26 June 2007

Security Enhanced NFS (SENFS) Requirements - Draft 06

1. Introduction

This document outlines high-level requirements for the integration of SELinux [1] functionality into NFSv4 [2].

SELinux, an implementation of the Flask security architecture [3], provides a flexible and comprehensive Mandatory Access Control (MAC) framework for the Linux operating system. This framework has been ported to several other operating systems, including Darwin [4] and BSD [5].

2. Problem Statement

SELinux currently supports per-object labeling of filesystem objects through the use of Linux Extended Attributes (EAs) [6]. This provides filesystem labeling portability, and a unified API and mechanism for storing and retrieving security labels associated with each filesystem object.

For filesystems which do not support EAs, other labeling mechanisms have been devised, such as genfs, which performs labeling based upon the filesystem type and optionally also by pathname; and mountpoint labeling, which allows the security labels for all objects within a filesystem to be specified as a mount option.

Labeling for NFS mounts under SELinux currently defaults to the genfs mechanism, and is often customized via mountpoint labeling. While this allows SELinux policy to provide coverage of NFS mounts, there are several limitations, including:

o Labeling granularity is generally too coarse when applied to the entire filesystem.

o Pathname labeling for NFS mounted files is not a general solution, and is only reliable if the exported namespace is static.

o Any underlying security labeling of the exported filesystem is not conveyed over the network.

o Security labels cannot be set on the remote filesystem by the client.

The broad purpose of SENFS is to address these limitations by providing distributed per-object security labeling of NFS mounted filesystems.

3. Requirements

The following initial requirements have been gathered from users, developers, and from previous development efforts in this area such as DTOS [7] and NSA's experimental NFSv3 enhancements [8].

Note that while these requirements are SELinux-specific, the final design may utilize a generic security labeling layer ("Labeled NFS"), with SENFS specified as one profile.

3.1. Community Acceptance

SENFS must be designed and implemented in a manner which is acceptable to several upstream communities, including:

o SELinux

o Linux kernel

o Linux NFS

o IETF

o Non-Linux OSes with SE implementations

SENFS must be designed to ensure compliance with IETF extensibility requirements for NFSv4 and similarly for any related standards. A specification for SENFS should be developed with the aim of becoming an IETF standard.

The design and implementation also must pass acceptance in upstream development communities, and not require the use of external patches or modules.

Potential non-Linux implementors should be consulted for feedback on the design of SENFS.

3.2. Portability

SENFS must be designed with portability in mind, to facilitate implementations on non-Linux OSes which support the SELinux model.

3.3. Interoperability

SENFS must be designed and developed to facilitate interoperability between different SENFS implementations.

SENFS modifications to standard NFSv4 implementations must not adversely impact any existing interoperability of those implementations.

3.4. Performance

Security mechanisms often impact on system performance. SENFS should be designed and implemented in a way which avoids significant performance impact where possible.

3.5. Scalability

As NFSv4 is designed for large-scale distributed networking, SENFS should also be capable of scaling in a similar manner to underlying implementations where possible.

3.6. Resilience

SENFS should be respond in a robust manner to system and network outages associated with typical enterprise and Internet environments. At the very least, SENFS should always operate in a fail-safe manner, so that service disruptions do not cause or facilitate security vulnerabilities.

3.7. Security Services

SENFS must ensure that the following security services are provided for all NFSv4 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 will be required between the server and the client for Full Mode operation (see 3.11 Modes of Operation).

Security services should be implemented according to IETF or other appropriate standards.

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

SENFS should support authentication on a per-domain granularity so that different domains running on a client can use different cryptographic keys and facilities.

3.8. Encoding

Encoding of SELinux labels and attributes passed over the network must be specified in a complete and unambiguous manner.

3.9. Domains of Interpretation

In SELinux, a Domain of Interpretation (DOI) represents an administrative security boundary, where all systems within the DOI have semantically coherent labeling. That is, a security label must always mean exactly the same thing anywhere within the DOI. An SELinux DOI may be further demarcated for any other administrative purpose.

SENFS must provide a means for servers and clients to identify their DOIs for the purposes of authorization, security service selection, and security label interpretation.

A negotiation scheme should be provided, allowing systems from different DOIs to agree on how they will interpret or translate each others labels. Multiple concurrent DOI 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 DOI.

If the DOI of a system changes, it should renegotiate any DOI agreements to reflect the new DOI.

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

NFSv4 includes features which may cause a client to cross a DOI boundary when accessing what appears to be a single filesystem. If DOI negotiation is supported by the client and the server, the server should negotiate a new, concurrent DOI agreement with the client, acting on behalf of the externally located source of the files.

SENFS should define an initial DOI negotiation scheme and DOI format with the primary aims of simplicity and completeness. This is to facilitate practical deployment of multi-DOI systems without being weighed down by complex and over-generalized global schemes. Future extensibility should also be taken into consideration.

3.10. Auditing

The capability must exist for all security-relevant events within an SENFS implementation to be logged for audit purposes. SENFS should utilize the system's security audit subsystem if available, or otherwise default to logging via the most reliable mechanism available.

3.11. Modes of Operation

SENFS must cater for two potentially concurrent operating modes, depending on the state of SELinux functionality:

3.11.1 Full Mode

Both the server and the client have SELinux enabled, and full SENFS functionality is extended over the network between both client and server.

If the client is operating in permissive mode, any delegated server policy must still be enforced; otherwise all caching and delegation must be disabled.

If the server is running in permissive mode, access control extended over the network must operate as if enforcing mode is enabled. There is no permissive mode equivalent for client SENFS access.

If the client process specifies mountpoint labeling for an NFS mount, then it must not also operate in Full Mode for that mount, and instead operate in Guest Mode (see below). SENFS configuration must override mountpoint labeling requests, and if there is a conflict, the mount operation must fail.

3.11.2 Guest Mode

Only one of the server or client has SELinux enabled.

In the case of the server only having SELinux enabled, the server locally 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.

As for Full Mode, if the server is running in permissive mode, access control extended over the network must operate as if enforcing mode is enabled.

In the case of the client only having SELinux enabled, the client must operate as a standard NFSv4 client, and should selectively provide local domains access to servers based upon the security attributes of the local domains, and network attributes of the server, according to policy. The client may also override default labeling of the remote filesystem based upon these security attributes, according to policy.

In other words, Guest Mode is standard NFSv4 over the wire, but with the SELinux-enabled peer optionally using fine-grained mandatory policy to provide enhanced local security labeling and access control.

3.12. 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.12.1 Client Labeling

At the client, labeling semantics for NFS mounted filesystems must remain consistent with those for locally mounted filesystems. In particular, user-level labeling operations local to the client must be enacted locally via the Extended Attribute system call API, 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, the correct security label for the file must be determined by server policy (or overridden by the creating process's fscreate attribute if authorized by server policy), and 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.

All object labeling semantics must be identified in a complete manner, then mapped to SENFS operational behaviors.

3.12.2 Server Labeling

SENFS servers must not return a successful response if a client attempts to set a security label on a filesystem object where the underlying filesystem does not support stable storage of security labels.

Furthermore; any operation invoked by the client which involves any change to a security label on the server must not return successfully until that label is committed to stable storage.

The server must provide the capability for clients to retrieve security labels on all exported filesystem 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 filesystems.

The server must honor the fscreate attribute of a process on the client if permitted by server policy. The fscreate attribute is used by privileged security-aware applications, where created objects are labeled atomically with a specific security label instead of using local labeling policy.

Labeling on by the server must also take into account any other volatile client security state, such as a change in process security context via dynamic transition.

3.13. Policy Enforcement

3.13.1. Full Mode

The server must enforce its local security policy over all exported objects, for operations which 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 server 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 domain accessing the object, rather than the domain which opened it, if different.

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.

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

A mechanism must exist to allow the client to obtain access and labeling decisions from the server for locally cached and delegated objects, so that it may apply the server's policy to these objects. 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.

SENFS implementations should provide a mechanism to convey audit messages from the server to the client, so that a remote access denial or other significant event may be fully understood at the client.

3.13.2. Guest Mode

The server must not accept security labels or credentials provided by the client, and only enforce its local policy to exported objects.

3.14. Namespace Access

The server should provide a means to authorize selective access to the exported filesystem 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.16. Referrals

SENFS will not initially provide explicit support for NFSv4.1 referrals, although may do so in a future version.

3.18. Server Mediation

Care must be taken to ensure that SELinux mediation of the NFS server is always correct in relation to whether it is acting on behalf of the client or itself, and that there are no mediation gaps arising from security bypasses intended for previously non-SENFS aware kernel components of the NFS subsystem, where applicable.

3.19. Preservation of Existing Behavior

SENFS modifications made to existing NFS implementations must ensure that existing behavior is preserved if SELinux is disabled at either compile or run time.

4. Next Steps

The intention is to subject these requirements to several iterations of review from an increasingly wider audience. Once there is consensus on the requirements, a functional specification will be designed and also subjected to review, ideally in parallel with prototyping.

5. Author Contact

James Morris <[email protected]>

6. Acknowledgments

The following people provided valuable feedback during the development of this document:

Stephen Smalley, NSA
James Carter, NSA
Karl MacMillan, Red Hat Inc.
J. Bruce Fields.
Paul Moore, HP.

7. References

[1] Security Enhanced Linux (SELinux)

      http://www.nsa.gov/selinux/

[2] RFC3530, Network File System (NFS) version 4 Protocol

      http://www.ietf.org/rfc/rfc3530.txt

[3] The Flask Security Architecture: System Support for Diverse Security Policies

http://www.cs.utah.edu/flux/papers/flask-usenixsec99-abs.html

[4] SEDarwin: Security Enhanced Darwin

http://www.sedarwin.org/

[5] SEBSD: Port of SELinux FLASK and Type Enforcement to TrustedBSD

http://www.trustedbsd.org/sebsd.html

[6] Linux Extended Attributes and ACLs

      http://acl.bestbits.at/

[7] The Distributed Trusted Operating System (DTOS) Home Page

http://www.cs.utah.edu/flux/fluke/html/dtos/HTML/dtos.html

[8] Implementing SELinux Support for NFS

http://www.nsa.gov/selinux/papers/nfsv3-abs.cfm