The Trustedbsd MAC Framework
Total Page:16
File Type:pdf, Size:1020Kb
The TrustedBSD MAC Framework: Extensible Kernel Access Control for FreeBSD 5.0 Robert Watson Wayne Morrison Network Associates Laboratories Network Associates Laboratories Rockville, MD Rockville, MD [email protected] [email protected] http://www.nailabs.com/ Chris Vance Brian Feldman Network Associates Laboratories FreeBSD Project Rockville, MD Rockville, MD [email protected] [email protected] http://www.nailabs.com/ Abstract 2 The Desire For Access Control Exten- We explore the requirements, design, and implemen- sions tation of the TrustedBSD MAC Framework. The FreeBSD serves two primary markets: it is both a con- TrustedBSD MAC Framework, integrated into FreeBSD sumer operating system and a technology source for 5.0, provides a flexible framework for kernel access con- third party operating systems or high-end embedded trol extension, permitting extensions to be introduced products. FreeBSD is directly employed as a produc- more easily, and avoiding the need for direct modifica- tion server and workstation operating system on main- tion of distributed kernel sources. We also consider the stream i386, Alpha, and SPARC64 hardware. In the performance impact of the Framework on the FreeBSD high-end embedded market, it is used as the basis for 5.0 kernel in several test environments. network and storage appliance devices such as firewalls, network-attached storage, and VPN devices; it is also 1 Introduction used as a technology source for third party operating Access control extensions have proved a fertile field for system, including Apple’s Mac OS X Darwin kernel, as operating system security research over the past twenty well as by other operating system vendors. years: a variety of methods have been employed to ex- In these three roles, FreeBSD is deployed in a wide tend the system access control policy at great cost to the variety of environments, ranging from electronic cheque developers, maintainers, and users of the extended sys- processing and point of sale devices to web cluster de- tems. Most of approaches to security extension fall short ployment, firewall, and routing appliances. Each of two vital areas: lack of support by the operating system these environments has different security requirements, vendor for various providers of security extensions on often requiring flexibility beyond that provided for by the system, and the highly redundant implementation of the traditional UNIX security protections. Especially in support infrastructure for security extension providers. embedded network environments, the requirements can The TrustedBSD MAC Framework included in range from simple operating system hardening to the in- FreeBSD 5.0 provides a general facility for extending troduction of mandatory and fine-grained security poli- the kernel access control policy [8][18]. By providing cies. common security infrastructure services, such as kernel object labeling, and the ability to instrument kernel ac- 3 Access Control Extension Mechanisms cess control decisions, the Framework is capable of sup- Security research and development literature is rife with porting a variety of policies implemented by different approaches to achieving operating system access control vendors. This paper explores the design, implementa- extension with (and without) the help of the operating tion and performance of the MAC Framework, as well system vendor. Traditional trusted variants of commer- as its impact on policy design and the FreeBSD kernel cial UNIX operating systems have been written by the architecture. vendor in response to the needs of specific consumers ¡ First published in the Proceedings of the FREENIX Track: 2003 (such as US DoD) [12][5][9][10]. Typical practice has USENIX Annual Technical Conference (FREENIX ’03) been to maintain a distinction between the base OS prod- uct and the trusted variant in terms of maintenance, prod- tory” refers to the mandatory imposition of the policy uct identification, and price. In addition, there are third on non-administrative users. Popular mandatory poli- party vendors who develop and market trusted operating cies including Multi-Level Security (MLS), which en- system extensions, often in close coordination with the forces mandatory protections based on administrator- OS vendor[2]. Finally, there is a broad range of access defined confidentiality labels, Biba integrity, which en- control research across many operating systems and per- forces system and user data integrity properties, and formed in many forms [7] [14] [16]—most frequently, Type Enforcement, which permits the administrator to this work is performed on open source operating systems define subject domains, object types, and use a policy due to ready access to operating system source code. language to control accesses to objects and other system In order to successfully maintain a security extension properties. product for an operating system, access to the operating Trusted operating systems typically provide two or system code is typically required, be it an open source more mandatory system policies: almost all provide system, or licensed from the closed source vendor. Prod- MLS for user data protection, but many also make use uct maintenance raises a number of challenges, not least of the Biba policy to protect the integrity of the Trusted the challenge of tracking the operating system vendor’s Code Base (TCB). The TrustedBSD Project, in seeking primary product life cycle, which is frequently incom- to provide access to trusted operating system features, patible with the development cycle required for high provides several MAC policies for use with FreeBSD; assurance products. Many practical impediments also the challenges associated with this work include intro- present themselves: security extensions have their fin- ducing the services securely, and without substantially gers deep in the heart of the operating system, touch- impacting the performance and reliability of FreeBSD ing almost all elements of the kernel source code. Lo- installations not taking advantage of these new features. cal security extensions invariably conflict with vendor- provided security patches, as well as vendor-provided 5 Framework Design and Implementation feature improvements over the OS development cycle. The TrustedBSD MAC Framework permits access con- In addition, security extensions frequently conflict with trol policy modules to be loaded into the FreeBSD ker- one another if deployed in parallel, leading not only to nel, providing a tightly integrated security extension ve- potentially inconsistent policy behavior, but also possi- hicle. In order to address the problems identified in Sec- ble bypass of protections provided by one of the policies. tion 3 there are several high-level goals for the design: Direct source code modification of the vendor operating ¢ Permit dynamic extension of the kernel access con- system presents many challenges to security extension trol policy. authors. ¢ Isolate the logic of access control policies from the In the past, research has been performed on how implementation of kernel services, permitting the to most easily extend operating system security poli- implementations of services to be more mobile in cies, including into system-call interposition technolo- the face of extensions, and reducing OS life cycle gies such as LOMAC [6], Generic Software Wrap- issues for policy developers. pers [7], and systrace [13], extensible security mecha- ¢ Permit multiple policies to be loaded simultane- nisms such as the General Framework for Access Con- ously with some useful notion of composition. trol [1] and FLASK [16]. Many of these extension tech- ¢ Reduce the redundant infrastructure implementa- nologies, especially these using system call wrapping tion efforts of policy writers by providing support techniques, fall down in the face of modern UNIX op- for common policy infrastructure requirements. erating system kernels which support true kernel and ¢ Integrate tightly with the kernel locking and thread- user process parallelism in SMP environments, and fine- ing mechanisms to provide correctness and high grained threading of user processes. Preventing races in- performance in modern kernel designs. herent to system call wrapping is difficult, and most sys- tem call wrapper security technologies are susceptible 5.1 High Level Design to at least one of a class of related vulnerabilities. Any The MAC Framework is made up of a number of ker- successful extension technology for contemporary oper- nel and user-space elements. In the kernel, existing ker- ating systems must be designed with the notion that SMP nel services are modified to add data structure exten- and threading are realities, and must be well-integrated sions and entry points to the MAC Framework, central- into the kernel locking mechanisms. ized management of label storage, registration and man- agement of security modules, a series of system calls 4 Motivations for MAC and sysctls to permit applications to interact with la- Mandatory Access Control (MAC) describes a broad bels and manage the framework, and a series of access class of access control policies; in this context “manda- policy modules that may be compiled into the kernel or loaded via loadable kernel modules. In user-space, sev- 5.2 Kernel Services and Objects eral new C library interfaces provide access to central- The MAC Framework enforces policy over a variety of mac.conf ized label configuration via , and changes to kernel subsystems and objects, including system config- libutil the user class