Sei sulla pagina 1di 15

The following paper was originally published in the

Proceedings of the Fifth USENIX UNIX Security Symposium


Salt Lake City, Utah, June 1995.

A Domain and Type Enforcement UNIX Prototype

Lee Badger, Daniel F. Sterne, David L. Sherman,


Kenneth M. Walker, and Sheila A. Haghighat
Trusted Information Systems, Inc.

For more information about USENIX Association contact:


1. Phone: 510 528-8649
2. FAX: 510 548-5738
3. Email: office@usenix.org
4. WWW URL: http://www.usenix.org
A Domain and Type Enforcement
UNIX Prototype
Lee Badger
Daniel F. Sterne
David L. Sherman
Kenneth M. Walker
Sheila A. Haghighat
Trusted Information Systems, Inc.
3060 Washington Road
Glenwood, Maryland 21738

Abstract of security responsibility on privileged application


UNIX system security today often relies on cor- programs and expert system administration. This
rect operation of numerous privileged subsystems has two important consequences. The rst is that
and careful attention by expert system administra- UNIX systems often exhibit a \weakest link" phe-
tors. In the context of global and possibly hostile nomemon in which compromise of any privileged
networks, these traditional UNIX weaknesses raise subsystem (e.g., ngerd, lpd, rdist) makes an en-
a legitimate question about whether UNIX systems tire host vulnerable. The second is that reliance on
are appropriate platforms for processing and safe- numerous privileged applications increases the di -
guarding important information resources. Domain culty of implementing coordinated security policies
and Type Enforcement (DTE) is an access control that provide uniform protection to data and pro-
technology for partitioning host operating systems cessing resources. These two problems motivate a
such as UNIX into access control domains. Such legitimate concern over whether UNIX systems are
partitioning has promise both to enforce organiza- appropriate platforms for processing and safeguard-
tional security policies that protect special classes ing important information resources in global and
of information and to generically strengthen operat- possibly hostile networks.
ing systems against penetration attacks. This paper UNIX (and other operating systems) can in the-
reviews the primary DTE concepts, discusses their ory be hardened against threats inherent in such
application to IP networks and NFS, and then de- environments by adding an access control layer that
scribes the design and implementation of a DTE restricts privileged processes so that damage result-
UNIX prototype system. ing from compromise or error is limited. This ben-
et, however, has not been realized by mainstream
1 Introduction UNIX systems even though a number of access con-
As UNIX systems become a major part of the trol mechanisms
4, 2, 6, 9, 8, 18] have been avail-
National Information Infrastructure, UNIX security able for years. One reason may be that security en-
mechanisms are coming under increasing pressure hancements often impose signicant costs resulting
to resist attacks by highly motivated individuals, from more complex system administration, appli-
companies, and governments. Currently, UNIX se- cation incompatibility (or unavailability), and ad-
curity rests on protection bits, the root user, and the ditional user training. This raises a central ques-
setuid/setgid mechanism, which place a great deal tion for practical UNIX security: can signicant en-
UNIX is a registered trademark in the United States and hancements be added in a way that is understand-
other countries, licensed exclusively through X/Open Com- able, eective, and unobtrusive?
pany Ltd. This paper presents our experiences with a new
form of access control, Domain and Type Enforce- disk, but are instead maintained implicitly in
ment (DTE)
1] and a prototype DTE UNIX sys- a form that capitalizes on the directory hier-
tem. In recognition of the fact that access control archy to compactly represent portions of a le
techniques have not been easily accepted by operat- hierarchy that have identical attributes. Using
ing system vendors (or users), DTE has been formu- implicit typing, DTE can therefore be applied
lated specically to address requirements of greatest to existing les with no change to le system
concern for both vendors and users, namely: exi- formats.
bility, simplicity, operating system interoperability,
binary application compatibility, and performance. DTE is a congurable, kernel-level access control
This paper reviews DTE, 1 discusses how DTE can mechanism. At each system boot, a DTE UNIX
be applied to IP networks and NFS and then dis- system processes a DTEL specication and estab-
cusses design and implementation issues of the DTE lishes access controls during UNIX kernel initializa-
UNIX kernel. Finally this paper reviews related tion. All processes, including root processes, are
work and discusses our plans for further develop- subject to DTE controls. DTEL currently provides
ment of DTE over the next few years. four2 primary statements for expressing a DTE con-
guration:
2 DTE type Declares one or more object types to be avail-
DTE is an enhanced form of type enforcement, a able to other parts of a DTEL specication.
table-oriented access control mechanism originally
proposed by Boebert and Kain
9] and later rened domain Expressed as a list of tuples, denes
in the LOCK system
21]. As with many access con- a restricted execution environment composed
trol schemes, type enforcement views a system as a of three parts: 1) \entry point" programs,
collection of active entities (subjects) and a collec- identied by pathname, that a process must
tion of passive entities (objects). In type enforce- execute in order to enter the domain (e.g.,
ment for UNIX, an access control attribute called a (/bin/login)), 2) access rights to types of
domain is associated with each subject (process), objects (e.g., (rwx->foo t)), and 3) access
and another attribute called a type is associated rights to subjects in other domains (e.g.,
with each object (le, message, shared memory seg- (sigkill->user d)). A DTEL domain con-
ment, etc.). A global table, the Domain Denition trols a process's access to les, a process's ac-
Table (DDT), represents allowed access modes be- cess via signals to processes running in other
tween domains and types (e.g., read, write, exe- domains, and a process's ability to create pro-
cute), and another table, the Domain Interaction cesses in other domains by executing their en-
Table (DIT), represents allowed access modes be- try point programs. For backward binary com-
tween domains (e.g., signal, create, destroy). As patibility, the domain statement also provides
a system runs, access attempts are mediated using an access designator to force domain transi-
table lookups: access attempts for modes not au- tions on older programs that are not aware of
thorized in the tables are denied. DTE: if a domain A has auto access rights to
Although type enforcement is very exible, the another domain B , a subject in A automati-
access control tables can quickly become too com- cally creates a subject in B when it executes,
plex, and type enforcement is di cult to use in prac- via exec(), an entry point program of B .
tice. Additionally, the presence of type attributes
on les appears to require a new and incompatible initial domain Selects the domain of the rst pro-
le system format. To address these issues, DTE cess.
enhances type enforcement in two ways:
assign Associates a type with one or more les. An
1. DTE policies are specied in DTE Language assign statement may be recursive, in which
(DTEL), a high-level language suitable for ex- case it applies to a directory and everything
pressing reusable access control congurations below, and one assign statement may override
that are compatible with current applications another for instance, an assign statement for
and system congurations. /tmp/foo may override a recursive assign state-
ment for /tmp.
2. During system execution, DTE le security at-
tributes are not stored one-to-one with les on 2 For brevity we omit peripheral DTEL statements and
features and also restrict our attention here to implemented
1 DTE is described in more detail in 1]. features with which we have actual experience.
/*
* DTEL Example Policy.
*/

