1 |
commit: 38249e1e570984cbc60f21a12e0323a2e852a463 |
2 |
Author: Kenton Groombridge <me <AT> concord <DOT> sh> |
3 |
AuthorDate: Tue Feb 2 15:52:59 2021 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 6 21:15:09 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=38249e1e |
7 |
|
8 |
Various fixes |
9 |
|
10 |
Allow dovecot to watch the mail spool, and add various dontaudit rules |
11 |
for several other domains. |
12 |
|
13 |
Signed-off-by: Kenton Groombridge <me <AT> concord.sh> |
14 |
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org> |
15 |
|
16 |
policy/modules/kernel/kernel.if | 18 ++++++++++++++++++ |
17 |
policy/modules/services/dovecot.te | 3 +++ |
18 |
policy/modules/services/mta.if | 18 ++++++++++++++++++ |
19 |
policy/modules/services/ssh.te | 2 ++ |
20 |
policy/modules/system/authlogin.te | 3 +++ |
21 |
policy/modules/system/selinuxutil.te | 1 + |
22 |
6 files changed, 45 insertions(+) |
23 |
|
24 |
diff --git a/policy/modules/kernel/kernel.if b/policy/modules/kernel/kernel.if |
25 |
index 5869eb50..ebd73aca 100644 |
26 |
--- a/policy/modules/kernel/kernel.if |
27 |
+++ b/policy/modules/kernel/kernel.if |
28 |
@@ -910,6 +910,24 @@ interface(`kernel_getattr_proc',` |
29 |
allow $1 proc_t:filesystem getattr; |
30 |
') |
31 |
|
32 |
+######################################## |
33 |
+## <summary> |
34 |
+## Do not audit attempts to get the attributes of the proc filesystem. |
35 |
+## </summary> |
36 |
+## <param name="domain"> |
37 |
+## <summary> |
38 |
+## Domain to not audit. |
39 |
+## </summary> |
40 |
+## </param> |
41 |
+# |
42 |
+interface(`kernel_dontaudit_getattr_proc',` |
43 |
+ gen_require(` |
44 |
+ type proc_t; |
45 |
+ ') |
46 |
+ |
47 |
+ dontaudit $1 proc_t:filesystem getattr; |
48 |
+') |
49 |
+ |
50 |
######################################## |
51 |
## <summary> |
52 |
## Mount on proc directories. |
53 |
|
54 |
diff --git a/policy/modules/services/dovecot.te b/policy/modules/services/dovecot.te |
55 |
index a2d1cc5e..16fa4e52 100644 |
56 |
--- a/policy/modules/services/dovecot.te |
57 |
+++ b/policy/modules/services/dovecot.te |
58 |
@@ -207,6 +207,7 @@ optional_policy(` |
59 |
|
60 |
optional_policy(` |
61 |
mta_manage_spool(dovecot_t) |
62 |
+ mta_watch_spool(dovecot_t) |
63 |
mta_manage_mail_home_rw_content(dovecot_t) |
64 |
mta_home_filetrans_mail_home_rw(dovecot_t, dir, "Maildir") |
65 |
mta_home_filetrans_mail_home_rw(dovecot_t, dir, ".maildir") |
66 |
@@ -255,6 +256,8 @@ manage_sock_files_pattern(dovecot_auth_t, dovecot_runtime_t, dovecot_runtime_t) |
67 |
|
68 |
allow dovecot_auth_t dovecot_t:unix_stream_socket { connectto rw_stream_socket_perms }; |
69 |
|
70 |
+kernel_dontaudit_getattr_proc(dovecot_auth_t) |
71 |
+ |
72 |
files_search_runtime(dovecot_auth_t) |
73 |
files_read_usr_files(dovecot_auth_t) |
74 |
files_read_var_lib_files(dovecot_auth_t) |
75 |
|
76 |
diff --git a/policy/modules/services/mta.if b/policy/modules/services/mta.if |
77 |
index 7039a7f0..5266d52c 100644 |
78 |
--- a/policy/modules/services/mta.if |
79 |
+++ b/policy/modules/services/mta.if |
80 |
@@ -991,6 +991,24 @@ interface(`mta_manage_spool',` |
81 |
manage_lnk_files_pattern($1, mail_spool_t, mail_spool_t) |
82 |
') |
83 |
|
84 |
+######################################## |
85 |
+## <summary> |
86 |
+## Watch mail spool content. |
87 |
+## </summary> |
88 |
+## <param name="domain"> |
89 |
+## <summary> |
90 |
+## Domain allowed access. |
91 |
+## </summary> |
92 |
+## </param> |
93 |
+# |
94 |
+interface(`mta_watch_spool',` |
95 |
+ gen_require(` |
96 |
+ type mail_spool_t; |
97 |
+ ') |
98 |
+ |
99 |
+ allow $1 mail_spool_t:{ dir file } watch; |
100 |
+') |
101 |
+ |
102 |
####################################### |
103 |
## <summary> |
104 |
## Create specified objects in the |
105 |
|
106 |
diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te |
107 |
index 16e86fbf..63a0d824 100644 |
108 |
--- a/policy/modules/services/ssh.te |
109 |
+++ b/policy/modules/services/ssh.te |
110 |
@@ -262,6 +262,8 @@ corenet_sendrecv_xserver_server_packets(sshd_t) |
111 |
ifdef(`distro_debian',` |
112 |
allow sshd_t self:process { getcap setcap }; |
113 |
auth_use_pam_motd_dynamic(sshd_t) |
114 |
+',` |
115 |
+ dontaudit sshd_t self:process { getcap setcap }; |
116 |
') |
117 |
|
118 |
ifdef(`init_systemd',` |
119 |
|
120 |
diff --git a/policy/modules/system/authlogin.te b/policy/modules/system/authlogin.te |
121 |
index 96ebfa27..f5da5048 100644 |
122 |
--- a/policy/modules/system/authlogin.te |
123 |
+++ b/policy/modules/system/authlogin.te |
124 |
@@ -104,6 +104,9 @@ allow chkpwd_t shadow_t:file read_file_perms; |
125 |
files_list_etc(chkpwd_t) |
126 |
|
127 |
kernel_read_crypto_sysctls(chkpwd_t) |
128 |
+kernel_dontaudit_search_kernel_sysctl(chkpwd_t) |
129 |
+kernel_dontaudit_read_kernel_sysctl(chkpwd_t) |
130 |
+kernel_dontaudit_getattr_proc(chkpwd_t) |
131 |
|
132 |
domain_dontaudit_use_interactive_fds(chkpwd_t) |
133 |
|
134 |
|
135 |
diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te |
136 |
index 560e6c8a..ec65eb88 100644 |
137 |
--- a/policy/modules/system/selinuxutil.te |
138 |
+++ b/policy/modules/system/selinuxutil.te |
139 |
@@ -500,6 +500,7 @@ files_tmp_filetrans(semanage_t, semanage_tmp_t, { file dir }) |
140 |
|
141 |
kernel_read_system_state(semanage_t) |
142 |
kernel_read_kernel_sysctls(semanage_t) |
143 |
+kernel_dontaudit_getattr_proc(semanage_t) |
144 |
|
145 |
corecmd_exec_bin(semanage_t) |
146 |
corecmd_exec_shell(semanage_t) |