Security-Enhanced Linux

Security-Enhanced Linux
The SELinux administrator in Fedora 8

Security-Enhanced Linux (SELinux) is a Linux feature that provides a mechanism for supporting access control security policies, including United States Department of Defense-style mandatory access controls, through the use of Linux Security Modules (LSM) in the Linux kernel. It is not a Linux distribution, but rather a set of Kernel modifications and user-space tools that can be added to various Linux distributions. Its architecture strives to separate enforcement of security decisions from the security policy itself and streamlines the volume of software charged with security policy enforcement [1][2]. The key concepts underlying SELinux can be traced to several earlier projects by the United States National Security Agency.



The United States National Security Agency (NSA), the original primary developer of SELinux, released the first version to the open source development community under the GNU GPL on December 22, 2000.[3] The software merged into the mainline Linux kernel 2.6.0-test3, released on 8 August 2003. Other significant contributors include Network Associates, Secure Computing Corporation, Trusted Computer Solutions, and Tresys. Experimental ports of the FLASK/TE implementation have been made available via the TrustedBSD Project for the FreeBSD and Darwin operating systems.

From NSA Security-enhanced Linux Team:

"NSA Security-enhanced Linux is a set of patches to the Linux kernel and some utilities to incorporate a strong, flexible mandatory access control (MAC) architecture into the major subsystems of the kernel. It provides an enhanced mechanism to enforce the separation of information based on confidentiality and integrity requirements, which allows threats of tampering and bypassing of application security mechanisms to be addressed and enables the confinement of damage that can be caused by malicious or flawed applications. It includes a set of sample security policy configuration files designed to meet common, general-purpose security goals."

(SELinux has been integrated into version 2.6 series of the Linux kernel, and separate patches are now unnecessary; the above is a historical quote.)

Security-Enhanced Linux implements the Flux Advanced Security Kernel (FLASK) integrated in some versions of the Linux kernel with a number of utilities designed to demonstrate the value of mandatory access controls to the Linux community and how such controls could be added to Linux. Such a kernel contains architectural components prototyped in the Fluke operating system. These provide general support for enforcing many kinds of mandatory access control policies, including those based on the concepts of type enforcement, role-based access control, and multilevel security. FLASK, in turn, was based on DTOS, a Mach-derived Distributed Trusted Operating System, as well as Trusted Mach, a research project from Trusted Information Systems that had an influence on the design and implementation of DTOS.

A Linux kernel integrating SELinux enforces mandatory access-control policies that confine user programs and system servers to the minimum amount of privilege they require to do their jobs. This reduces or eliminates the ability of these programs and daemons to cause harm when compromised (via buffer overflows or misconfigurations, for example). This confinement mechanism operates independently of the traditional Linux access control mechanisms. It has no concept of a "root" super-user, and does not share the well-known shortcomings of the traditional Linux security mechanisms (such as a dependence on setuid/setgid binaries).

The security of an unmodified Linux system depends on the correctness of the kernel, of all the privileged applications, and of each of their configurations. A problem in any one of these areas may allow the compromise of the entire system. In contrast, the security of a modified system based on an SELinux kernel depends primarily on the correctness of the kernel and its security-policy configuration. While problems with the correctness or configuration of applications may allow the limited compromise of individual user programs and system daemons, they do not pose a threat to the security of other user programs and system daemons or to the security of the system as a whole.

From a purist perspective, SELinux provides a hybrid of concepts and capabilities drawn from mandatory access controls, mandatory integrity controls, role-based access control (RBAC), and type enforcement architecture. Third-party tools enable one to build a variety of security policies.

Users, policies and security contexts

SELinux users and roles are not related to the actual system users and roles. For every current user or process, SELinux assigns a three string context consisting of a role, user name, and domain (or type). This system is more flexible than normally required: as a rule, most of the real users share the same SELinux username, and all access control is managed through the third tag, the domain. Circumstance for when the user is allowed to get into a certain domain must be configured in the policies. The command runcon allows for the launching of a process into an explicitly specified context (user, role and domain), but SELinux may deny the transition if it is not approved by the policy configuration.

Files, network ports, and other hardware also have an SELinux context, consisting of a name, role (seldom used), and type. In case of the file systems, mapping between files and the security contexts is called labeling. The labeling is defined in policy files but can also be manually adjusted without changing the policies. Hardware types are quite detailed, for instance, bin_t (all files in the folder /bin) or postgresql_port_t (PostgreSQL port, 5432). The SELinux context for a remote file system can be specified explicitly at mount time. SELinux adds the -Z switch to the shell commands ls, ps, and some others, allowing the security context of the files or process to be seen.

