| 1 |
.TH "selinux" "8" "29 Apr 2005" "[email protected]" "SELinux Command Line documentation" |
| 2 |
.SH "NAME" |
| 3 |
SELinux \- NSA Security-Enhanced Linux (SELinux) |
| 4 |
. |
| 5 |
.SH "DESCRIPTION" |
| 6 |
NSA Security-Enhanced Linux (SELinux) is an implementation of a |
| 7 |
flexible mandatory access control architecture in the Linux operating |
| 8 |
system. The SELinux architecture provides general support for the |
| 9 |
enforcement of many kinds of mandatory access control policies, |
| 10 |
including those based on the concepts of Type EnforcementĀ®, Role- |
| 11 |
Based Access Control, and Multi-Level Security. Background |
| 12 |
information and technical documentation about SELinux can be found at |
| 13 |
http://www.nsa.gov/research/selinux. |
| 14 |
|
| 15 |
The |
| 16 |
.I /etc/selinux/config |
| 17 |
configuration file controls whether SELinux is |
| 18 |
enabled or disabled, and if enabled, whether SELinux operates in |
| 19 |
permissive mode or enforcing mode. The |
| 20 |
.B SELINUX |
| 21 |
variable may be set to |
| 22 |
any one of disabled, permissive, or enforcing to select one of these |
| 23 |
options. The disabled option completely disables the SELinux kernel |
| 24 |
and application code, leaving the system running without any SELinux |
| 25 |
protection. The permissive option enables the SELinux code, but |
| 26 |
causes it to operate in a mode where accesses that would be denied by |
| 27 |
policy are permitted but audited. The enforcing option enables the |
| 28 |
SELinux code and causes it to enforce access denials as well as |
| 29 |
auditing them. Permissive mode may yield a different set of denials |
| 30 |
than enforcing mode, both because enforcing mode will prevent an |
| 31 |
operation from proceeding past the first denial and because some |
| 32 |
application code will fall back to a less privileged mode of operation |
| 33 |
if denied access. |
| 34 |
|
| 35 |
The |
| 36 |
.I /etc/selinux/config |
| 37 |
configuration file also controls what policy |
| 38 |
is active on the system. SELinux allows for multiple policies to be |
| 39 |
installed on the system, but only one policy may be active at any |
| 40 |
given time. At present, multiple kinds of SELinux policy exist: targeted, |
| 41 |
mls for example. The targeted policy is designed as a policy where most |
| 42 |
user processes operate without restrictions, and only specific services are |
| 43 |
placed into distinct security domains that are confined by the policy. |
| 44 |
For example, the user would run in a completely unconfined domain |
| 45 |
while the named daemon or apache daemon would run in a specific domain |
| 46 |
tailored to its operation. The MLS (Multi-Level Security) policy is designed |
| 47 |
as a policy where all processes are partitioned into fine-grained security |
| 48 |
domains and confined by policy. MLS also supports the Bell And LaPadula model, where processes are not only confined by the type but also the level of the data. |
| 49 |
|
| 50 |
You can |
| 51 |
define which policy you will run by setting the |
| 52 |
.B SELINUXTYPE |
| 53 |
environment variable within |
| 54 |
.IR /etc/selinux/config . |
| 55 |
You must reboot and possibly relabel if you change the policy type to have it take effect on the system. |
| 56 |
The corresponding |
| 57 |
policy configuration for each such policy must be installed in the |
| 58 |
.I /etc/selinux/{SELINUXTYPE}/ |
| 59 |
directories. |
| 60 |
|
| 61 |
A given SELinux policy can be customized further based on a set of |
| 62 |
compile-time tunable options and a set of runtime policy booleans. |
| 63 |
.B \%system\-config\-selinux |
| 64 |
allows customization of these booleans and tunables. |
| 65 |
|
| 66 |
Many domains that are protected by SELinux also include SELinux man pages explaining how to customize their policy. |
| 67 |
. |
| 68 |
.SH "FILE LABELING" |
| 69 |
All files, directories, devices ... have a security context/label associated with them. These context are stored in the extended attributes of the file system. |
| 70 |
Problems with SELinux often arise from the file system being mislabeled. This can be caused by booting the machine with a non SELinux kernel. If you see an error message containing file_t, that is usually a good indicator that you have a serious problem with file system labeling. |
| 71 |
|
| 72 |
The best way to relabel the file system is to create the flag file |
| 73 |
.I /.autorelabel |
| 74 |
and reboot. |
| 75 |
.BR system\-config\-selinux , |
| 76 |
also has this capability. The |
| 77 |
.BR restorecon / fixfiles |
| 78 |
commands are also available for relabeling files. |
| 79 |
. |
| 80 |
.SH AUTHOR |
| 81 |
This manual page was written by Dan Walsh <[email protected]>. |
| 82 |
. |
| 83 |
.SH FILES |
| 84 |
.I /etc/selinux/config |
| 85 |
. |
| 86 |
.SH "SEE ALSO" |
| 87 |
.ad l |
| 88 |
.nh |
| 89 |
.BR booleans (8), |
| 90 |
.BR setsebool (8), |
| 91 |
.BR sepolicy (8), |
| 92 |
.BR system-config-selinux (8), |
| 93 |
.BR togglesebool (8), |
| 94 |
.BR restorecon (8), |
| 95 |
.BR fixfiles (8), |
| 96 |
.BR setfiles (8), |
| 97 |
.BR semanage (8), |
| 98 |
.BR sepolicy (8) |
| 99 |
|
| 100 |
Every confined service on the system has a man page in the following format: |
| 101 |
.br |
| 102 |
|
| 103 |
.BR <servicename>_selinux (8) |
| 104 |
|
| 105 |
For example, httpd has the |
| 106 |
.BR httpd_selinux (8) |
| 107 |
man page. |
| 108 |
|
| 109 |
.B man -k selinux |
| 110 |
|
| 111 |
Will list all SELinux man pages. |