type unix t, /* normal UNIX files, programs, etc. */


specs t, /* engineering specifications */
budget t, /* budget projections */
rates t /* labor rates */

#define DEFAULT (/bin/sh), (/bin/csh), (rxd->unix t) /* macro */

domain engineer d = DEFAULT, (rwd->specs t)


domain project d = DEFAULT, (rwd->budget t), (rd->rates t)
domain accounting d = DEFAULT, (rd->budget t), (rwd->rates t)
domain system d = (/etc/init), (rwxd->unix t), (auto->login d)
domain login d = (/bin/login), (rwxd->unix t), (exec-> engineer d,
project d,
accounting d)

initial domain system d /* system starts in this domain */

assign -r unix t / /* default for all files */


assign -r specs t /projects/specs
assign -r budget t /projects/budget
assign -r rates t /projects/rates

Figure 1: Example DTEL Policy

An important goal for DTE is to superimpose in the login d domain even though the existing
useful security policies on existing UNIX congura- getty program does not request the domain tran-
tions while using implicit typing to maintain back- sition. The login d domain has the authority to
ward compatibility with existing data formats and create the user domains (engineer d, project d,
applications. Figure 1 shows a DTEL specication and accounting d), based on user authentications.
of a commercial policy designed to provide data pro- Each user login session is conned by one of the
tection and user authorizations in an engineering user domains controlling access to protected data,
organization. To validate that our example speci- which resides in three directories under /projects.
cation is not trivial, we have run it on our prototype Though simple, this sample specication can be in-
DTE system and found it to provide useful protec- crementally rened to add additional user domains,
tion. This specication provides three types of pro- distinguish between console and network user ses-
tected user data, one type of system data, three sions, simultaneously support additional organiza-
user domains, and two supporting system domains. tional policies, and harden UNIX itself by running
The user domains correspond to job descriptions, its root daemons in tightly constrained domains.
such as engineer or accountant, and the system do-
mains provide operating system support. Addition- 3 DTE Networking
ally, this specication assigns type attributes to all Since UNIX systems are usually networked, DTE
les. systems must work naturally while communicating
A DTE system running the specication of g- both with other DTE systems and with non-DTE
ure 1 starts the rst process in the system d do- systems. In particular, multiple DTE systems must
main, which is then inherited for all other sys- provide mechanisms allowing coordinated protec-
tem processes except the login program. The spec- tion of information among themselves, and DTE
ication uses the auto mechanism to run login systems must protect themselves from non-DTE
systems. To accomplish this, DTE adds two at- force dynamic creation of new TCP connections to
tributes to network communications carrying user send the data. While multiple connections could be
data: 1) the type of the data written by the sending used to transmit multiple types of data, this would
process and 2) the domain of the process that sent change application-layer protocols (like rcmd) and
the data, the \source domain." A receiving process prevent DTE network applications from interoper-
can always view the data's type, which the receiver ating with their non-DTE peers.
must know to adequately protect the data, or pos- In addition to maintaining compatibility with
sibly to protect itself from the data. Additionally, UNIX network abstractions and application-level
a receiver can always view the sender's domain a protocols, it is also necessary to dene how DTE
DTE server that receives a request can therefore use systems interoperate with non-DTE systems. In or-
the client's domain to decide whether to perform the der for a DTE system to properly control network
requested function. applications, all communications must carry type
To maintain compatibility with existing network and source domain attributes. At the same time,
protocols and applications, DTE attributes are car- however, DTE applications must interoperate with
ried as IP options, 3 with no change to packet con- applications running on non-DTE systems that do
tents. DTE mediates communications over stan- not provide DTE attributes. To provide interop-
dard datagram and stream-oriented services. In erability without weakening DTE, DTE hosts as-
each case, DTE imposes access control mediation sociate a domain with every foreign non-DTE host
both at send time and receive time: to successfully and mediate all network tra c with that host so
send data of type t, a process's domain must permit that the eect of the mediation is as though the
write access to t, and to successfully receive data of host were actually running DTE and the process
type t, a process's domain must permit read access sending (or receiving) from that host were running
to t. For datagram protocols such as UDP, a single in the associated domain. Using DTEL, a DTE
type labels the contents of an entire packet. For system can associate a single domain with the \uni-
stream protocols such as TCP, dierent portions of verse" of foreign non-DTE hosts, associate a dier-
a stream may have dierent types of data a se- ent domain to each class A, B, or C network, and
quence of contiguous bytes having the same type is nally associate specic domains to individual non-
a substream. DTE hosts that, for various reasons (such as qual-
These design choices give a high priority to com- ity of administration), are more or less trustwor-
patibility and interoperability. Our datagram ap- thy than their LAN. This technique has performed
proach is not unusual, and homogeneously typed well in our corporate LAN, allowing us to appropri-
datagrams work well for existing applications since ately \trust" specied non-DTE hosts. Although
they are unaware of DTE and therefore only gener- we are using source-address \authentication" for
ate one type of data. Our stream approach, how- compatibility at present, our plans include moving
ever, is less typical. A simpler approach would bind to stronger authentication, such as is envisioned for
a security attribute to a stream socket and there- IP6, as the overall network infrastructure evolves.
fore to all data communicated on it. Typical UNIX Although our experience with DTE networking is
service interactions, however, make this approach still somewhat limited, we have been able to run ex-
problematic. An important example is inetd, which isting UNIX applications such as rsh, rlogin, telnet,
receives socket connections for services it spawns: ping, sup, and mount in suitable DTE domains and
inetd must be able to connect to a socket and then we have encountered no \show stoppers." We have
hand the descriptor to a child process that may run discovered, however, that although TCP/IP hosts
in a dierent domain. The use of substreams re- should drop IP options they don't recognize, that
moves the need for inetd to run in an all-powerful doesn't always happen and SunOS 4.1.1 on Sun 3
domain. Programs like telnet and rlogin provide systems, in particular, crashes when presented with
other examples: if a user runs a program that pro- an unrecognized option. As a result, we have added
duces output of multiple types, a single connection features to our systems that prevent the sending
can carry the output back to the client in multiple of DTE attributes to hosts that are not known to
substreams, but statically typed connections would be currently running DTE. We are now formulat-
3 For experimental purposes, we currently assume that ing the requirements of a DTE protocol that would
network packets are not stolen or modied. We plan to maintain timely information on the DTE status of
take advantage of known and emerging cryptographic tech- a machine as well as provide DTE policy negotia-
niques and protocols for communications authentication15], tion functions that ensure that dierent machines
integrity, and condentiality 10, 11] as appropriate. \mean" the same thing by DTE attributes they ex-
Proprietary Data
Guest User

