2008-08-19 19:30:36 +00:00
.TH "selinux" "8" "29 Apr 2005" "dwalsh@redhat.com" "SELinux Command Line documentation"
.SH "NAME"
2011-03-01 16:50:42 +00:00
SELinux \- NSA Security-Enhanced Linux (SELinux)
2012-11-13 20:15:34 +00:00
.
2008-08-19 19:30:36 +00:00
.SH "DESCRIPTION"
NSA Security-Enhanced Linux (SELinux) is an implementation of a
flexible mandatory access control architecture in the Linux operating
system. The SELinux architecture provides general support for the
enforcement of many kinds of mandatory access control policies,
including those based on the concepts of Type Enforcement®, Role-
Based Access Control, and Multi-Level Security. Background
information and technical documentation about SELinux can be found at
2012-01-16 17:09:43 +00:00
http://www.nsa.gov/research/selinux.
2008-08-19 19:30:36 +00:00
The
.I /etc/selinux/config
configuration file controls whether SELinux is
enabled or disabled, and if enabled, whether SELinux operates in
permissive mode or enforcing mode. The
.B SELINUX
variable may be set to
any one of disabled, permissive, or enforcing to select one of these
options. The disabled option completely disables the SELinux kernel
and application code, leaving the system running without any SELinux
protection. The permissive option enables the SELinux code, but
causes it to operate in a mode where accesses that would be denied by
policy are permitted but audited. The enforcing option enables the
SELinux code and causes it to enforce access denials as well as
auditing them. Permissive mode may yield a different set of denials
than enforcing mode, both because enforcing mode will prevent an
operation from proceeding past the first denial and because some
application code will fall back to a less privileged mode of operation
if denied access.
The
.I /etc/selinux/config
configuration file also controls what policy
is active on the system. SELinux allows for multiple policies to be
installed on the system, but only one policy may be active at any
2013-10-09 18:37:31 +00:00
given time. At present, multiple kinds of SELinux policy exist: targeted,
mls for example. The targeted policy is designed as a policy where most
user processes operate without restrictions, and only specific services are
2008-08-19 19:30:36 +00:00
placed into distinct security domains that are confined by the policy.
For example, the user would run in a completely unconfined domain
while the named daemon or apache daemon would run in a specific domain
2013-10-09 18:37:31 +00:00
tailored to its operation. The MLS (Multi-Level Security) policy is designed
as a policy where all processes are partitioned into fine-grained security
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.
You can
2008-08-19 19:30:36 +00:00
define which policy you will run by setting the
.B SELINUXTYPE
environment variable within
2012-11-13 20:15:34 +00:00
.IR /etc/selinux/config .
2013-10-09 18:37:31 +00:00
You must reboot and possibly relabel if you change the policy type to have it take effect on the system.
2008-08-19 19:30:36 +00:00
The corresponding
policy configuration for each such policy must be installed in the
2012-11-13 20:15:34 +00:00
.I /etc/selinux/{SELINUXTYPE}/
directories.
2008-08-19 19:30:36 +00:00
A given SELinux policy can be customized further based on a set of
compile-time tunable options and a set of runtime policy booleans.
2013-10-09 18:37:31 +00:00
.B \% system\-config\-selinux
2008-08-19 19:30:36 +00:00
allows customization of these booleans and tunables.
2011-03-01 16:50:42 +00:00
Many domains that are protected by SELinux also include SELinux man pages explaining how to customize their policy.
2012-11-13 20:15:34 +00:00
.
.SH "FILE LABELING"
2008-08-19 19:30:36 +00:00
All files, directories, devices ... have a security context/label associated with them. These context are stored in the extended attributes of the file system.
2011-03-01 16:50:42 +00:00
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.
2008-08-19 19:30:36 +00:00
2012-11-13 20:15:34 +00:00
The best way to relabel the file system is to create the flag file
.I /.autorelabel
and reboot.
.BR system\-config\-selinux ,
also has this capability. The
2014-05-23 18:10:05 +00:00
.BR restorecon / fixfiles
2012-11-13 20:15:34 +00:00
commands are also available for relabeling files.
.
2015-11-07 09:20:56 +00:00
.SH AUTHOR
2008-08-19 19:30:36 +00:00
This manual page was written by Dan Walsh <dwalsh@redhat.com>.
2012-11-13 20:15:34 +00:00
.
.SH FILES
.I /etc/selinux/config
.
2008-08-19 19:30:36 +00:00
.SH "SEE ALSO"
2012-11-13 20:15:34 +00:00
.ad l
.nh
.BR booleans (8),
.BR setsebool (8),
2013-10-09 18:37:31 +00:00
.BR sepolicy (8),
.BR system-config-selinux (8),
2012-11-13 20:15:34 +00:00
.BR togglesebool (8),
.BR restorecon (8),
2013-10-09 18:37:31 +00:00
.BR fixfiles (8),
2012-11-13 20:15:34 +00:00
.BR setfiles (8),
2013-10-09 18:37:31 +00:00
.BR semanage (8),
2012-11-13 20:15:34 +00:00
.BR sepolicy(8)
2008-08-19 19:30:36 +00:00
2012-10-12 19:26:44 +00:00
Every confined service on the system has a man page in the following format:
.br
.B <servicename>_selinux(8)
For example, httpd has the
.B httpd_selinux(8)
man page.
.B man -k selinux
Will list all SELinux man pages.