aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Sugar <dsugar@tresys.com>2018-06-06 10:25:07 -0400
committerJason Zaman <jason@perfinion.com>2018-06-08 17:21:01 +0800
commit3f528d57501507ca95e24e88e0c29c36bd216bef (patch)
treee2b16f02bcc0abfa87206893bc2d0649b8e326a1
parentAllow systemd-resolved to read sysctl (diff)
downloadhardened-refpolicy-3f528d57501507ca95e24e88e0c29c36bd216bef.tar.gz
hardened-refpolicy-3f528d57501507ca95e24e88e0c29c36bd216bef.tar.bz2
hardened-refpolicy-3f528d57501507ca95e24e88e0c29c36bd216bef.zip
Allow systemd_resolved to read systemd_networkd runtime files
type=AVC msg=audit(1527698299.999:144): avc: denied { read } for pid=1193 comm="systemd-resolve" name="links" dev="tmpfs" ino=16229 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=dir type=AVC msg=audit(1527698299.999:145): avc: denied { read } for pid=1193 comm="systemd-resolve" name="3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527698299.999:145): avc: denied { open } for pid=1193 comm="systemd-resolve" path="/run/systemd/netif/links/3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527698300.000:146): avc: denied { getattr } for pid=1193 comm="systemd-resolve" path="/run/systemd/netif/links/3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527702014.276:183): avc: denied { search } for pid=1180 comm="systemd-resolve" name="netif" dev="tmpfs" ino=16878 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=dir type=AVC msg=audit(1527704163.181:152): avc: denied { open } for pid=1236 comm="systemd-resolve" path="/run/systemd/netif/links/5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527704163.181:153): avc: denied { getattr } for pid=1236 comm="systemd-resolve" path="/run/systemd/netif/links/5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527704163.604:173): avc: denied { read } for pid=1236 comm="systemd-resolve" name="5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file Signed-off-by: Dave Sugar <dsugar@tresys.com>
-rw-r--r--policy/modules/system/systemd.if19
-rw-r--r--policy/modules/system/systemd.te1
2 files changed, 20 insertions, 0 deletions
diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
index 866838fe..b053242a 100644
--- a/policy/modules/system/systemd.if
+++ b/policy/modules/system/systemd.if
@@ -523,6 +523,25 @@ interface(`systemd_rw_networkd_netlink_route_sockets',`
allow $1 systemd_networkd_t:netlink_route_socket client_stream_socket_perms;
')
+#######################################
+## <summary>
+## Allow domain to read files generated by systemd_networkd
+## </summary>
+## <param name="domain">
+## <summary>
+## domain allowed access
+## </summary>
+## </param>
+#
+
+interface(`systemd_read_networkd_runtime',`
+ gen_require(`
+ type systemd_networkd_var_run_t;
+ ')
+
+ list_dirs_pattern($1, systemd_networkd_var_run_t, systemd_networkd_var_run_t)
+ read_files_pattern($1, systemd_networkd_var_run_t, systemd_networkd_var_run_t)
+')
########################################
## <summary>
diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
index 708b9f23..79774dd3 100644
--- a/policy/modules/system/systemd.te
+++ b/policy/modules/system/systemd.te
@@ -858,6 +858,7 @@ auth_use_nsswitch(systemd_resolved_t)
seutil_read_file_contexts(systemd_resolved_t)
systemd_log_parse_environment(systemd_resolved_t)
+systemd_read_networkd_runtime(systemd_resolved_t)
optional_policy(`
dbus_system_bus_client(systemd_resolved_t)