Existing
DTE System File Server

Non-sensitive Data

Local Disk

Figure 2: DTE NFS Clients

change. Although we only have experience to date applies the type \proprietary data" to some les on
with UDP and TCP, our techniques appear to apply the imported le system and the type \non sensi-
to raw IP, and potentially also to multicast proto- tive data" to the others. All guest user processes
cols such as ISIS
5] and PSYNC
22]. running on the DTE system are restricted accord-
ing to the local DTE policy to access only the non-
4 DTE NFS sensitive data.
The ubiquitous use of NFS highlights the need DTE network features allow a DTE system to
for DTE to both support NFS on DTE systems and refuse communication with selected non-DTE hosts
also to interoperate with non-DTE systems that use and to prevent important types of data from be-
NFS. An integration of DTE and NFS for DTE- ing exported to non-DTE hosts (regardless of which
aware clients and servers is relatively simple and communication service is used). If communication
involves sending and receiving DTE attributes be- with a non-DTE NFS server is allowed, the client-
tween DTE systems that then use the attributes for side DTE/NFS subsystem associates types with im-
mediation in the same way they use locally stored ported les based on their pathnames. A premise of
DTE attributes. To make DTE useful in the short our work is that access controls must be exible: it
term, however, interoperability with non-DTE NFS is up to the system administrator of a DTE system
clients and non-DTE NFS servers may be even more to determine whether a non-DTE host should be
important. trusted to properly maintain data of various types.
A signicant benet of implicit typing
1] in this Although all the data received at the IP layer will be
regard is that DTE client workstations locally as- typed according to the DTE domain associated with
sociate types with all les, even les provided over the non-DTE le server, the DTE/NFS subsystem
NFS by le servers that are not DTE-aware. This on the client system resides in the DTE UNIX ker-
ability has allowed us to use DTE workstations to nel and is trusted to override the default communi-
make selected portions of our corporate le server cations type with correct le types as specied in
available to selected groups of users with a mini- the system's DTEL specication.
mum of administrative eort. As electronic com- Initially, we added DTE only to the NFS client
merce increases the need for cooperation between side, as described above. We are currently testing
organizations, we expect this scenario to become a DTE/NFS server that can serve clients on both
more common. Figure 2 displays the concept. A DTE and non-DTE systems. When the client is
guest user has an account only on a DTE system. on a DTE system, all NFS requests are labeled by
This system mounts from an existing le server and the client system with the source domain of the re-
questing process. The DTE/NFS server then uses be highly desirable to prevent them from being ex-
the source domain as a client credential to con- ported. Standard NFS provides features for limiting
sult the system's DTEL specication and deter- the exporting of les, but these features are coarse-
mine whether the request is authorized. In addi- grained, dealing only with whole le systems and
tion, each IP packet that carries the contents of are available only to a system administrator. By
a le accessed via DTE/NFS is labeled with the making certain types of les inaccessible to the NFS
type associated with that le. A potential benet daemon, DTE provides a strong additional mecha-
of this approach is that both source domain and nism that can be employed by administers to pre-
type attributes are readily visible to routers and vent individual les on arbitrary le systems from
network rewalls and could allow future versions of being exported.
such devices to consult them when making ltering Our experience with DTE/NFS servers is still
and routing decisions. An additional benet is that very limited however, our initial results are en-
the NFS protocol need not be modied. Although couraging: NFS clients on DTE or non-DTE sys-
NFS client requests sent by non-DTE systems lack tems can be granted ne-grained restricted access
source domain attributes, the DTE/NFS server's IP to NFS-exported le hierarchies without change
subsystem attaches them (in accordance with the to applications or to non-DTE system congura-
DTE system's DTEL specication) before passing tions. The DTE prototype system's security at-
the requests to the DTE/NFS subsystem for media- tribute management strategy requires implementa-
tion. From the non-DTE client's point of view, the tion of a new system cache and secondary storage to
DTE/NFS server behaves like a non-DTE server, store the cache across system reboots. The cache,
except that access may be denied for some requests however, requires little human administration and
where, in the absence of DTE, the request would requires only a small amount of additional I/O that
have been granted. only occurs in the context of I/O already required
The NFS protocol is designed so that NFS server by NFS.
systems may crash, reboot, and resume NFS service
without requiring clients to perform new lookup op- 5 DTE UNIX Prototype
erations on les that were open at the time of the To gain experience with DTE concepts, we have
crash. Each NFS request contains an NFS le han- implemented a prototype DTE UNIX system based
dle that identies the le by le number, which al- on OSF/1 MK4.0. Although our system is based
lows a typical UNIX system to access the le di- on a Mach microkernel, the DTE features are lo-
rectly without performing a name translation. Un- cated in relatively high layers of the UNIX server's
like the permission bits and owner identiers asso- architecture, require no knowledge of microkernel
ciated with a le, however, the implicit DTE at- interfaces, and are therefore reasonably portable to
tributes are not stored within inodes but in a sepa- kernelized UNIX systems. We have also recently
rate attribute database organized by pathname in- ported the DTE prototype to run on TMach Version
stead of le number. If a newly rebooted DTE/NFS 0.2
7], a high-assurance trusted computing base
le server could not locate security attribute infor- designed to satisfy DoD security requirements as
mation for an NFS request, it would have to refuse specied in the Trusted Computer System Evalua-
the request, resulting in a stale le handle at the tion Criteria
20]. Even though TMach employs a
client application. To prevent this, the DTE/NFS TMach-specic le system format, the integration
prototype reconstructs pathnames based on inode required almost no change to the DTE implemen-
numbers by maintaining a cache of parent inode tation because the integration points between the
numbers for non-directory les accessed via NFS, UNIX server and TMach are generally at low layers
thereby permitting it to nd le attributes in the in the UNIX architecture, whereas DTE is mostly
DTE attribute database. implemented in the upper layers of the UNIX \ker-
On our DTE/NFS prototype, the NFS daemon, nel."
like all other processes, runs in its own domain Figure 3 shows the prototype's architecture. To
and is constrained in accordance with the system's enhance portability, the majority of the DTE im-
DTEL specication. On most systems, this domain plementation is located in an isolated subsystem
will likely be congured to give the daemon the abil- consisting of 7 300 lines of commented C code and
ity to access and export many types of informa- 3 600 lines of commented lex and yacc code. Other
tion. Nevertheless, it is not necessary to make all UNIX kernel subsystems call into the DTE sub-
types accessible to it. If highly sensitive or critical system to request security services. This part of
types of information are stored on a system, it may the integration consists of another 7 200 lines of
UNIX process DTE UNIX process

