1 |
commit: 1bc42bf81c5adfdbcc4c993e4d279b8e07e81094 |
2 |
Author: Chris PeBenito <chpebeni <AT> linux <DOT> microsoft <DOT> com> |
3 |
AuthorDate: Mon Jun 20 14:54:46 2022 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 3 18:41:55 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=1bc42bf8 |
7 |
|
8 |
mcs: Collapse constraints. |
9 |
|
10 |
Collapse file constraints as they are equivalent due to the same expresssions. |
11 |
|
12 |
Signed-off-by: Chris PeBenito <chpebeni <AT> linux.microsoft.com> |
13 |
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org> |
14 |
|
15 |
policy/mcs | 36 ++++-------------------------------- |
16 |
1 file changed, 4 insertions(+), 32 deletions(-) |
17 |
|
18 |
diff --git a/policy/mcs b/policy/mcs |
19 |
index e8006b11..af880058 100644 |
20 |
--- a/policy/mcs |
21 |
+++ b/policy/mcs |
22 |
@@ -66,27 +66,14 @@ gen_levels(1,mcs_num_cats) |
23 |
# |
24 |
# Note: |
25 |
# - getattr on dirs/files is not constrained. |
26 |
-# - /proc/pid operations are not constrained. |
27 |
|
28 |
-mlsconstrain file { read ioctl lock execute execute_no_trans } |
29 |
+mlsconstrain dir_file_class_set { open read ioctl lock write setattr append create unlink link rename relabelfrom relabelto } |
30 |
(( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
31 |
|
32 |
-mlsconstrain file { write setattr append unlink link rename } |
33 |
+mlsconstrain file { execute execute_no_trans } |
34 |
(( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
35 |
|
36 |
-mlsconstrain dir { search read ioctl lock } |
37 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
38 |
- |
39 |
-mlsconstrain dir { write setattr append unlink link rename add_name remove_name } |
40 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
41 |
- |
42 |
-mlsconstrain fifo_file { open } |
43 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
44 |
- |
45 |
-mlsconstrain { lnk_file chr_file blk_file sock_file } { getattr read ioctl } |
46 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
47 |
- |
48 |
-mlsconstrain { lnk_file chr_file blk_file sock_file } { write setattr } |
49 |
+mlsconstrain dir { search add_name remove_name rmdir } |
50 |
(( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
51 |
|
52 |
# New filesystem object labels must be dominated by the relabeling subject |
53 |
@@ -95,23 +82,8 @@ mlsconstrain { file lnk_file fifo_file } { create relabelto } |
54 |
((( h1 dom h2 ) and ( l2 eq h2 )) or |
55 |
( t1 != mcs_constrained_type )); |
56 |
|
57 |
-# new file labels must be dominated by the relabeling subject clearance |
58 |
-mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { relabelfrom } |
59 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
60 |
- |
61 |
-mlsconstrain { dir file lnk_file chr_file blk_file sock_file fifo_file } { create relabelto } |
62 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
63 |
- |
64 |
-mlsconstrain process { transition dyntransition } |
65 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
66 |
- |
67 |
-mlsconstrain process { ptrace } |
68 |
- (( h1 dom h2) or ( t1 != mcs_constrained_type )); |
69 |
- |
70 |
-mlsconstrain process { sigkill sigstop } |
71 |
- (( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
72 |
|
73 |
-mlsconstrain process { signal } |
74 |
+mlsconstrain process { transition dyntransition ptrace sigkill sigstop signal } |
75 |
(( h1 dom h2 ) or ( t1 != mcs_constrained_type )); |
76 |
|
77 |
mlsconstrain { tcp_socket udp_socket rawip_socket sctp_socket } node_bind |