Chris PeBenito 473ea7
.TH  "selinux"  "8"  "29 Apr 2005" "dwalsh@redhat.com" "SELinux Command Line documentation"
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "NAME"
Chris PeBenito 473ea7
selinux \- NSA Security-Enhanced Linux (SELinux)
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "DESCRIPTION"
Chris PeBenito 473ea7
Chris PeBenito 473ea7
NSA Security-Enhanced Linux (SELinux) is an implementation of a
Chris PeBenito 473ea7
flexible mandatory access control architecture in the Linux operating
Chris PeBenito 473ea7
system.  The SELinux architecture provides general support for the
Chris PeBenito 473ea7
enforcement of many kinds of mandatory access control policies,
Chris PeBenito 473ea7
including those based on the concepts of Type EnforcementĀ®, Role-
Chris PeBenito 473ea7
Based Access Control, and Multi-Level Security.  Background
Chris PeBenito 473ea7
information and technical documentation about SELinux can be found at
Chris PeBenito 473ea7
http://www.nsa.gov/selinux.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
The
Chris PeBenito 473ea7
.I /etc/selinux/config
Chris PeBenito 473ea7
configuration file controls whether SELinux is
Chris PeBenito 473ea7
enabled or disabled, and if enabled, whether SELinux operates in
Chris PeBenito 473ea7
permissive mode or enforcing mode.  The
Chris PeBenito 473ea7
.B SELINUX
Chris PeBenito 473ea7
variable may be set to
Chris PeBenito 473ea7
any one of disabled, permissive, or enforcing to select one of these
Chris PeBenito 473ea7
options.  The disabled option completely disables the SELinux kernel
Chris PeBenito 473ea7
and application code, leaving the system running without any SELinux
Chris PeBenito 473ea7
protection.  The permissive option enables the SELinux code, but
Chris PeBenito 473ea7
causes it to operate in a mode where accesses that would be denied by
Chris PeBenito 473ea7
policy are permitted but audited.  The enforcing option enables the
Chris PeBenito 473ea7
SELinux code and causes it to enforce access denials as well as
Chris PeBenito 473ea7
auditing them.  Permissive mode may yield a different set of denials
Chris PeBenito 473ea7
than enforcing mode, both because enforcing mode will prevent an
Chris PeBenito 473ea7
operation from proceeding past the first denial and because some
Chris PeBenito 473ea7
application code will fall back to a less privileged mode of operation
Chris PeBenito 473ea7
if denied access.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
The
Chris PeBenito 473ea7
.I /etc/selinux/config
Chris PeBenito 473ea7
configuration file also controls what policy
Chris PeBenito 473ea7
is active on the system.  SELinux allows for multiple policies to be
Chris PeBenito 473ea7
installed on the system, but only one policy may be active at any
Chris PeBenito 473ea7
given time.  At present, two kinds of SELinux policy exist: targeted
Chris PeBenito 473ea7
and strict.  The targeted policy is designed as a policy where most
Chris PeBenito 473ea7
processes operate without restrictions, and only specific services are
Chris PeBenito 473ea7
placed into distinct security domains that are confined by the policy.
Chris PeBenito 473ea7
For example, the user would run in a completely unconfined domain
Chris PeBenito 473ea7
while the named daemon or apache daemon would run in a specific domain
Chris PeBenito 473ea7
tailored to its operation.  The strict policy is designed as a policy
Chris PeBenito 473ea7
where all processes are partitioned into fine-grained security domains
Chris PeBenito 473ea7
and confined by policy.  It is anticipated in the future that other
Chris PeBenito 473ea7
policies will be created (Multi-Level Security for example).  You can
Chris PeBenito 473ea7
define which policy you will run by setting the
Chris PeBenito 473ea7
.B SELINUXTYPE
Chris PeBenito 473ea7
environment variable within
Chris PeBenito 473ea7
.I /etc/selinux/config.
Chris PeBenito 473ea7
The corresponding
Chris PeBenito 473ea7
policy configuration for each such policy must be installed in the
Chris PeBenito 473ea7
/etc/selinux/SELINUXTYPE/ directories.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
A given SELinux policy can be customized further based on a set of
Chris PeBenito 473ea7
compile-time tunable options and a set of runtime policy booleans.
Chris PeBenito 473ea7
.B system-config-securitylevel
Chris PeBenito 473ea7
allows customization of these booleans and tunables.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.br
Chris PeBenito 473ea7
Many domains that are protected by SELinux also include selinux man pages explainging how to customize their policy.  
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH FILE LABELING
Chris PeBenito 473ea7
Chris PeBenito 473ea7
All files, directories, devices ... have a security context/label associated with them.  These context are stored in the extended attributes of the file system.
Chris PeBenito 473ea7
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.  
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
The best way to relabel the file system is to create the flag file /.autorelabel and reboot.  system-config-securitylevel, also has this capability.  The restorcon/fixfiles commands are also available for relabeling files. 
Chris PeBenito 473ea7
  
Chris PeBenito 473ea7
.SH AUTHOR	
Chris PeBenito 473ea7
This manual page was written by Dan Walsh <dwalsh@redhat.com>.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "SEE ALSO"
Chris PeBenito 473ea7
booleans(8), setsebool(8), selinuxenabled(8), togglesebool(8), restorecon(8), setfiles(8), ftpd_selinux(8), named_selinux(8), rsync_selinux(8), httpd_selinux(8), nfs_selinux(8), samba_selinux(8), kerberos_selinux(8), nis_selinux(8), ypbind_selinux(8)
Chris PeBenito 473ea7
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH FILES
Chris PeBenito 473ea7
/etc/selinux/config