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