1 |
commit: 4dedda31c2025ccde5ee8ce2500648d786f28d89 |
2 |
Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
3 |
AuthorDate: Sun Oct 28 17:52:18 2012 +0000 |
4 |
Commit: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
5 |
CommitDate: Sun Oct 28 17:52:18 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=4dedda31 |
7 |
|
8 |
Keep file contexts local |
9 |
|
10 |
Unlike what is used in refpolicy, I think it is much cleaner if file contexts |
11 |
related to the application the module reflects are within the file context file. |
12 |
This does mean that "elsewhere" defined types must be accepted in the context, |
13 |
but as long as these types are part of the base install (or as a depending |
14 |
module without optional_policy() statement) this should be okay. |
15 |
|
16 |
One main advantage to this - beyond clarity - is that the contexts file on a |
17 |
users' system will not contain paths for files that are of applications he |
18 |
doesn't have. |
19 |
|
20 |
Doing this for a few shorewall contexts for now, will update as these come |
21 |
along. |
22 |
|
23 |
--- |
24 |
policy/modules/contrib/shorewall.fc | 5 +++++ |
25 |
policy/modules/kernel/corecommands.fc | 6 ------ |
26 |
2 files changed, 5 insertions(+), 6 deletions(-) |
27 |
|
28 |
diff --git a/policy/modules/contrib/shorewall.fc b/policy/modules/contrib/shorewall.fc |
29 |
index 341bd25..daf852d 100644 |
30 |
--- a/policy/modules/contrib/shorewall.fc |
31 |
+++ b/policy/modules/contrib/shorewall.fc |
32 |
@@ -20,6 +20,11 @@ |
33 |
|
34 |
ifdef(`distro_gentoo',` |
35 |
/usr/share/shorewall/compiler\.pl -- gen_context(system_u:object_r:bin_t,s0) |
36 |
+/usr/share/shorewall/configpath -- gen_context(system_u:object_r:bin_t,s0) |
37 |
/usr/share/shorewall/getparams -- gen_context(system_u:object_r:bin_t,s0) |
38 |
/usr/share/shorewall/wait4ifup -- gen_context(system_u:object_r:bin_t,s0) |
39 |
+/usr/share/shorewall-perl(/.*)? gen_context(system_u:object_r:bin_t,s0) |
40 |
+/usr/share/shorewall-shell(/.*)? gen_context(system_u:object_r:bin_t,s0) |
41 |
+/usr/share/shorewall-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) |
42 |
+/usr/share/shorewall6-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) |
43 |
') |
44 |
|
45 |
diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc |
46 |
index 57fd2ed..de94bd0 100644 |
47 |
--- a/policy/modules/kernel/corecommands.fc |
48 |
+++ b/policy/modules/kernel/corecommands.fc |
49 |
@@ -309,12 +309,6 @@ ifdef(`distro_gentoo',` |
50 |
/usr/share/sectool/.*\.py -- gen_context(system_u:object_r:bin_t,s0) |
51 |
/usr/share/selinux/devel/policygentool -- gen_context(system_u:object_r:bin_t,s0) |
52 |
/usr/share/smolt/client(/.*)? gen_context(system_u:object_r:bin_t,s0) |
53 |
-/usr/share/shorewall/compiler\.pl -- gen_context(system_u:object_r:bin_t,s0) |
54 |
-/usr/share/shorewall/configpath -- gen_context(system_u:object_r:bin_t,s0) |
55 |
-/usr/share/shorewall-perl(/.*)? gen_context(system_u:object_r:bin_t,s0) |
56 |
-/usr/share/shorewall-shell(/.*)? gen_context(system_u:object_r:bin_t,s0) |
57 |
-/usr/share/shorewall-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) |
58 |
-/usr/share/shorewall6-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) |
59 |
/usr/share/spamassassin/sa-update\.cron gen_context(system_u:object_r:bin_t,s0) |
60 |
/usr/share/texmf/web2c/mktexdir -- gen_context(system_u:object_r:bin_t,s0) |
61 |
/usr/share/turboprint/lib(/.*)? -- gen_context(system_u:object_r:bin_t,s0) |