UNIX process

UNIX process

UNIX system call interface DTE interface

DTE subsystem
OSF/1 Server

Interface

Mach Kernel or TMach Kernel+Servers

Hardware

Figure 3: DTE System Architecture

code, bringing the total DTE integration to approx- labels les, network packets, and processes deter-
imately 17 000 lines of kernel-resident code. The mines domain interactions and mediates process
DTE prototype's kernel provides 20 new system access requests. We have tested a number of policies
calls for DTE-aware applications to use for retriev- using the prototype, including a policy to partition
ing security attributes for display to the user and the components of a simulated command and con-
for implementing security relevant functions. trol system, a policy to strengthen UNIX by con-
In addition to kernel changes, we have imple- ning UNIX root processes in 27 separate domains,
mented a DTE version of the login program that and an enterprise data protection policy (similar to
authenticates users for specic roles
17, 3, 26] and that of gure 1). Additionally, we use DTE client
then connes user sessions to specic domains using workstations to permit but safely limit access by
domain transitions authorized by the DTEL spec- \guest" users who are authorized to see some but
ication. To allow users to view DTE attributes not all TIS sensitive data.
for processes and les, we have implemented DTE-
aware versions of a number of UNIX utilities such as
ls and ps, and we have implemented a DTE-aware The DTE prototype's design and implementation
version of emacs 19:22 that displays type attributes have given a high priority to maintaining operat-
of le buers and allows users to simultaneously ing system interoperability and binary application
view and manipulate labeled information in multi- compatibility. Three aspects of the DTE prototype
ple windows. are central to achieving these goals: 1) preserving
As the prototype boots, it reads its DTEL spec- existing data formats by employing implicit secu-
ication and connes all processes, regardless of rity attributes, 2) ensuring that implicit attributes
UNIX root privileges, to specied domains. DTE are recoverable in the presence of system shutdowns
is active before single-user mode has been reached. and power failures, and 3) adding DTE networking
According to its DTEL specication, the prototype support without change to existing protocols.
5.1 Implicit Attributes only.
For entities that must be recreated at each sys- Informally, the prototype resolves map node con-
tem boot (such as process structures or IP data- icts by giving priority to the map node that rep-
grams), the DTE prototype attaches security at- resents a longer path, interpreting implicit under
tributes explicitly to each object. Compatibility attributes to be \longer" than implicit at attributes
and performance can be maintained with this strat- for the same path and always giving priority to ex-
egy because modications need not aect secondary plicit attributes.
memory data formats or require additional I/O.
Files, however, present a more di cult case both
because security attributes must be maintained on root_t
disk to survive system reboots and because les "/"
e
a
are usually numerous. To address these issues, the u unix_t

prototype associates security attributes with les


\implicitly" based on their locations within direc- e e critical_t
tory hierarchies. For portability, most of the proto- "usr" a "dt_policy" a

type's functions for le security attributes are im-


u u

plemented at the Virtual File System (VFS) layer


and build associations between vnodes
19] and se- e
curity attributes. Since all currently accessed les "bin" a

are represented by vnodes, all les in use have


u

associated security attributes. When the proto-


