summaryrefslogtreecommitdiffstats
path: root/pki/patches/pki-core-9.0.3-r2128.patch
blob: ddafce9ea6a596b9145737af828e1109ff4e97b8 (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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
Index: base/selinux/src/pki.if
===================================================================
--- base/selinux/src/pki.if	(revision 2127)
+++ base/selinux/src/pki.if	(revision 2128)
@@ -3,24 +3,6 @@
 
 ########################################
 ## <summary>
-##	Execute pki_ca server in the pki_ca domain.
-## </summary>
-## <param name="domain">
-##	<summary>
-##	The type of the process performing this action.
-##	</summary>
-## </param>
-#
-interface(`pki_ca_script_domtrans',`
-	gen_require(`
-		attribute pki_ca_script;
-	')
-
-	init_script_domtrans_spec($1,pki_ca_script)
-')
-
-########################################
-## <summary>
 ##	Create a set of derived types for apache
 ##	web content.
 ## </summary>
@@ -51,8 +33,17 @@
 	domain_type($1_t)
 	init_daemon_domain($1_t, $1_exec_t)
 
-	type $1_script_exec_t, pki_ca_script;
-	init_script_file($1_script_exec_t)
+        type $1_script_t;
+        domain_type($1_script_t)
+        gen_require(`
+                type java_exec_t;
+                type initrc_t;
+        ')
+        domtrans_pattern($1_script_t, java_exec_t, $1_t)
+        unconfined_domain($1_script_t)
+        role system_r types $1_script_t;
+        allow $1_t java_exec_t:file entrypoint;
+        allow initrc_t $1_script_t:process transition;
 
 	type $1_etc_rw_t, pki_ca_config;
 	files_type($1_etc_rw_t)
@@ -136,7 +127,6 @@
 	corecmd_read_bin_symlinks($1_t)
 	corecmd_exec_shell($1_t)
         corecmd_search_bin($1_t)
-        corecmd_search_sbin($1_t)
 
 	dev_list_sysfs($1_t)
 	dev_read_rand($1_t)
@@ -256,24 +246,6 @@
 
 ########################################
 ## <summary>
-##	Execute pki_kra server in the pki_kra domain.
-## </summary>
-## <param name="domain">
-##	<summary>
-##	The type of the process performing this action.
-##	</summary>
-## </param>
-#
-interface(`pki_kra_script_domtrans',`
-	gen_require(`
-		attribute pki_kra_script;
-	')
-
-	init_script_domtrans_spec($1,pki_kra_script)
-')
-
-########################################
-## <summary>
 ##	All of the rules required to administrate 
 ##	an pki_kra environment
 ## </summary>
@@ -326,25 +298,6 @@
 
 ########################################
 ## <summary>
-##	Execute pki_ocsp server in the pki_ocsp domain.
-## </summary>
-## <param name="domain">
-##	<summary>
-##	The type of the process performing this action.
-##	</summary>
-## </param>
-#
-interface(`pki_ocsp_script_domtrans',`
-	gen_require(`
-		attribute pki_ocsp_script;
-	')
-
-	init_script_domtrans_spec($1,pki_ocsp_script)
-')
-
-
-########################################
-## <summary>
 ##	All of the rules required to administrate 
 ##	an pki_ocsp environment
 ## </summary>
@@ -534,11 +487,9 @@
         allow pki_tps_t self:netlink_route_socket { write getattr read bind create nlmsg_read };
 
         corecmd_exec_bin(pki_tps_t)
-        corecmd_exec_sbin(pki_tps_t)
         corecmd_exec_shell(pki_tps_t)
         corecmd_read_bin_symlinks(pki_tps_t)
         corecmd_search_bin(pki_tps_t)
-        corecmd_search_sbin(pki_tps_t)
 
         corenet_sendrecv_unlabeled_packets(pki_tps_t)
         corenet_tcp_bind_all_nodes(pki_tps_t)
@@ -556,8 +507,7 @@
         corenet_tcp_sendrecv_all_if(pki_tps_t)
         corenet_tcp_sendrecv_all_nodes(pki_tps_t)
         corenet_tcp_sendrecv_all_ports(pki_tps_t)
-        corenet_non_ipsec_sendrecv(pki_tps_t)
-
+        corenet_all_recvfrom_unlabeled(pki_tps_t)
 
         dev_read_urand(pki_tps_t)
         files_exec_usr_files(pki_tps_t)
@@ -606,7 +556,7 @@
         rpm_exec(pki_tps_t)
 
         # allow writing to the kernel keyring
-        allow $pki_tps_t self:key { write read };
+        allow pki_tps_t self:key { write read };
 
 ')
 
@@ -722,11 +672,9 @@
         allow pki_ra_t self:netlink_route_socket { write getattr read bind create nlmsg_read };
 
         corecmd_exec_bin(pki_ra_t)
-        corecmd_exec_sbin(pki_ra_t)
         corecmd_exec_shell(pki_ra_t)
-        corecmd_read_sbin_symlinks(pki_ra_t)
+        corecmd_read_bin_symlinks(pki_ra_t)
         corecmd_search_bin(pki_ra_t)
-        corecmd_search_sbin(pki_ra_t)
 
         corenet_sendrecv_unlabeled_packets(pki_ra_t)
         corenet_tcp_bind_all_nodes(pki_ra_t)
@@ -735,7 +683,7 @@
         corenet_tcp_sendrecv_all_if(pki_ra_t)
         corenet_tcp_sendrecv_all_nodes(pki_ra_t)
         corenet_tcp_sendrecv_all_ports(pki_ra_t)
-        corenet_non_ipsec_sendrecv(pki_ra_t)
+        corenet_all_recvfrom_unlabeled(pki_ra_t)
         corenet_tcp_connect_generic_port(pki_ra_t)
 
         # talk to other subsystems
@@ -787,7 +735,7 @@
         rpm_exec(pki_ra_t)
 
         # allow writing to the kernel keyring
-        allow $pki_ra_t self:key { write read };
+        allow pki_ra_t self:key { write read };
 
 
 ')
@@ -851,25 +799,6 @@
 
 ########################################
 ## <summary>
-##	Execute pki_tks server in the pki_tks domain.
-## </summary>
-## <param name="domain">
-##	<summary>
-##	The type of the process performing this action.
-##	</summary>
-## </param>
-#
-interface(`pki_tks_script_domtrans',`
-	gen_require(`
-		attribute pki_tks_script;
-	')
-
-	init_script_domtrans_spec($1,pki_tks_script)
-')
-
-
-########################################
-## <summary>
 ##	All of the rules required to administrate 
 ##	an pki_tks environment
 ## </summary>
Index: base/selinux/src/pki.fc
===================================================================
--- base/selinux/src/pki.fc	(revision 2127)
+++ base/selinux/src/pki.fc	(revision 2128)
@@ -1,8 +1,6 @@
 
 /usr/bin/dtomcat5-pki-ca	--	gen_context(system_u:object_r:pki_ca_exec_t,s0)
 
-/etc/init.d/pki-ca		--	gen_context(system_u:object_r:pki_ca_script_exec_t,s0)
-
 /etc/pki-ca(/.*)?			gen_context(system_u:object_r:pki_ca_etc_rw_t,s0)
 /etc/pki-ca/tomcat5.conf  	--      gen_context(system_u:object_r:pki_ca_tomcat_exec_t,s0)
 
@@ -14,8 +12,6 @@
 
 /usr/bin/dtomcat5-pki-kra	--	gen_context(system_u:object_r:pki_kra_exec_t,s0)
 
-/etc/init.d/pki-kra		--	gen_context(system_u:object_r:pki_kra_script_exec_t,s0)
-
 /etc/pki-kra(/.*)?			gen_context(system_u:object_r:pki_kra_etc_rw_t,s0)
 /etc/pki-kra/tomcat5.conf  	--      gen_context(system_u:object_r:pki_kra_tomcat_exec_t,s0)
 
@@ -27,8 +23,6 @@
 
 /usr/bin/dtomcat5-pki-ocsp	--	gen_context(system_u:object_r:pki_ocsp_exec_t,s0)
 
-/etc/init.d/pki-ocsp		--	gen_context(system_u:object_r:pki_ocsp_script_exec_t,s0)
-
 /etc/pki-ocsp(/.*)?			gen_context(system_u:object_r:pki_ocsp_etc_rw_t,s0)
 /etc/pki-ocsp/tomcat5.conf  	--      gen_context(system_u:object_r:pki_ocsp_tomcat_exec_t,s0)
 
@@ -39,7 +33,6 @@
 /var/log/pki-ocsp(/.*)?			gen_context(system_u:object_r:pki_ocsp_log_t,s0)
 
 /usr/sbin/httpd.worker  --      gen_context(system_u:object_r:pki_ra_exec_t,s0)
-/etc/init.d/pki-ra      --      gen_context(system_u:object_r:pki_ra_script_exec_t,s0)
 /etc/pki-ra(/.*)?               gen_context(system_u:object_r:pki_ra_etc_rw_t,s0)
 /var/lib/pki-ra(/.*)?           gen_context(system_u:object_r:pki_ra_var_lib_t,s0)
 /var/log/pki-ra(/.*)?           gen_context(system_u:object_r:pki_ra_log_t,s0)
@@ -47,8 +40,6 @@
 
 /usr/bin/dtomcat5-pki-tks	--	gen_context(system_u:object_r:pki_tks_exec_t,s0)
 
-/etc/init.d/pki-tks		--	gen_context(system_u:object_r:pki_tks_script_exec_t,s0)
-
 /etc/pki-tks(/.*)?			gen_context(system_u:object_r:pki_tks_etc_rw_t,s0)
 /etc/pki-tks/tomcat5.conf  	--      gen_context(system_u:object_r:pki_tks_tomcat_exec_t,s0)
 
@@ -58,7 +49,6 @@
 
 /var/log/pki-tks(/.*)?			gen_context(system_u:object_r:pki_tks_log_t,s0)
 
-/etc/init.d/pki-tps     --      gen_context(system_u:object_r:pki_tps_script_exec_t,s0)
 /etc/pki-tps(/.*)?              gen_context(system_u:object_r:pki_tps_etc_rw_t,s0)
 /var/lib/pki-tps(/.*)?          gen_context(system_u:object_r:pki_tps_var_lib_t,s0)
 /var/log/pki-tps(/.*)?          gen_context(system_u:object_r:pki_tps_log_t,s0)
@@ -72,36 +62,30 @@
 # labeling for new CA under pki-cad
 
 /var/run/pki/ca(/.*)? 	        gen_context(system_u:object_r:pki_ca_var_run_t,s0)
-/etc/init.d/pki-cad             gen_context(system_u:object_r:pki_ca_script_exec_t,s0)
 /etc/sysconfig/pki/ca(/.*)?	gen_context(system_u:object_r:pki_ca_etc_rw_t,s0)
 
 # labeling for new KRA under pki-krad
 
 /var/run/pki/kra(/.*)? 	        gen_context(system_u:object_r:pki_kra_var_run_t,s0)
-/etc/init.d/pki-krad            gen_context(system_u:object_r:pki_kra_script_exec_t,s0)
 /etc/sysconfig/pki/kra(/.*)?	gen_context(system_u:object_r:pki_kra_etc_rw_t,s0)
 
 # labeling for new OCSP under pki-ocspd
 
 /var/run/pki/ocsp(/.*)?         gen_context(system_u:object_r:pki_ocsp_var_run_t,s0)
-/etc/init.d/pki-ocspd           gen_context(system_u:object_r:pki_ocsp_script_exec_t,s0)
 /etc/sysconfig/pki/ocsp(/.*)?	gen_context(system_u:object_r:pki_ocsp_etc_rw_t,s0)
 
 # labeling for new TKS under pki-tksd
 
 /var/run/pki/tks(/.*)? 	        gen_context(system_u:object_r:pki_tks_var_run_t,s0)
-/etc/init.d/pki-tksd            gen_context(system_u:object_r:pki_tks_script_exec_t,s0)
 /etc/sysconfig/pki/tks(/.*)?	gen_context(system_u:object_r:pki_tks_etc_rw_t,s0)
 
 # labeling for new RA under pki-rad
 
 /var/run/pki/ra(/.*)? 	        gen_context(system_u:object_r:pki_ra_var_run_t,s0)
-/etc/init.d/pki-rad             gen_context(system_u:object_r:pki_ra_script_exec_t,s0)
 /etc/sysconfig/pki/ra(/.*)?	    gen_context(system_u:object_r:pki_ra_etc_rw_t,s0)
 
 # labeling for new TPS under pki-tpsd
 
 /var/run/pki/tps(/.*)? 	        gen_context(system_u:object_r:pki_tps_var_run_t,s0)
-/etc/init.d/pki-tpsd            gen_context(system_u:object_r:pki_tps_script_exec_t,s0)
 /etc/sysconfig/pki/tps(/.*)?	gen_context(system_u:object_r:pki_tps_etc_rw_t,s0)
 
Index: base/selinux/src/pki.te
===================================================================
--- base/selinux/src/pki.te	(revision 2127)
+++ base/selinux/src/pki.te	(revision 2128)
@@ -1,4 +1,4 @@
-policy_module(pki,1.0.20)
+policy_module(pki,6.2.1)
 
 attribute pki_ca_config;
 attribute pki_ca_executable;
Index: base/common/scripts/functions
===================================================================
--- base/common/scripts/functions	(revision 2127)
+++ base/common/scripts/functions	(revision 2128)
@@ -691,8 +691,16 @@
     fi
 
     # Invoke the initscript for this instance
+    case $PKI_SUBSYSTEM_TYPE in
+        ca|kra|ocsp|tks)
+            /usr/bin/runcon -t pki_${PKI_SUBSYSTEM_TYPE}_script_t $PKI_INSTANCE_INITSCRIPT start
+            rv=$?
+            ;;
+        ra|tps)
     $PKI_INSTANCE_INITSCRIPT start
     rv=$?
+            ;;
+    esac
 
     if [ $rv -ne 0 ] ; then
         return $rv