Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# Define the constraints
Chris PeBenito 134191
#
Chris PeBenito 134191
# constrain class_set perm_set expression ;
Chris PeBenito 134191
#
Chris PeBenito 134191
# expression : ( expression ) 
Chris PeBenito 134191
#	     | not expression
Chris PeBenito 134191
#	     | expression and expression
Chris PeBenito 134191
#	     | expression or expression
Chris PeBenito 134191
#	     | u1 op u2
Chris PeBenito 134191
#	     | r1 role_op r2
Chris PeBenito 134191
#	     | t1 op t2
Chris PeBenito 134191
#	     | u1 op names
Chris PeBenito 134191
#	     | u2 op names
Chris PeBenito 134191
#	     | r1 op names
Chris PeBenito 134191
#	     | r2 op names
Chris PeBenito 134191
#	     | t1 op names
Chris PeBenito 134191
#	     | t2 op names
Chris PeBenito 134191
#
Chris PeBenito 134191
# op : == | != 
Chris PeBenito 134191
# role_op : == | != | eq | dom | domby | incomp
Chris PeBenito 134191
#
Chris PeBenito 134191
# names : name | { name_list }
Chris PeBenito 134191
# name_list : name | name_list name		
Chris PeBenito 134191
#
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# SELinux process identity change constraint:
Chris PeBenito 134191
#
Chris PeBenito bd56da
ifdef(`strict_policy',`
Chris PeBenito bd56da
	constrain process transition
Chris PeBenito bd56da
	(
Chris PeBenito bd56da
		u1 == u2
Chris PeBenito c98340
Chris PeBenito bd56da
		or ( t1 == can_change_process_identity and t2 == process_user_target )
Chris PeBenito c98340
Chris PeBenito bd56da
	       	or ( t1 == cron_source_domain and ( t2 == cron_job_domain or u2 == system_u ) )
Chris PeBenito 2e863f
Chris PeBenito bd56da
		or ( t1 == can_system_change and u2 == system_u )
Chris PeBenito c98340
Chris PeBenito bd56da
		or ( t1 == process_uncond_exempt )
Chris PeBenito bd56da
	);
Chris PeBenito bd56da
')
Chris PeBenito bd56da
Chris PeBenito bd56da
ifdef(`targeted_policy',`
Chris PeBenito bd56da
	constrain process transition
Chris PeBenito bd56da
	(
Chris PeBenito bd56da
		u1 == u2
Chris PeBenito bd56da
Chris PeBenito bd56da
		or t1 == can_change_process_identity
Chris PeBenito bd56da
	);
Chris PeBenito 96ce00
')
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# SELinux process role change constraint:
Chris PeBenito 134191
#
Chris PeBenito bd56da
Chris PeBenito bd56da
ifdef(`strict_policy',`
Chris PeBenito bd56da
	constrain process transition 
Chris PeBenito bd56da
	(
Chris PeBenito bd56da
		r1 == r2 
Chris PeBenito bd56da
Chris PeBenito bd56da
		or ( t1 == can_change_process_role and t2 == process_user_target )
Chris PeBenito bd56da
Chris PeBenito bd56da
       		or ( t1 == cron_source_domain and t2 == cron_job_domain )
Chris PeBenito bd56da
Chris PeBenito bd56da
		or ( t1 == can_system_change and r2 == system_r )
Chris PeBenito bd56da
Chris PeBenito bd56da
		or ( t1 == process_uncond_exempt )
Chris PeBenito bd56da
	);
Chris PeBenito bd56da
')
Chris PeBenito 2e863f
Chris PeBenito c98340
ifdef(`targeted_policy',`
Chris PeBenito bd56da
	constrain process transition 
Chris PeBenito bd56da
	(
Chris PeBenito bd56da
		r1 == r2 
Chris PeBenito bd56da
Chris PeBenito bd56da
		or t1 == can_change_process_role
Chris PeBenito bd56da
	);
Chris PeBenito 134191
')
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# SELinux dynamic transition constraint:
Chris PeBenito 134191
#
Chris PeBenito 134191
constrain process dyntransition
Chris PeBenito bd56da
(
Chris PeBenito bd56da
	u1 == u2 and r1 == r2
Chris PeBenito bd56da
);
Chris PeBenito 134191
Chris PeBenito 134191
#
Chris PeBenito 134191
# SElinux object identity change constraint:
Chris PeBenito 134191
#
Chris PeBenito 134191
constrain dir_file_class_set { create relabelto relabelfrom } 
Chris PeBenito bd56da
(
Chris PeBenito bd56da
	u1 == u2
Chris PeBenito bd56da
Chris PeBenito bd56da
	or t1 == can_change_object_identity
Chris PeBenito bd56da
);
Chris PeBenito 134191
Chris PeBenito 134191
constrain socket_class_set { create relabelto relabelfrom } 
Chris PeBenito bd56da
(
Chris PeBenito bd56da
	u1 == u2
Chris PeBenito bd56da
Chris PeBenito bd56da
	or t1 == can_change_object_identity
Chris PeBenito bd56da
);