type boots, it creates in kernel memory a tree of e foo_d
map nodes that describe how security attributes are "login" a
u
bound to the hierarchical le name space. Although
our current prototype simply keeps this tree entirely Figure 4: Map Nodes
in memory, it can in principle be paged to disk as
necessary.
A sequence of map nodes proceeding from the Each path provided to a domain or assign state-
root map node to a leaf map node names an exist- ment potentially generates a map node for ev-
ing path in the hierarchical lesystem name space. ery component of the path. For example, a path
Each map node optionally associates one or more \/a/b/c" given in a DTEL statement generates
security attributes with the path component as- three map nodes (the root map node is automat-
sociated with it. The prototype currently main- ically present). Map nodes are shared, however, so
tains two kinds of security attributes bound to les: if a second DTEL statement species \/a/b/c/d,"
type names and domain entry points. To represent only one new map node is generated. DTEL pro-
attributes implicitly, a map node may also asso- vides ags to set the initial options of map nodes:
ciate security attributes with les whose pathnames the DTEL assign statement, which associates types
merely include the map node as a prex. Such map with les, takes a \-r" option to designate implicit
nodes represent \implicit" associations. For each at and a \-u" option to designate implicit under.
security attribute, a map node provides the follow- DTEL domain statements automatically generate
ing options: explicit associations for their entry point attributes.
For example, the following DTEL statements gen-
implicit at The attribute is bound to this path erate the map nodes displayed in gure 4.
component. In the absence of higher-priority
map nodes that conict with this map node, assign root t /
the attribute is also bound to all pathnames assign -u unix t /
having this path component as a prex. assign critical t /dt policy
domain foo d = (/usr/bin/login), ...
implicit under The attribute is not bound to
this path component, but, in the absence of
conicting higher priority map nodes, the at- That gure shows ve map nodes, one for each
tribute is bound to all pathnames having this unique component in the paths \/usr/bin/login"
path component as a prex. and \/dt policy." Each map node records the name
of its path component and optionally records at-
explicit The attribute is bound to this pathname tribute associations (in gure 4, \e" for explicit, \a"
e root_t
"/" "/" a
u unix_t

e e critical_t
"usr" "usr" a "dt_policy" a
u u

e
"george" "bin" "bin" a
u

e foo_d
"papers" "login" "login" a
u

Legend
"usenix" map node
vnode

Figure 5: Attribute Associations

for implicit at, and \u" for implicit under). Fig- vnodes, resulting in a somewhat increased kernel
ure 4 shows that the root map node is explicitly memory requirement for active vnodes. Figure 5
of type \root t" and that all les under the root shows the vnode associations that result from pro-
\inherit" the type \unix t." This inherited type cess access to the les \/usr/george/papers/usenix"
is overridden, however, for the le \/dt policy," and \/usr/bin/login." Because the login program's
which has an explicit type attribute of \critical t." pathname is fully represented by map nodes, vn-
The domain \foo d" has an entry point program, odes for the path attach directly. For the path to
\/usr/bin/login," and that le therefore has an ex- George's usenix paper, the rst two vnodes of the
plicit domain attribute and it also inherits the type path connect directly to map nodes, and the rest
\unix t." point to the last map node in the path. Both les
Attributes represented by map nodes are related have the type \unix t," which is provided by the
to les by association with standard vnode struc- root map node.
tures that have been slightly extended to inter- By binding attribute values to vnode structures,
act with the map node tree. At system initial- the DTE prototype ensures that attributes are al-
ization, the root vnode is associated with the root ways available before they are needed even though
map node. Subsequently, all name resolution op- the attributes may not be stored one-to-one on sec-
erations establish bindings so that every vnode is ondary storage. The DTE prototype retrieves at-
related to a map node. In the case that a map tribute values of les using a simple algorithm that
node exists for a le represented by a vnode, a follows vnode parent pointers up until the rst map
name resolution operation attaches the vnode di- node is reached and then optionally follows map
rectly to the map node. If a map node does not nodes until the \governing" map node is reached.
exist, the name resolution mechanism attaches the E ciency is a primary concern for the DTE pro-
vnode to its parent vnode since every resolution totype. The overhead of associating new vnodes
operation operates from a known absolute or rel- with appropriate map nodes during name resolu-
ative path, every new attachment is relative to a tion is negligible, requiring a small and constant
known vnode, and all vnodes are eventually con- number of pointer manipulations. The attribute re-
nected to the map node tree through a chain of trieval operation is a more likely cause of perfor-
parent vnode pointers. To maintain parent vn- mance degradation, but we believe it is also small.
ode pointers, the DTE prototype references parent In the DTE prototype, the UNIX kernel function
iaccess() (and a handful of similar functions) call little as possible.
DTE functions that retrieve le security attributes. Two basic classes of operations aect the map
Most UNIX access control functions funnel down node tree: create operations and rename operations.
to the iaccess() function, which is called with great In each case, the DTE prototype incurs no addi-
frequency since every system call requesting an op- tional overhead if the operation does not produce an
eration on a pathname must call iaccess at least edit of the map node tree. If the operation creates
once for every component of the path. In the worst a new object (e.g., a new empty le at an unused
case, each attribute retrieval could require a search pathname, or a rename to an unused pathname), re-
to the root map node. Given the modest depth of covery is simple since the attributes can be written
typical UNIX pathnames and the in-memory status rst. Maintenance of DTE recovery information in
of the map node tree, however, this appears small this case requires one synchronous write operation
relative to other overheads of UNIX kernels. At the in addition to the two synchronous write operations
cost of additional complexity, however, various op- performed by UNIX to create or rename a le. If
timizations could be taken to short-circuit attribute an operation overwrites an existing object, however,
retrieval searches as required. the use of implicit attributes complicates the recov-
5.2 Recovery Mechanisms ery strategy: because every le is always associated
with attributes inherited from the root directory,
Although useful security congurations can be neither order of operations:
constructed that \lock down" the mappings be-
tween areas of the hierarchical lesystem name 1. replace a le rst and then record the new at-
space and security attributes, resulting in a static tribute, or
tree of map nodes, a more common case in our ex-
perience is to allow the map node tree to evolve 2. record the new attribute rst and then replace
as les are moved and created to reect the needs the le,
of applications that use les. For example, an ap-
plication might create a le of type \foo t" in an prevents mislabeling if the system crashes between
area of the name space that inherits \bar t" such the two operations. To address this, the DTE pro-
an event would add a DTEL assign statement, with totype records this information as a sequence of
its map nodes, to the system conguration. Sim- optimized transactions that makes sparing use of
ilarly, a rename() operation may require that the synchronous I/O and, most importantly, that never
map node tree be edited so that the rename op- converts a memory-speed operation to disk speed.
eration doesn't inadvertently change the type of a Both the create and rename VFS-layer opera-
le as a side eect. In general, the DTE proto- tions can overwrite an existing le as a side eect.
type emulates the semantics of one-to-one attribute In the case of create, the UNIX VFS layer knows if
storage even though the attributes are not in fact there is an existing le to overwrite and truncates
maintained in that manner. it for reuse with a new identity. To prevent a crash
Given the criticality of accurate security at- from relabeling existing le contents, the DTE pro-
tribute associations, dynamism in the map node totype adds an fsync operation, ensuring that the
tree introduces the need to maintain up-to-date as- le is empty, and then writes the new attribute to
sociations even in the presence of system reboots the log le, resulting in a worst-case scenario of two
or crashes. Writing map nodes to secondary stor- additional synchronous I/O operations for le cre-
age poses an obvious risk to performance the DTE ation.
prototype addresses this using a combination of al- A rename operation rename(\foo", \bar") is es-
ternate snapshot les and logging. Every thirty sec- sentially:
onds, the map nodes are written to disk.4 Addi-
tionally, more timely information is kept in two al- unlink(\bar")
ternate log les: at system reboot, the most recent link(\foo", \bar")
snapshot and log le is read to reconstruct the most unlink(\foo")
recent valid state. The batched writes of the pol-
icy impose little overhead since no program waits If bar exists, an update to a log le must be made
for the writes to complete. In contrast, the log les conditional on successful completion of the rename
require synchronous I/O and must be updated as operation or the log le update may relabel the orig-
inal bar. The log le update cannot be written after
4 For large policies, the mechanism could be enhanced to the rename operation because a system crash could
periodically write out only the changed portion. prevent writing of the update. For this operation,
the DTE system writes an uncommitted transac- from the DTE policy database generated using
tion to the log le containing the le number of the DTEL. Traditionally, UNIX systems employ a data
le to be moved and, on the next write to the log structure, called an mbuf, that allows buers of data
le, piggy-backs the commit of the previous trans- to be chained together in a manner that facilitates
action. During system recovery, the last transaction the prepending and stripping of protocol headers in
can be veried through an examination of on-disk dierent layers of a UNIX kernel's protocol stacks.
le numbers. This strategy holds the recovery I/O The DTE prototype uses a slightly extended form
burden to at most one synchronous I/O for every of the typical mbuf structure that provides header
rename operation. space for storing source domain and type identiers.
In general, the prototype design requires no ad- Standard UNIX system calls that send messages
ditional disk access on a per-system call basis. save these attributes in extended mbuf chains at
This approach promotes high performance since the bottom of the protocol stack, these attributes
most DTE-related overhead is in memory opera- are extracted from the chains and encoded as IP
tions where data structures can be optimized. For options on a per-datagram basis. For received mes-
recovery, however, it is necessary to add disk writes sages, the mechanism works in reverse, extracting
during le creates that cause changes in the at- received IP options and encoding them in mbuf
tribute association database. Depending on a sys- chains for retrieval by receiving processes.
tem's conguration, it could be that none, some, or In addition to support for ordinary UNIX sys-
all le creates would cause attribute associations to tem calls, the DTE prototype provides a number of
change. analogous DTE-specic system calls that allow pro-
5.3 Network Implementation cesses to specify the type of data that they wish to
In addition to associating attributes with les send DTE access control prevents processes from
and processes and performing access control over generating data types unless they have appropriate
those entities, the DTE prototype also inserts DTE authorizations as specied in the DTEL specica-
attributes into IP datagrams and provides media- tion.
tion of network messages. A fundamental goal of In general, the DTE prototype treats every IP
DTE network mediation is to preserve interoper- datagram as homogeneously typed this simplies
ability with non-DTE systems: this requires using access control over datagrams since a process us-
existing IP, UDP, TCP, and NFS services and, as ing the raw IP interface, for example, can be al-
much as possible, preserving application layer pro- lowed or denied access to a datagram based on
tocols such as rsh and rlogin. Although we expect its domain's access to the datagram's type. This
that it will be useful to add DTE awareness to some strategy, although simple, does allow several am-
network applications such as rcp and rdist, we be- biguous situations: for example, if a protocol such
lieve that DTE systems must rst be useful in net- as TCP piggy-backs control information in pack-
works of non-DTE systems. ets that also carry user data, should those packets
Our general scheme is to add DTE attributes in have a protocol-specic type or a user type? Cur-
the IP option space these attributes are tokenized rently, our approach is to label packets with user
and currently consume 12 bytes of the 40-byte IP types when they contain any user data and with
option space. DTE networking support at other protocol-specic types when they contain only pro-
layers is carried in these attributes at the IP layer. tocol data. In the future, a natural extension to the
Due to the use of pipes and sockets in UNIX, a strategy may include a secondary \subsystem" label
UNIX process may cause numerous IP datagrams for use by protocol subsystems that are trusted to
to be generated and may not be aware of the net- accurately carry user data. To minimize security
work consequences of its actions. For the DTE pro- mechanism, however, we are deferring secondary
totype, each message is generated in the context of packet labels until a denite need has been demon-
a process's domain and carries the domain's iden- strated. In either case, the use of homogeneously
tity as the message's \source domain." Addition- typed datagrams simplies the implementation of
ally, each message carries a type attribute typically, TCP substreams since TCP substreams are always
each DTE domain has a default output type that la- made up of complete IP packets.
bels messages generated from normal UNIX system UNIX system calls that write data onto a TCP
calls such as write() and send(). connection enqueue onto a single chain of mbufs as-
For each standard UNIX system call that can sociated with a TCP socket the TCP sliding win-
generate a message, the DTE kernel retrieves the dow processing breaks the data stream into sepa-
calling process's domain and default output type rate IP datagrams based on a variety of critera to
optimize performance and guarantee that receipt of enforcing systems
9, 21, 25, 24, 27]. In general,
all the data is acknowledged before it is forgotten DTE policies are a proper superset of the DoD lat-
on the sending side. On the sending side, the DTE tice model
4] and its integrity variation
6]: DTE
prototype implements TCP substreams by breaking can be congured to provide a lattice but can also
the single mbuf chain into multiple chains where all enforce nonhierarchical security policies such as as-
the data of each chain has the same type attribute. sured pipelines
9] that drive information through
The TCP sliding window processing has been mod- policy-specied pathways of arbitrary connectivity
ied slightly to generate a new datagram at chain and complexity. DTE can also be congured to pro-
boundaries. On the receiving side, this mechanism vide integrity categories as in
18] and to support
works in reverse to return substream type informa- the transformation procedures and constrained data
tion that is then used both to mediate receive oper- items of the Clark/Wilson model
8].
ations by processes and to deliver type information Type enforcement was rst proposed in
9] for
for use by DTE-aware processes. the Secure Ada Target, a system later renamed
A signicant extension to the DTE prototype LOCK
25]. LOCK provides a Trusted Comput-
was required to implement DTE/NFS servers. Es- ing Base (TCB) on top of which a UNIX emu-
sentially, NFS le handles specify inode numbers lation layer provides UNIX services. As a conse-
that have no direct relation to the map nodes that quence, the type enforcement mechanism controls
implement implicit attributes for the prototype. A UNIX emulations instead of individual UNIX ap-
means was therefore required for mapping from in- plications and does not distinguish among multiple
ode numbers to map nodes. For directories accessed applications running on a single UNIX emulation.
via NFS, the solution is simple since every direc- This limitation also exists for a Mach-based LOCK
tory contains a \.." entry: using the \.." entries, derivative
14], which adds type enforcement to the
it is possible to reconstruct the portion of a path- Mach port, task, and virtual memory abstractions
name required to establish attribute values. The but provides no type enforcement within the UNIX
prototype currently carries out this reconstruction emulation layer.
at every NFS le handle reception however, tem- In
24], type enforcement was added to Trusted
porarily raising the reference counts of heavily used XENIX as a TCB subset. This system provides type
vnodes probably would increase performance and enforcement at the UNIX system-call interface and
prevent DTE overhead from being an NFS server can individually control UNIX applications. The
bottleneck. TCB subset architecture prohibited change to low-
For les, the on-disk representations do not im- level disk formats and mandated use of a separate
ply parents without an exhaustive search of le sys- runtime database to manipulate such attributes.
tem inodes. To avoid this, the DTE prototype This strategy is a precursor of the DTE runtime
stores (le-inode-number, parent-directory-inode- implicit type concept. Type enforcement has also
number) pairs during NFS lookup operations in a been integrated into at least one Internet rewall
cache. These entries provide a mechanism to reach product, the SCC Sidewinder5 system
23], but the
the rst directory that then allows pathnames to be authors are not aware of any published technical
reconstructed as necessary. To prevent any possi- details.
bility of introducing additional stale le handles at A number of UNIX security controls and
client applications, the cache must be maintained tools have been developed. Access Control
on secondary storage. For intentional DTE/NFS Lists (ACLs)
13] provide greater exibility in
server shutdowns, the cache can be written out only UNIX discretionary access controls, and user-mode
before shutdown. To avoid stale le handles after capabilities
16] also allow ner-grained control over
DTE/NFS server crashes, the cache must be main- propagation of access rights, but both mechanisms
tained during operation. In this case also, the cache are discretionary in nature and provide little protec-
contents can be batch written at timed intervals, re- tion against error-prone root programs. A variety
sulting in a minimal impact on performance. of trusted UNIX systems have been implemented
and evaluated against the Trusted Computer Sys-
6 Related Work tem Evaluation Criteria
20]. These systems typi-
The work most related to DTE and its UNIX cally provide MLS security but lack the exibility of
implementation falls into two general classes: access DTE. Additionally, tools such as COPS
12] check
control systems and UNIX security mechanisms.
DTE is most closely related to mandatory ac- 5 Sidewinder is a trademark of Secure Computing Corpo-
cess control techniques
4, 9, 6, 18, 8] and type- ration, Inc.
for system miscogurations but do not improve on DTEL can be modularized to reduce policy com-
the base UNIX security mechanisms themselves. plexity, and how DTE policies can be dynamically
The Trusted Systems Interoperability Group and safely extended or modied at runtime.
(TSIG) has developed Internet draft standards for
NFS and other protocols that support Multi-Level 8 Conclusions
Secure (MLS) networking. These standards com- A central question in practical UNIX security
municate signicant amounts of information to rep- is whether signicant enhancements can be added
resent security labels on subjects and objects that in a way that is understandable, eective, and un-
may \oat" up dynamically and to represent pro- obtrusive. This is a di cult question because ap-
cess privileges that may be communicated across plications and systems have evolved over time and
networks. For DTE, all of the required security now interact in subtle ways: practical security en-
information is contained in the relatively space- hancements must allow existing programs to func-
e cient type and domain identiers carried in the tion properly while preventing unsafe interactions.
IP-layer tra c, avoiding most changes to higher- DTE is an access control mechanism that uses a
layer protocols. specication language to add simplicity and uses
implicit typing to maintain compatibility and inter-
7 Future Directions operability. This paper reports on recent extensions
We are actively exploring several directions for to DTE to provide greater security for IP-based net-
DTE. The most immediate and important one is the working and NFS services, and on design consider-
integration of DTE into Internet rewalls. Over the ations of a DTE UNIX prototype. Our primary
next two years, we will integrate DTE into rewalls results are positive and, although the DTE proto-
in three phases: type is a research tool, we have used it internally to
provide guest users with safely restricted access to
DTE Firewalls An integration of DTE into an In- our corporate data.
ternet rewall and selected hosts. This inte- In sum, DTE has provided a useful research plat-
gration will add defense-in-depth to the re- form for building a hardened, compartmentalized
wall security perimeter. The DTE rewall will UNIX system. In addition, DTE mechanisms ap-
direct tra c from specied external hosts or pear suitable for interoperating and enforcing poli-
of specied protocols only to ow to internal cies within networks of existing systems having no
DTE hosts that can contain any malicious ef- DTE controls. This capability is critical because
fects. Our primary goal here is to allow more any enhanced protection system must interoperate
network services to be safely imported into a with existing systems through an extended transi-
LAN than is now prudent. tion phase as access controls are gradually adopted.
Distributed DTE Firewalls An integration of References
IP-layer encryption with the DTE rewall.
1] L. Badger, D. F. Sterne, D. L. Sherman, K.
This phase will connect multiple DTE enclaves M. Walker, S. A. Haghighat, \Practical Domain
across the Internet. and Type Enforcement for UNIX," 1995 IEEE
Symposium on Security and Privacy, Oakland
Domain and Type Authority Service A CA, May 1995.
DNS-like network service that will distribute
2] L. Badger, \A Model for Specifying Multi-
portions of DTEL policies. Communicating Granularity Integrity Policies," 1989 IEEE Sym-
DTE hosts will authenticate to this service and posium on Security and Privacy, p. 269, Oak-
use its DTE policy information as a basis for land, CA, May 1989.
establishing appropriate inter-host trust rela-
tions and also for agreement on how data of
3] R.W. Baldwin, \Naming and Grouping Privi-
specic types should be protected by commu- leges to Simplify Security Management in Large
nicating hosts. Databases," Proceedings of the 1990 IEEE Sym-
posium on Security and Privacy, p. 116, Oak-
In order to accomplish these goals, we will soon land, CA, May 1990.
begin investigating how multiple hosts can exchange
DTE information to negotiate network DTE poli-
4] D.E. Bell and L. Lapadula, \Secure Computer
cies, how DTE mechanisms can most eectively use System: Unied Exposition and Multics In-
encryption to protect DTE network attributes, how terpretation," (Technical Report No. ESD-TR-
75-306, Electronics Systems Division, AFSC,
17] C.E. Landwehr, C.L. Heitmeyer, and J.
Hanscom AF Base, Bedford MA, 1976). McLean, \A Security Model for Military Mes-
sage Systems," ACM Transactions on Computer

