Chris PeBenito ab58ad
The Makefile targets are:
Chris PeBenito ab58ad
policy - compile the policy configuration.
Chris PeBenito ab58ad
install - compile and install the policy configuration.
Chris PeBenito ab58ad
load    - compile, install, and load the policy configuration.
Chris PeBenito ab58ad
relabel - relabel the filesystem.
Chris PeBenito ab58ad
check-all - check individual additional policy files in domains/program/unused.
Chris PeBenito ab58ad
checkunused/FILE.te - check individual file FILE from domains/program/unused.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
If you have configured MLS into your module, then set MLS=y in the
Chris PeBenito ab58ad
Makefile prior to building the policy.  Of course, you must have also
Chris PeBenito ab58ad
built checkpolicy with MLS enabled.  
Chris PeBenito ab58ad
Chris PeBenito ab58ad
Three of the configuration files are independent of the particular
Chris PeBenito ab58ad
security policy:
Chris PeBenito ab58ad
1) flask/security_classes -
Chris PeBenito ab58ad
   This file has a simple declaration for each security class.
Chris PeBenito ab58ad
   The corresponding symbol definitions are in the automatically
Chris PeBenito ab58ad
   generated header file <selinux/flask.h>. 
Chris PeBenito ab58ad
Chris PeBenito ab58ad
2) flask/initial_sids - 
Chris PeBenito ab58ad
   This file has a simple declaration for each initial SID.
Chris PeBenito ab58ad
   The corresponding symbol definitions are in the automatically
Chris PeBenito ab58ad
   generated header file <selinux/flask.h>.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
3) access_vectors - 
Chris PeBenito ab58ad
   This file defines the access vectors.  Common prefixes for
Chris PeBenito ab58ad
   access vectors may be defined at the beginning of the file.
Chris PeBenito ab58ad
   After the common prefixes are defined, an access vector
Chris PeBenito ab58ad
   may be defined for each security class.
Chris PeBenito ab58ad
   The corresponding symbol definitions are in the automatically
Chris PeBenito ab58ad
   generated header file <selinux/av_permissions.h>.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
In addition to being read by the security server, these configuration
Chris PeBenito ab58ad
files are used during the kernel build to automatically generate
Chris PeBenito ab58ad
symbol definitions used by the kernel for security classes, initial
Chris PeBenito ab58ad
SIDs and permissions.  Since the symbol definitions generated from
Chris PeBenito ab58ad
these files are used during the kernel build, the values of existing
Chris PeBenito ab58ad
security classes and permissions may not be modified by load_policy.
Chris PeBenito ab58ad
However, new classes may be appended to the list of classes and new
Chris PeBenito ab58ad
permissions may be appended to the list of permissions associated with
Chris PeBenito ab58ad
each access vector definition.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
The policy-dependent configuration files are:
Chris PeBenito ab58ad
1) tmp/all.te -  
Chris PeBenito ab58ad
   This file defines the Type Enforcement (TE) configuration.
Chris PeBenito ab58ad
   This file is automatically generated from a collection of files.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
   The macros subdirectory contains a collection of m4 macro definitions
Chris PeBenito ab58ad
   used by the TE configuration.  The global_macros.te file contains global 
Chris PeBenito ab58ad
   macros used throughout the configuration for common groupings of classes 
Chris PeBenito ab58ad
   and permissions and for common sets of rules.  The user_macros.te file
Chris PeBenito ab58ad
   contains macros used in defining user domains.  The admin_macros.te file
Chris PeBenito ab58ad
   contains macros used in defining admin domains.  The macros/program 
Chris PeBenito ab58ad
   subdirectory contains macros that are used to instantiate derived domains
Chris PeBenito ab58ad
   for certain programs that encode information about both the calling user
Chris PeBenito ab58ad
   domain and the program, permitting the policy to maintain separation 
Chris PeBenito ab58ad
   between different instances of the program.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
   The types subdirectory contains several files with declarations for
Chris PeBenito ab58ad
   general types (types not associated with a particular domain) and 
