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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
## <summary>Collection of tools for managing UNIX services.</summary>
########################################
## <summary>
## An ipc channel between the
## supervised domain and svc_start_t.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`daemontools_ipc_domain',`
gen_require(`
type svc_start_t;
')
allow $1 svc_start_t:process sigchld;
allow $1 svc_start_t:fd use;
allow $1 svc_start_t:fifo_file rw_fifo_file_perms;
allow svc_start_t $1:process signal;
')
########################################
## <summary>
## Create a domain which can be
## started by daemontools.
## </summary>
## <param name="domain">
## <summary>
## Type to be used as a domain.
## </summary>
## </param>
## <param name="entrypoint">
## <summary>
## Type of the program to be used as an entry point to this domain.
## </summary>
## </param>
#
interface(`daemontools_service_domain',`
gen_require(`
type svc_run_t;
')
domain_auto_trans(svc_run_t, $2, $1)
daemontools_ipc_domain($1)
allow svc_run_t $1:process signal;
allow $1 svc_run_t:fd use;
')
########################################
## <summary>
## Execute svc start in the svc
## start domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`daemontools_domtrans_start',`
gen_require(`
type svc_start_t, svc_start_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, svc_start_exec_t, svc_start_t)
')
######################################
## <summary>
## Execute svc start in the svc
## start domain, and allow the
## specified role the svc start domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`daemonstools_run_start',`
gen_require(`
attribute_role svc_start_roles;
')
daemontools_domtrans_start($1)
roleattribute $2 svc_start_roles;
')
########################################
## <summary>
## Execute avc run in the svc run domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`daemontools_domtrans_run',`
gen_require(`
type svc_run_t, svc_run_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, svc_run_exec_t, svc_run_t)
')
######################################
## <summary>
## Send child terminated signals
## to svc run.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`daemontools_sigchld_run',`
gen_require(`
type svc_run_t;
')
allow $1 svc_run_t:process sigchld;
')
########################################
## <summary>
## Execute avc multilog in the svc
## multilog domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`daemontools_domtrans_multilog',`
gen_require(`
type svc_multilog_t, svc_multilog_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, svc_multilog_exec_t, svc_multilog_t)
')
######################################
## <summary>
## Search svc svc directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`daemontools_search_svc_dir',`
gen_require(`
type svc_svc_t;
')
files_search_var($1)
allow $1 svc_svc_t:dir search_dir_perms;
')
########################################
## <summary>
## Read svc avc files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`daemontools_read_svc',`
gen_require(`
type svc_svc_t;
')
files_search_var($1)
allow $1 svc_svc_t:dir list_dir_perms;
allow $1 svc_svc_t:file read_file_perms;
')
########################################
## <summary>
## Create, read, write and delete
## svc svc content.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`daemontools_manage_svc',`
gen_require(`
type svc_svc_t;
')
files_search_var($1)
allow $1 svc_svc_t:dir manage_dir_perms;
allow $1 svc_svc_t:fifo_file manage_fifo_file_perms;
allow $1 svc_svc_t:file manage_file_perms;
allow $1 svc_svc_t:lnk_file manage_lnk_file_perms;
')
|