5] K.P. Birman, T. Joseph, K. Kane, F. Schmuck, Systems, Vol. 2, No. 3, August 1984, pp. 198-
\The ISIS Programming Manual and User's 222.
Guide," Department of Computer Science, Cor-
nell University, June 1988.
18] S.B. Lipner, \Non-Discretionary Controls for

6] K.J. Biba, \Integrity Considerations for Secure Commercial Applications," Proceedings of the
Computer Systems," USAF Electronic Systems 1982 IEEE Symposium on Security and Privacy,
Division, Bedford, MA, ESD-TR-76-372, 1977. Oakland, CA, p. 2, 1982.

7] M. Branstad, H. Tajalli, F. Mayer, D. Dalva,


19] M. K. McKusick, \The Virtual Filesystem In-
\Access Mediation in a Message Passing Ker- terface in 4.4BSD," USENIX Computing Sys-
nel," 1989 IEEE Symposium on Security and tems, Vol 8, Winter 1995, p. 3.
Privacy, p. 66, Oakland, CA, May 1989.
20] National Computer Security Center, \Depart-

8] D.D. Clark and D.R. Wilson, \A Comparison ment of Defense Trusted Computer System
of Commercial and Military Computer Security Evaluation Criteria," DoD 5200.28-STD, Dec.
Policies," Proceedings of the 1987 IEEE Sym- 1985.
posium on Security and Privacy, Oakland, CA,
21] R. O'Brien and C. Rogers. Developing Ap-
p. 184, 1987. plications on LOCK. In Proc. 14th National