Chris PeBenito ab58ad
   some rules defining relationships among those types.  Related types 
Chris PeBenito ab58ad
   are grouped together into each file in this directory, e.g. all
Chris PeBenito ab58ad
   device type declarations are in the device.te file.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
   The domains subdirectory contains several files and directories
Chris PeBenito ab58ad
   with declarations and rules for each domain.  User domains are defined in 
Chris PeBenito ab58ad
   user.te.  Administrator domains are defined in admin.te.  Domains for 
Chris PeBenito ab58ad
   specific programs, including both system daemons and other programs, are 
Chris PeBenito ab58ad
   in the .te files within the domains/program subdirectory.  The domains/misc
Chris PeBenito ab58ad
   subdirectory is for miscellaneous domains such as the kernel domain and
Chris PeBenito ab58ad
   the kernel module loader domain.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
   The assert.te file contains assertions that are checked after evaluating 
Chris PeBenito ab58ad
   the entire TE configuration.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
2) rbac - 
Chris PeBenito ab58ad
   This file defines the Role-Based Access Control (RBAC) configuration.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
3) mls - 
Chris PeBenito ab58ad
   This file defines the Multi-Level Security (MLS) configuration.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
4) users -
Chris PeBenito ab58ad
   This file defines the users recognized by the security policy.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
5) constraints - 
Chris PeBenito ab58ad
   This file defines additional constraints on permissions
Chris PeBenito ab58ad
   in the form of boolean expressions that must be satisfied in order
Chris PeBenito ab58ad
   for specified permissions to be granted.  These constraints
Chris PeBenito ab58ad
   are used to further refine the type enforcement tables and
Chris PeBenito ab58ad
   the role allow rules.  Typically, these constraints are used
Chris PeBenito ab58ad
   to restrict changes in user identity or role to certain domains.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
6) initial_sid_contexts -
Chris PeBenito ab58ad
   This file defines the security context for each initial SID.
Chris PeBenito ab58ad
   A security context consists of a user identity, a role, a type and
Chris PeBenito ab58ad
   optionally a MLS range if the MLS policy is enabled.  If left unspecified,
Chris PeBenito ab58ad
   the high MLS level defaults to the low MLS level.  The syntax of a valid 
Chris PeBenito ab58ad
   security context is:
Chris PeBenito ab58ad
Chris PeBenito ab58ad
     user:role:type[:sensitivity[:category,...][-sensitivity[:category,...]]]
Chris PeBenito ab58ad
Chris PeBenito ab58ad
7) fs_use -
Chris PeBenito ab58ad
   This file defines the labeling behavior for inodes in particular
Chris PeBenito ab58ad
   filesystem types.  
Chris PeBenito ab58ad
Chris PeBenito ab58ad
8) genfs_contexts -
Chris PeBenito ab58ad
   This file defines security contexts for files in filesystems that
Chris PeBenito ab58ad
   cannot support persistent label mappings or use one of the fixed
Chris PeBenito ab58ad
   labeling schemes specified in fs_use.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
8) net_contexts -
Chris PeBenito ab58ad
   This file defines the security contexts of network objects
Chris PeBenito ab58ad
   such as ports, interfaces, and nodes.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
9) file_contexts/{types.fc,program/*.fc}
Chris PeBenito ab58ad
   These files define the security contexts for persistent files.
Chris PeBenito ab58ad
Chris PeBenito ab58ad
It is possible to test the security server functions on a given policy
Chris PeBenito ab58ad
configuration by running the checkpolicy program with the -d option.
Chris PeBenito ab58ad
This program is built from the same sources as the security server
Chris PeBenito ab58ad
component of the kernel, so it may be used both to verify that a
Chris PeBenito ab58ad
policy configuration will load successfully and to determine how the
Chris PeBenito ab58ad
security server would respond if it were using that policy
Chris PeBenito ab58ad
configuration.  A menu-based interface is provided for calling any of
Chris PeBenito ab58ad
the security server functions after the policy is loaded.