Typical policy rules often consist of explicit permissions; which domains the user must possess to perform certain actions with the given target (read, execute, or, in case of network port, bind or connect), and so on. More complex mappings are also possible, involving roles and security levels. A typical policy consists of a mapping (labeling) file, a rule file, and an interface file, that define the domain transition. These three files must be compiled together with the SELinux tools to produce a single policy file. The resulting policy file can be loaded into the kernel, making it active. Loading and unloading policies does not require a reboot. The policy files are either hand written or can be generated from the more user friendly SELinux management tool. They are normally tested in permissive mode first, where violations are logged but allowed. The audit2allow tool can be used later to produce additional rules that extend the policy to allow all legitimate activities of the application being confined.


  • Clean separation of policy from enforcement
  • Well-defined policy interfaces
  • Support for applications querying the policy and enforcing access control (for example, crond running jobs in the correct context)
  • Independent of specific policies and policy languages
  • Independent of specific security label formats and contents
  • Individual labels and controls for kernel objects and services
  • Caching of access decisions for efficiency
  • Support for policy changes
  • Separate measures for protecting system integrity (domain-type) and data confidentiality (multilevel security)
  • Very flexible policy
  • Controls over process initialization and inheritance and program execution
  • Controls over file systems, directories, files, and open file descriptors
  • Controls over sockets, messages, and network interfaces
  • Controls over use of "capabilities"


SELinux can potentially control all users, processes and daemons with very precise specifications which activities are allowed for every member. However, it is mostly used to confine daemons like database engines or web servers that have more clearly defined data access and activity rights. A confined daemon that becomes compromised is thus limited in the harm it can do. Ordinary user processes often run in the unconfined domain, not restricted by SELinux but still restricted by the classic Linux access rights.

See also: chcon[4], restorecon[5], restorecond[6], runcon[7], secon[8], fixfiles[9], setfiles[10], load_policy[11], booleans[12], getsebool[13], setsebool[14], togglesebool[15] setenforce, load_policy setfiles[16], selinuxenabled, semodule, postfix-nochroot, check-selinux-installation, semodule_package, checkmodule, selinux-config-enforcing, selinuxenabled, selinux-policy-upgrade ;

and also: security_set_boolean[17]

Usage example (to put SELinux in permissive mode):

# setenforce 0


SELinux is available with commercial support as part of Red Hat Enterprise Linux (RHEL) version 4 and all future releases. This presence is also reflected in corresponding versions of CentOS. The supported policy in RHEL4 is the targeted policy which aims for maximum ease of use and thus is not as restrictive as it might be. Future versions of RHEL will have more targets in the targeted policy which will mean more restrictive policies.

In free community supported GNU/Linux distributions, Fedora was one of the earliest adopters, including support for it by default since Fedora Core 2. Other distributions include support for it such as Debian as of the etch release,[18] Ubuntu as of 8.04 Hardy Heron,[19] Hardened Gentoo, and Yellow Dog Linux.

It is also supported in EnGarde Secure Linux.[citation needed]

As of version 11.1, openSUSE contains SELinux "basic enablement".[20] SUSE Linux Enterprise 11 will feature SELinux as a "technology preview".

There was some work to provide SELinux packages for Slackware,[21] but development seems to have stagnated.

There has been work on other distributions such as Familiar Linux, but some of this was ceased due to technical reasons. (The Familiar Linux work was abandoned when SELinux needed extended file attributes, unsupported in the JFFS2 filesystem.)[citation needed]

The earliest work directed toward standardizing an approach toward provision of mandatory and discretionary access controls (MAC and DAC) within a UNIX (more precisely, POSIX) computing environment can be attributed to the National Security Agency's Trusted UNIX (TRUSIX) Working Group, which met from 1987 to 1991 and published one Rainbow Book (#020A) and produced a formal model and associated evaluation evidence prototype (#020B) that was ultimately unpublished. It was sponsored by Chet Coates and Mario Tinto of the NSA's National Computer Security Center, and managed by Dr. Charles Testa and Bruce Wilner of Infosystems Technology (Greenbelt, Maryland; later, Falls Church, Virginia), the crucial architects of the TRUSIX project, and members of its Modeling Subcommittee — Steve Bunch, Dr. Frank Knowles, Dr. J. Eric Roskos, Larry Wehr, and Bruce Wilner.[22] Their efforts, particularly as critics of the less technically profound work of the TRUSIX Access Control List (ACL) Subcommittee, survive in the IEEE POSIX 1003.6 "security extensions for portable operating systems environments" specification.[citation needed]

Other systems

SELinux represents one of several possible approaches to the problem of restricting the actions that installed software can take.

The AppArmor system generally takes a similar approach to SELinux. One important difference is that AppArmor identifies file system objects by path name instead of inode. This means that, for example, a file that is inaccessible may become accessible under AppArmor when a hard link is created to it, while SELinux would deny access through the newly created hard link. On the other hand, data that is inaccessible may become accessible when applications update the file by replacing it with a new version — a frequently used technique — while AppArmor would continue to deny access to the data. In both cases, a default policy of "no access" avoids the problem.[citation needed]

