1 |
commit: f65b4a5c66cee88e554361b57195a47e21b90d9d |
2 |
Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
3 |
AuthorDate: Sat Nov 22 18:04:38 2014 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 22 18:04:38 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=f65b4a5c |
7 |
|
8 |
Reshuffle to better match upstream |
9 |
|
10 |
--- |
11 |
policy/modules/kernel/files.if | 285 ++++++++++++++++++++--------------------- |
12 |
1 file changed, 142 insertions(+), 143 deletions(-) |
13 |
|
14 |
diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if |
15 |
index fd1f8e9..dd16f74 100644 |
16 |
--- a/policy/modules/kernel/files.if |
17 |
+++ b/policy/modules/kernel/files.if |
18 |
@@ -1450,7 +1450,6 @@ interface(`files_relabel_non_auth_files',` |
19 |
# to allow files_relabel_non_auth_files to be an optional setting (tunable). |
20 |
') |
21 |
|
22 |
- |
23 |
############################################# |
24 |
## <summary> |
25 |
## Manage all configuration directories on filesystem |
26 |
@@ -1604,6 +1603,24 @@ interface(`files_setattr_all_mountpoints',` |
27 |
|
28 |
######################################## |
29 |
## <summary> |
30 |
+## Do not audit attempts to set the attributes on all mount points. |
31 |
+## </summary> |
32 |
+## <param name="domain"> |
33 |
+## <summary> |
34 |
+## Domain to not audit. |
35 |
+## </summary> |
36 |
+## </param> |
37 |
+# |
38 |
+interface(`files_dontaudit_setattr_all_mountpoints',` |
39 |
+ gen_require(` |
40 |
+ attribute mountpoint; |
41 |
+ ') |
42 |
+ |
43 |
+ dontaudit $1 mountpoint:dir setattr; |
44 |
+') |
45 |
+ |
46 |
+######################################## |
47 |
+## <summary> |
48 |
## Search all mount points. |
49 |
## </summary> |
50 |
## <param name="domain"> |
51 |
@@ -1676,11 +1693,11 @@ interface(`files_dontaudit_list_all_mountpoints',` |
52 |
|
53 |
######################################## |
54 |
## <summary> |
55 |
-## Do not audit write attempts on mount points. |
56 |
+## Do not audit attempts to write to mount points. |
57 |
## </summary> |
58 |
## <param name="domain"> |
59 |
## <summary> |
60 |
-## Domain to ignore write attempts from |
61 |
+## Domain to not audit. |
62 |
## </summary> |
63 |
## </param> |
64 |
# |
65 |
@@ -1694,24 +1711,6 @@ interface(`files_dontaudit_write_all_mountpoints',` |
66 |
|
67 |
######################################## |
68 |
## <summary> |
69 |
-## Do not audit setattr attempts on mount points. |
70 |
-## </summary> |
71 |
-## <param name="domain"> |
72 |
-## <summary> |
73 |
-## Domain to ignore setattr attempts from |
74 |
-## </summary> |
75 |
-## </param> |
76 |
-# |
77 |
-interface(`files_dontaudit_setattr_all_mountpoints',` |
78 |
- gen_require(` |
79 |
- attribute mountpoint; |
80 |
- ') |
81 |
- |
82 |
- dontaudit $1 mountpoint:dir setattr; |
83 |
-') |
84 |
- |
85 |
-######################################## |
86 |
-## <summary> |
87 |
## List the contents of the root directory. |
88 |
## </summary> |
89 |
## <param name="domain"> |
90 |
@@ -2669,25 +2668,6 @@ interface(`files_manage_etc_dirs',` |
91 |
|
92 |
######################################## |
93 |
## <summary> |
94 |
-## Do not audit attempts to read files |
95 |
-## in /etc |
96 |
-## </summary> |
97 |
-## <param name="domain"> |
98 |
-## <summary> |
99 |
-## Domain to not audit. |
100 |
-## </summary> |
101 |
-## </param> |
102 |
-# |
103 |
-interface(`files_dontaudit_read_etc_files',` |
104 |
- gen_require(` |
105 |
- type etc_t; |
106 |
- ') |
107 |
- |
108 |
- dontaudit $1 etc_t:file { getattr read }; |
109 |
-') |
110 |
- |
111 |
-######################################## |
112 |
-## <summary> |
113 |
## Read generic files in /etc. |
114 |
## </summary> |
115 |
## <desc> |
116 |
@@ -3003,24 +2983,6 @@ interface(`files_dontaudit_setattr_etc_runtime_files',` |
117 |
|
118 |
######################################## |
119 |
## <summary> |
120 |
-## Do not audit attempts to read etc_runtime resources |
121 |
-## </summary> |
122 |
-## <param name="domain"> |
123 |
-## <summary> |
124 |
-## Domain allowed access. |
125 |
-## </summary> |
126 |
-## </param> |
127 |
-# |
128 |
-interface(`files_dontaudit_read_etc_runtime',` |
129 |
- gen_require(` |
130 |
- type etc_runtime_t; |
131 |
- ') |
132 |
- |
133 |
- dontaudit $1 etc_runtime_t:file read_file_perms; |
134 |
-') |
135 |
- |
136 |
-######################################## |
137 |
-## <summary> |
138 |
## Read files in /etc that are dynamically |
139 |
## created on boot, such as mtab. |
140 |
## </summary> |
141 |
@@ -3142,26 +3104,6 @@ interface(`files_manage_etc_runtime_files',` |
142 |
|
143 |
######################################## |
144 |
## <summary> |
145 |
-## Create, read, write, and delete symbolic links in |
146 |
-## /etc that are dynamically created on boot. |
147 |
-## </summary> |
148 |
-## <param name="domain"> |
149 |
-## <summary> |
150 |
-## Domain allowed access. |
151 |
-## </summary> |
152 |
-## </param> |
153 |
-## <rolecap/> |
154 |
-# |
155 |
-interface(`files_manage_etc_runtime_lnk_files',` |
156 |
- gen_require(` |
157 |
- type etc_t, etc_runtime_t; |
158 |
- ') |
159 |
- |
160 |
- manage_lnk_files_pattern($1, { etc_t etc_runtime_t }, etc_runtime_t) |
161 |
-') |
162 |
- |
163 |
-######################################## |
164 |
-## <summary> |
165 |
## Create, etc runtime objects with an automatic |
166 |
## type transition. |
167 |
## </summary> |
168 |
@@ -5660,6 +5602,24 @@ interface(`files_manage_mounttab',` |
169 |
|
170 |
######################################## |
171 |
## <summary> |
172 |
+## Set the attributes of the generic lock directories. |
173 |
+## </summary> |
174 |
+## <param name="domain"> |
175 |
+## <summary> |
176 |
+## Domain allowed access. |
177 |
+## </summary> |
178 |
+## </param> |
179 |
+# |
180 |
+interface(`files_setattr_lock_dirs',` |
181 |
+ gen_require(` |
182 |
+ type var_t, var_lock_t; |
183 |
+ ') |
184 |
+ |
185 |
+ setattr_dirs_pattern($1, var_t, var_lock_t) |
186 |
+') |
187 |
+ |
188 |
+######################################## |
189 |
+## <summary> |
190 |
## Search the locks directory (/var/lock). |
191 |
## </summary> |
192 |
## <param name="domain"> |
193 |
@@ -5738,11 +5698,11 @@ interface(`files_rw_lock_dirs',` |
194 |
|
195 |
######################################## |
196 |
## <summary> |
197 |
-## Create lock directories. |
198 |
+## Create lock directories |
199 |
## </summary> |
200 |
## <param name="domain"> |
201 |
-## <summary> |
202 |
-## Domain allowed access. |
203 |
+## <summary> |
204 |
+## Domain allowed access |
205 |
## </summary> |
206 |
## </param> |
207 |
# |
208 |
@@ -5756,7 +5716,6 @@ interface(`files_create_lock_dirs',` |
209 |
create_dirs_pattern($1, var_lock_t, var_lock_t) |
210 |
') |
211 |
|
212 |
- |
213 |
######################################## |
214 |
## <summary> |
215 |
## Relabel to and from all lock directory types. |
216 |
@@ -5802,24 +5761,6 @@ interface(`files_getattr_generic_locks',` |
217 |
|
218 |
######################################## |
219 |
## <summary> |
220 |
-## Set the attributes of generic lock directories |
221 |
-## </summary> |
222 |
-## <param name="domain"> |
223 |
-## <summary> |
224 |
-## Domain allowed access. |
225 |
-## </summary> |
226 |
-## </param> |
227 |
-# |
228 |
-interface(`files_setattr_lock_dirs',` |
229 |
- gen_require(` |
230 |
- type var_t, var_lock_t; |
231 |
- ') |
232 |
- |
233 |
- setattr_dirs_pattern($1, var_t, var_lock_t) |
234 |
-') |
235 |
- |
236 |
-######################################## |
237 |
-## <summary> |
238 |
## Delete generic lock files. |
239 |
## </summary> |
240 |
## <param name="domain"> |
241 |
@@ -6101,29 +6042,6 @@ interface(`files_write_generic_pid_pipes',` |
242 |
allow $1 var_run_t:lnk_file read_lnk_file_perms; |
243 |
allow $1 var_run_t:fifo_file write; |
244 |
') |
245 |
-######################################## |
246 |
-## <summary> |
247 |
-## Write dirs in /var/run with the lock file type |
248 |
-## </summary> |
249 |
-## <param name="domain"> |
250 |
-## <summary> |
251 |
-## Domain allowed access. |
252 |
-## </summary> |
253 |
-## </param> |
254 |
-## <param name="name" optional="true"> |
255 |
-## <summary> |
256 |
-## Name of the directory that the file transition will work on |
257 |
-## </summary> |
258 |
-## </param> |
259 |
-# |
260 |
-interface(`files_pid_filetrans_lock_dir',` |
261 |
- gen_require(` |
262 |
- type var_t, var_run_t; |
263 |
- ') |
264 |
- |
265 |
- files_pid_filetrans($1, var_lock_t, dir, $2) |
266 |
-') |
267 |
- |
268 |
|
269 |
######################################## |
270 |
## <summary> |
271 |
@@ -6189,6 +6107,29 @@ interface(`files_pid_filetrans',` |
272 |
|
273 |
######################################## |
274 |
## <summary> |
275 |
+## Create a generic lock directory within the run directories |
276 |
+## </summary> |
277 |
+## <param name="domain"> |
278 |
+## <summary> |
279 |
+## Domain allowed access |
280 |
+## </summary> |
281 |
+## </param> |
282 |
+## <param name="name" optional="true"> |
283 |
+## <summary> |
284 |
+## The name of the object being created. |
285 |
+## </summary> |
286 |
+## </param> |
287 |
+# |
288 |
+interface(`files_pid_filetrans_lock_dir',` |
289 |
+ gen_require(` |
290 |
+ type var_lock_t; |
291 |
+ ') |
292 |
+ |
293 |
+ files_pid_filetrans($1, var_lock_t, dir, $2) |
294 |
+') |
295 |
+ |
296 |
+######################################## |
297 |
+## <summary> |
298 |
## Read and write generic process ID files. |
299 |
## </summary> |
300 |
## <param name="domain"> |
301 |
@@ -6291,26 +6232,6 @@ interface(`files_read_all_pids',` |
302 |
|
303 |
######################################## |
304 |
## <summary> |
305 |
-## Create PID directories. |
306 |
-## </summary> |
307 |
-## <param name="domain"> |
308 |
-## <summary> |
309 |
-## Domain allowed access. |
310 |
-## </summary> |
311 |
-## </param> |
312 |
-# |
313 |
-interface(`files_create_pid_dirs',` |
314 |
- gen_require(` |
315 |
- type var_t, var_run_t; |
316 |
- ') |
317 |
- |
318 |
- allow $1 var_t:dir search_dir_perms; |
319 |
- allow $1 var_run_t:lnk_file read_lnk_file_perms; |
320 |
- create_dirs_pattern($1, var_run_t, var_run_t) |
321 |
-') |
322 |
- |
323 |
-######################################## |
324 |
-## <summary> |
325 |
## Delete all process IDs. |
326 |
## </summary> |
327 |
## <param name="domain"> |
328 |
@@ -6623,6 +6544,84 @@ interface(`files_unconfined',` |
329 |
|
330 |
# should be in an ifdef distro_gentoo but cannot do so for interfaces |
331 |
|
332 |
+######################################## |
333 |
+## <summary> |
334 |
+## Create PID directories. |
335 |
+## </summary> |
336 |
+## <param name="domain"> |
337 |
+## <summary> |
338 |
+## Domain allowed access. |
339 |
+## </summary> |
340 |
+## </param> |
341 |
+# |
342 |
+interface(`files_create_pid_dirs',` |
343 |
+ gen_require(` |
344 |
+ type var_t, var_run_t; |
345 |
+ ') |
346 |
+ |
347 |
+ allow $1 var_t:dir search_dir_perms; |
348 |
+ allow $1 var_run_t:lnk_file read_lnk_file_perms; |
349 |
+ create_dirs_pattern($1, var_run_t, var_run_t) |
350 |
+') |
351 |
+ |
352 |
+######################################## |
353 |
+## <summary> |
354 |
+## Create, read, write, and delete symbolic links in |
355 |
+## /etc that are dynamically created on boot. |
356 |
+## </summary> |
357 |
+## <param name="domain"> |
358 |
+## <summary> |
359 |
+## Domain allowed access. |
360 |
+## </summary> |
361 |
+## </param> |
362 |
+## <rolecap/> |
363 |
+# |
364 |
+interface(`files_manage_etc_runtime_lnk_files',` |
365 |
+ gen_require(` |
366 |
+ type etc_t, etc_runtime_t; |
367 |
+ ') |
368 |
+ |
369 |
+ manage_lnk_files_pattern($1, { etc_t etc_runtime_t }, etc_runtime_t) |
370 |
+') |
371 |
+ |
372 |
+######################################## |
373 |
+## <summary> |
374 |
+## Do not audit attempts to read etc_runtime resources |
375 |
+## </summary> |
376 |
+## <param name="domain"> |
377 |
+## <summary> |
378 |
+## Domain allowed access. |
379 |
+## </summary> |
380 |
+## </param> |
381 |
+# |
382 |
+interface(`files_dontaudit_read_etc_runtime',` |
383 |
+ gen_require(` |
384 |
+ type etc_runtime_t; |
385 |
+ ') |
386 |
+ |
387 |
+ dontaudit $1 etc_runtime_t:file read_file_perms; |
388 |
+') |
389 |
+ |
390 |
+######################################## |
391 |
+## <summary> |
392 |
+## Do not audit attempts to read files |
393 |
+## in /etc |
394 |
+## </summary> |
395 |
+## <param name="domain"> |
396 |
+## <summary> |
397 |
+## Domain to not audit. |
398 |
+## </summary> |
399 |
+## </param> |
400 |
+# |
401 |
+interface(`files_dontaudit_read_etc_files',` |
402 |
+ gen_require(` |
403 |
+ type etc_t; |
404 |
+ ') |
405 |
+ |
406 |
+ dontaudit $1 etc_t:file { getattr read }; |
407 |
+') |
408 |
+ |
409 |
+ |
410 |
######################################### |
411 |
## <summary> |
412 |
## List usr/src files |