commit:     9f377595365a60a9d630534e322aa928a4f9c3ea
Author:     Kenton Groombridge <me <AT> concord <DOT> sh>
AuthorDate: Wed Apr 27 05:09:52 2022 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sat Sep  3 18:41:55 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=9f377595

sysnetwork, systemd: allow DNS resolution over io.systemd.Resolve

Signed-off-by: Kenton Groombridge <me <AT> concord.sh>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>

 policy/modules/system/sysnetwork.if |  1 +
 policy/modules/system/systemd.if    | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/policy/modules/system/sysnetwork.if 
b/policy/modules/system/sysnetwork.if
index ad8428f5..464893f6 100644
--- a/policy/modules/system/sysnetwork.if
+++ b/policy/modules/system/sysnetwork.if
@@ -900,6 +900,7 @@ interface(`sysnet_dns_name_resolve',`
        ifdef(`init_systemd',`
                optional_policy(`
                        systemd_dbus_chat_resolved($1)
+                       systemd_stream_connect_resolved($1)
                ')
                # This seems needed when the mymachines NSS module is used
                optional_policy(`

diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
index cab51732..cc942879 100644
--- a/policy/modules/system/systemd.if
+++ b/policy/modules/system/systemd.if
@@ -2319,6 +2319,27 @@ interface(`systemd_tmpfilesd_managed',`
        ')
 ')
 
+#######################################
+## <summary>
+##     Connect to systemd resolved over
+##     /run/systemd/resolve/io.systemd.Resolve .
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`systemd_stream_connect_resolved',`
+       gen_require(`
+               type systemd_resolved_t;
+               type systemd_resolved_runtime_t;
+       ')
+
+       files_search_runtime($1)
+       stream_connect_pattern($1, systemd_resolved_runtime_t, 
systemd_resolved_runtime_t, systemd_resolved_t)
+')
+
 ########################################
 ## <summary>
 ##   Send and receive messages from

Reply via email to