9] W.E. Boebert and R.Y. Kain, \A Practical Computer Security Conference, pages 147{156,
Alternative to Hierarchical Integrity Policies," Washington, DC, October 1991.
Proceedings of the 8th National Computer Secu-
22] L.L. Peterson, N.C. Buchholz, R.D. Schlicht-
rity Conference, Gaithersburg, MD, p. 18, 1985. ing, \Preserving and Using Context Information

10] J. Ioannidis, M. Blaze, \The Architecture and in Interprocess Communication," ACM Trans-
Implementation of Network-Layer Security Un- actions on Computer Systems, 7(3):217-246,
der Unix," Presented at the USENIX Summer Aug. 1989.
1994 Technical Conference, Boston MA.
23] Secure Computing Corporation, Sidewinder

11] NBS, \Data Encryption Standard," Jan. 1977. Press Release, October 10, 1994.
Federal Information Processing Standards Pub-
24] D. Sterne, \A TCB Subset for Integrity and
lication 46. Role-Based Access Control," Proc. 15th Na-

12] D. Farmer, \The COPS Security Checker Sys- tional Computer Security Conference, pages
tem," Proceedings of the Summer 1990 USENIX 680{696, Baltimore, MD, 1992.
Conference, Anaheim, CA, p. 165.
25] O.S. Saydjari, J.M. Beckman, and J.R. Lea-

