File: constraints

package info (click to toggle)
refpolicy 0.0.20061018-5
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 7,488 kB
  • ctags: 415
  • sloc: xml: 55,156; python: 1,867; makefile: 463; sh: 457; ansic: 290; perl: 171; sed: 14; awk: 7
file content (106 lines) | stat: -rw-r--r-- 1,880 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

#
# Define the constraints
#
# constrain class_set perm_set expression ;
#
# expression : ( expression ) 
#	     | not expression
#	     | expression and expression
#	     | expression or expression
#	     | u1 op u2
#	     | r1 role_op r2
#	     | t1 op t2
#	     | u1 op names
#	     | u2 op names
#	     | r1 op names
#	     | r2 op names
#	     | t1 op names
#	     | t2 op names
#
# op : == | != 
# role_op : == | != | eq | dom | domby | incomp
#
# names : name | { name_list }
# name_list : name | name_list name		
#

#
# SELinux process identity change constraint:
#
ifdef(`strict_policy',`
	constrain process transition
	(
		u1 == u2

		or ( t1 == can_change_process_identity and t2 == process_user_target )

	       	or ( t1 == cron_source_domain and ( t2 == cron_job_domain or u2 == system_u ) )

		or ( t1 == can_system_change and u2 == system_u )

		or ( t1 == process_uncond_exempt )
	);
')

ifdef(`targeted_policy',`
	constrain process transition
	(
		u1 == u2

		or t1 == can_change_process_identity
	);
')

#
# SELinux process role change constraint:
#

ifdef(`strict_policy',`
	constrain process transition 
	(
		r1 == r2 

		or ( t1 == can_change_process_role and t2 == process_user_target )

       		or ( t1 == cron_source_domain and t2 == cron_job_domain )

		or ( t1 == can_system_change and r2 == system_r )

		or ( t1 == process_uncond_exempt )
	);
')

ifdef(`targeted_policy',`
	constrain process transition 
	(
		r1 == r2 

		or t1 == can_change_process_role
	);
')

#
# SELinux dynamic transition constraint:
#
constrain process dyntransition
(
	u1 == u2 and r1 == r2
);

#
# SElinux object identity change constraint:
#
constrain dir_file_class_set { create relabelto relabelfrom } 
(
	u1 == u2

	or t1 == can_change_object_identity
);

constrain socket_class_set { create relabelto relabelfrom } 
(
	u1 == u2

	or t1 == can_change_object_identity
);