SELinux and AppArmor also differ significantly in how they are administered and how they integrate into the system.[citation needed]

Isolation of processes can also be accomplished by mechanisms like virtualization; the OLPC project, for example, in its first implementation[23] sandboxed individual applications in lightweight Vservers.


Some software and security analysts are pointing the improbable aspect of the NSA offering such a tool to the community and the potential conflict of interest inherent to it.

  • "Let me assure you that this action by the NSA was the crypto-equivalent of the Pope coming down off the balcony in Rome, working the crowd with a few loaves of bread and some fish, and then inviting everyone to come over to his place to watch the soccer game and have a few beers. There are some things that one just never expects to see, and the NSA handing out source code along with details of the security mechanism behind it was right up there on that list." — Larry Loeb[cite this quote]
  • "I have a long bet that SELinux is an NSA backdoor"[24] —  Zed Shaw

See also


  1. ^
  2. ^
  3. ^ Compare "National Security Agency Shares Security Enhancements to LINUX". NSA Press Release. Fort George G. Meade, Maryland: National Security Agency Central Security Service. 2001-01-02. Retrieved 2011-11-17. "The NSA is pleased to announce that it has developed, and is making available to the public, a prototype version of a security-enhanced Linux system." 
  4. ^
  5. ^
  6. ^
  7. ^
  8. ^
  9. ^
  10. ^
  11. ^
  12. ^
  13. ^
  14. ^
  15. ^
  16. ^
  17. ^
  18. ^ SELinux in Debian
  19. ^ SELinux support for Ubuntu
  20. ^ SELinux in SUSE
  21. ^ SELinux slackware
  22. ^ Testa and Wilner, under NSA auspices, also briefly chaired the joint DoD/DOE Labeling Working Group, which counted among its membership such early TCSEC contributors as David Bell, former chief scientist of the DoD Computer Security Center Marvin Schaefer, and Willis Ware, as well as building Trusted RUBIX, the only relational database management system to offer B2 functionality and assurance atop a B2 POSIX platform, partially under the auspices of the United States Air Force Rome Laboratory.
  23. ^ OLPC/Sugar Rainbow
  24. ^ Why I Don't Use Tor

External links

Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Security-Enhanced Linux — SELinux (англ. Security Enhanced Linux  Linux с улучшенной безопасностью)  реализация системы принудительного контроля доступа, которая может работать параллельно с классической дискреционной системой контроля доступа. Входит в стандартное ядро… …   Википедия

  • Security-Enhanced Linux — SELinux Security Enhanced Linux, abrégé SELinux, est un Linux security module (LSM), qui permet de définir une politique de contrôle d accès obligatoire aux éléments d un système basé sur Linux. Initié par la NSA sur la base de travaux menés avec …   Wikipédia en Français

  • Security Enhanced Linux — SELinux Security Enhanced Linux, abrégé SELinux, est un Linux security module (LSM), qui permet de définir une politique de contrôle d accès obligatoire aux éléments d un système basé sur Linux. Initié par la NSA sur la base de travaux menés avec …   Wikipédia en Français

  • Linux Symposium — The Linux Symposium (commonly referred to as OLS, from Ottawa Linux Symposium, though it is not necessarily held in Ottawa) is a Linux and Open Source conference held annually in Canada. It features 100+ paper presentations, tutorials, birds of a …   Wikipedia

  • Linux malware — includes viruses, trojans, worms and other types of malware that affect the Linux operating system. Linux, Unix and other Unix like computer operating systems are generally regarded as very well protected, but not immune, from computer viruses.… …   Wikipedia

  • Multilevel security — or Multiple Levels of Security (abbreviated as MLS) is the application of a computer system to process information with different sensitivities (i.e., at different security levels), permit simultaneous access by users with different security… …   Wikipedia

  • Unix security — Unix security: maintaining a secure environment on Unix and Unix like operating systems is dependent on design concepts of these operating systems, but vigilance through user and administrative techniques is important to maintain security… …   Wikipedia

  • National Security Agency — 39° 06′ 32″ N 76° 46′ 12″ W / 39.109, 76.77 …   Wikipédia en Français

  • SE Linux — SELinux Security Enhanced Linux, abrégé SELinux, est un Linux security module (LSM), qui permet de définir une politique de contrôle d accès obligatoire aux éléments d un système basé sur Linux. Initié par la NSA sur la base de travaux menés avec …   Wikipédia en Français

  • Armed Forces Security Agency — National Security Agency « NSA » redirige ici. Pour les autres significations, voir NSA (homonymie). National Security Agency …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”