|
|
|
|
NOTE: CentOS Enterprise Linux is built from the Red Hat Enterprise Linux source code. Other than logo and name changes CentOS Enterprise Linux is compatible with the equivalent Red Hat version. This document applies equally to both Red Hat and CentOS Enterprise Linux.
SELinux uses types in various ways. After they are declared,
they can be used to make rules for the transition decision process,
type changing process, and access vector decisions and
assertions.
|
Note |
|
Defining the type transitions does not enable them. By default,
access is denied until specifically allowed.
|
Domains are types applied to processes, identified by the type
having the domain attribute.
The same type is used for the process itself and the associated
/proc file. Typically, you see the domain
used as the source context for system operations, that is, the
domain is the doer. A domain can be a target context, such as when
init is sending process signals to a
daemon.
With every SELinux transaction involving at least one domain,
the number and kind of domains is central to the complexity of the
security policy. More domains means finer security control, with a
matching increase in configuration and maintenance
difficulties.
- Type Declaration
-
This syntax defines how types are declared. A type must be
declared before rules can be written about it. The targeted daemons
have their top-level domain declared through the macro daemon_domain(), which is discussed in
Section 3.4 Common Macros
in the Targeted Policy.
## Syntax of a type declaration
type <typename> [aliases] [attributes];
## Examples
type httpd_config_t, file_type, sysadmfile;
# httpd_config_t is a system administration file
type http_port_t, port_type, reserved_port_type;
# httpd_port_t is a reserved port, that is, number less than 1024
type httpd_php_exec_t, file_type, sysadmfile, exec_type;
# httpd_php_exec_t is a sysadmin file that is an entry point
# executable
|
- Type Transitions
-
A type transition results in a new process running in a new
domain different from the executing process, or a new object being
labeled with a type different from the source doing the
labeling.
The rules define what domain and file type transitions occur by
default. The domain transition default can be overridden if the
process explicitly requests a particular context. File transition
default is actually inherit-from-parent, that is, the new file
receives its context from the parent directory unless an explicit
transition rule makes it inherit-from-creator. For example, the
directory ~/ has a type of user_home_dir_t, and policy specifies that
files created in a directory with that type are labeled with
user_home_t.
Transitions are defined through macros that combine the
type_transition rule with a set
of allow rules. The allow rules are macros with variables that
support common transitioning needs. For more information about
macros, refer to Section 2.9
Policy Macros.
- Type Changes
-
This kind of transition is not used in the targeted policy in
Red Hat Enterprise Linux 4. Type changes are used by trusted
applications to change the labels of objects, such as login relabeling the tty for a user session. For
more information about type changes, refer to the sources found in
Chapter 9
References.
|
|
|