aboutsummaryrefslogtreecommitdiff
blob: 70fe64575654f2d23f37184b072ef2de88b6fae2 (plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
## <summary>Run .NET server and client applications on Linux.</summary>

#######################################
## <summary>
##	The role template for the mono module.
## </summary>
## <desc>
##	<p>
##	This template creates a derived domains which are used
##	for mono applications.
##	</p>
## </desc>
## <param name="role_prefix">
##	<summary>
##	The prefix of the user domain (e.g., user
##	is the prefix for user_t).
##	</summary>
## </param>
## <param name="user_role">
##	<summary>
##	The role associated with the user domain.
##	</summary>
## </param>
## <param name="user_domain">
##	<summary>
##	The type of the user domain.
##	</summary>
## </param>
#
template(`mono_role_template',`
	gen_require(`
		attribute mono_domain;
		type mono_exec_t;
	')

	########################################
	#
	# Declarations
	#

	type $1_mono_t, mono_domain;
	domain_type($1_mono_t)
	domain_entry_file($1_mono_t, mono_exec_t)
	role $2 types $1_mono_t;

	domain_interactive_fd($1_mono_t)
	application_type($1_mono_t)

	########################################
	#
	# Policy
	#

	domtrans_pattern($3, mono_exec_t, $1_mono_t)

	allow $3 $1_mono_t:process { ptrace noatsecure signal_perms };
	ps_process_pattern($2, $1_mono_t)

	corecmd_bin_domtrans($1_mono_t, $3)

	userdom_manage_user_tmpfs_files($1_mono_t)

	optional_policy(`
		fs_dontaudit_rw_tmpfs_files($1_mono_t)

		xserver_role($1_r, $1_mono_t)
	')
')

########################################
## <summary>
##	Execute mono in the mono domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`mono_domtrans',`
	gen_require(`
		type mono_t, mono_exec_t;
	')

	corecmd_search_bin($1)
	domtrans_pattern($1, mono_exec_t, mono_t)
')

########################################
## <summary>
##	Execute mono in the mono domain, and
##	allow the specified role the mono domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	Role allowed access.
##	</summary>
## </param>
#
interface(`mono_run',`
	gen_require(`
		attribute_role mono_roles;
	')

	mono_domtrans($1)
	roleattribute $2 mono_roles;
')

########################################
## <summary>
##	Execute mono in the caller domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`mono_exec',`
	gen_require(`
		type mono_exec_t;
	')

	corecmd_search_bin($1)
	can_exec($1, mono_exec_t)
')

########################################
## <summary>
##	Read and write mono shared memory.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`mono_rw_shm',`
	gen_require(`
		type mono_t;
	')

	allow $1 mono_t:shm rw_shm_perms;
')