1 |
commit: 79b0ec7e2d66dadd3570e99801632ac32cfe0147 |
2 |
Author: Kenton Groombridge <me <AT> concord <DOT> sh> |
3 |
AuthorDate: Sat Dec 4 18:43:43 2021 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 30 01:12:42 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=79b0ec7e |
7 |
|
8 |
container, iptables: dontaudit iptables rw on /ptmx |
9 |
|
10 |
Signed-off-by: Kenton Groombridge <me <AT> concord.sh> |
11 |
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org> |
12 |
|
13 |
policy/modules/services/container.if | 19 +++++++++++++++++++ |
14 |
policy/modules/system/iptables.te | 5 +++++ |
15 |
2 files changed, 24 insertions(+) |
16 |
|
17 |
diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if |
18 |
index d7ad3e84..92b5a2f7 100644 |
19 |
--- a/policy/modules/services/container.if |
20 |
+++ b/policy/modules/services/container.if |
21 |
@@ -611,6 +611,25 @@ interface(`container_manage_sock_files',` |
22 |
manage_sock_files_pattern($1, container_file_t, container_file_t) |
23 |
') |
24 |
|
25 |
+######################################## |
26 |
+## <summary> |
27 |
+## Do not audit attempts to read |
28 |
+## and write container chr files. |
29 |
+## </summary> |
30 |
+## <param name="domain"> |
31 |
+## <summary> |
32 |
+## Domain allowed access. |
33 |
+## </summary> |
34 |
+## </param> |
35 |
+# |
36 |
+interface(`container_dontaudit_rw_chr_files',` |
37 |
+ gen_require(` |
38 |
+ type container_file_t; |
39 |
+ ') |
40 |
+ |
41 |
+ dontaudit $1 container_file_t:chr_file rw_chr_file_perms; |
42 |
+') |
43 |
+ |
44 |
######################################## |
45 |
## <summary> |
46 |
## Allow the specified domain to |
47 |
|
48 |
diff --git a/policy/modules/system/iptables.te b/policy/modules/system/iptables.te |
49 |
index f61b8af1..39ce924d 100644 |
50 |
--- a/policy/modules/system/iptables.te |
51 |
+++ b/policy/modules/system/iptables.te |
52 |
@@ -105,6 +105,11 @@ ifdef(`hide_broken_symptoms',` |
53 |
dev_dontaudit_write_mtrr(iptables_t) |
54 |
') |
55 |
|
56 |
+optional_policy(` |
57 |
+ # iptables may try to rw /ptmx in a container |
58 |
+ container_dontaudit_rw_chr_files(iptables_t) |
59 |
+') |
60 |
+ |
61 |
optional_policy(` |
62 |
fail2ban_append_log(iptables_t) |
63 |
') |