1 |
commit: 9f377595365a60a9d630534e322aa928a4f9c3ea |
2 |
Author: Kenton Groombridge <me <AT> concord <DOT> sh> |
3 |
AuthorDate: Wed Apr 27 05:09:52 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=9f377595 |
7 |
|
8 |
sysnetwork, systemd: allow DNS resolution over io.systemd.Resolve |
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/system/sysnetwork.if | 1 + |
14 |
policy/modules/system/systemd.if | 21 +++++++++++++++++++++ |
15 |
2 files changed, 22 insertions(+) |
16 |
|
17 |
diff --git a/policy/modules/system/sysnetwork.if b/policy/modules/system/sysnetwork.if |
18 |
index ad8428f5..464893f6 100644 |
19 |
--- a/policy/modules/system/sysnetwork.if |
20 |
+++ b/policy/modules/system/sysnetwork.if |
21 |
@@ -900,6 +900,7 @@ interface(`sysnet_dns_name_resolve',` |
22 |
ifdef(`init_systemd',` |
23 |
optional_policy(` |
24 |
systemd_dbus_chat_resolved($1) |
25 |
+ systemd_stream_connect_resolved($1) |
26 |
') |
27 |
# This seems needed when the mymachines NSS module is used |
28 |
optional_policy(` |
29 |
|
30 |
diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if |
31 |
index cab51732..cc942879 100644 |
32 |
--- a/policy/modules/system/systemd.if |
33 |
+++ b/policy/modules/system/systemd.if |
34 |
@@ -2319,6 +2319,27 @@ interface(`systemd_tmpfilesd_managed',` |
35 |
') |
36 |
') |
37 |
|
38 |
+####################################### |
39 |
+## <summary> |
40 |
+## Connect to systemd resolved over |
41 |
+## /run/systemd/resolve/io.systemd.Resolve . |
42 |
+## </summary> |
43 |
+## <param name="domain"> |
44 |
+## <summary> |
45 |
+## Domain allowed access. |
46 |
+## </summary> |
47 |
+## </param> |
48 |
+# |
49 |
+interface(`systemd_stream_connect_resolved',` |
50 |
+ gen_require(` |
51 |
+ type systemd_resolved_t; |
52 |
+ type systemd_resolved_runtime_t; |
53 |
+ ') |
54 |
+ |
55 |
+ files_search_runtime($1) |
56 |
+ stream_connect_pattern($1, systemd_resolved_runtime_t, systemd_resolved_runtime_t, systemd_resolved_t) |
57 |
+') |
58 |
+ |
59 |
######################################## |
60 |
## <summary> |
61 |
## Send and receive messages from |