13] G. Fernandez, L. Allen, \Extending the UNIX man, \LOCK Trek: Navigating Uncharted
Protection Model with Access Control Lists," Space," Proceedings of the 1989 IEEE Sympo-
Proceedings of the Summer 1988 USENIX Con- sium on Security and Privacy, Oakland, CA, p.
ference, San Francisco, CA, 1988, p. 119. 167, 1989.

14] T. Fine and S. E. Minear, \Assuring Dis-


26] D. J. Thomsen, \Role-based Application De-
tributed Trusted Mach," 1993 IEEE Computer sign and Enforcement," In Proc. of the Fourth
Society Symposium on Research in Security and IFIP Workshop on Database Security, Halifax,
Privacy, Oakland, CA, p. 206, 1993. England, September 1990.

15] J. Kohl and C. Neuman, \The Kerberos Net-


27] S. Wiseman, \A Secure Capability Computer
work Authentication Service (V5)," RFC 1510, System," Proceedings of the 1986 IEEE Sympo-
September 1993. sium on Security and Privacy, Oakland, CA, p.
86, 1986.

16] D. Klein, \A Capability Based Protection


Mechanism Under Unix," Proceedings of the
1985 Winter USENIX Conference, Dallas,
Texas, p. 152.

Potrebbero piacerti anche