commit:     090564ca60e3405a73b5c1cea62cbe6a6d5a0eb1
Author:     Kenton Groombridge <me <AT> concord <DOT> sh>
AuthorDate: Sun Nov  7 01:40:44 2021 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Thu Nov 11 21:26:50 2021 +0000
URL:        
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=090564ca

sysadm, systemd: fixes for systemd-networkd

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

 policy/modules/roles/sysadm.te   |  4 ++++
 policy/modules/system/systemd.if | 21 +++++++++++++++++++++
 policy/modules/system/systemd.te |  3 +++
 3 files changed, 28 insertions(+)

diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
index 1a1fddf4..3deec0a8 100644
--- a/policy/modules/roles/sysadm.te
+++ b/policy/modules/roles/sysadm.te
@@ -88,6 +88,10 @@ ifdef(`init_systemd',`
        # Allow sysadm to get the status of and set properties of other users,
        # sessions, and seats on the system.
        systemd_dbus_chat_logind(sysadm_t)
+
+       # Allow sysadm to query and set networking settings on the system.
+       systemd_dbus_chat_networkd(sysadm_t)
+       fs_read_nsfs_files(sysadm_t)
 ')
 
 tunable_policy(`allow_ptrace',`

diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
index e5742254..a493f7dc 100644
--- a/policy/modules/system/systemd.if
+++ b/policy/modules/system/systemd.if
@@ -1425,6 +1425,27 @@ interface(`systemd_startstop_networkd',`
        allow $1 systemd_networkd_unit_t:service { start stop };
 ')
 
+########################################
+## <summary>
+##   Send and receive messages from
+##   systemd networkd over dbus.
+## </summary>
+## <param name="domain">
+##     <summary>
+##     Domain allowed access.
+##     </summary>
+## </param>
+#
+interface(`systemd_dbus_chat_networkd',`
+       gen_require(`
+               type systemd_networkd_t;
+               class dbus send_msg;
+       ')
+
+       allow $1 systemd_networkd_t:dbus send_msg;
+       allow systemd_networkd_t $1:dbus send_msg;
+')
+
 ########################################
 ## <summary>
 ##     Allow specified domain to get status of systemd-networkd

diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
index 0f811c77..1e7511b9 100644
--- a/policy/modules/system/systemd.te
+++ b/policy/modules/system/systemd.te
@@ -914,6 +914,9 @@ files_watch_runtime_dirs(systemd_networkd_t)
 files_watch_root_dirs(systemd_networkd_t)
 files_list_runtime(systemd_networkd_t)
 fs_getattr_xattr_fs(systemd_networkd_t)
+fs_getattr_cgroup(systemd_networkd_t)
+fs_search_cgroup_dirs(systemd_networkd_t)
+fs_read_nsfs_files(systemd_networkd_t)
 
 auth_use_nsswitch(systemd_networkd_t)
 

Reply via email to