Chapter 2. Targeted policy
Targeted policy is the default SELinux policy used in Red Hat Enterprise Linux. When using targeted policy, processes that are targeted run in a confined domain, and processes that are not targeted run in an unconfined domain. For example, by default, logged in users run in the unconfined_t
domain, and system processes started by init
run in the initrc_t
domain - both of these domains are unconfined.
SELinux is based on the least level of access required for a service to run. Services can be run in a variety of ways; therefore, you must tell SELinux how you are running services. This can be achieved via Booleans that allow parts of SELinux policy to be changed at runtime by the administrator, without requiring any knowledge of SELinux policy writing. This allows changes, such as allowing services access to NFS file systems, without having to reload or recompile SELinux policy. Boolean configuration is discussed throughout this guide using detailed examples.
Other changes, such as using non-default directories to store files for services, and changing services to run on non-default port numbers, require policy configuration to be updated via tools such as the semanage
command, which is provided by the policycoreutils-python package. This command is discussed throughout this guide using detailed configuration examples.
Type Enforcement is the main permission control used in SELinux targeted policy. All files and processes are labeled with a type: types define a domain for processes and a type for files. SELinux policy rules define how types access each other, whether it be a domain accessing a type, or a domain accessing another domain. Access is only allowed if a specific SELinux policy rule exists that allows it.