From 2ce9c1574e77cfedf075413013b6247ff0e7f8ce Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Thu, 22 Feb 2024 18:00:49 +0100 Subject: systemd: generator updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type=1400 audit(1708552475.580:3): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/etc/init.d/auditd" dev="vda1" ino=262124 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:auditd_initrc_exec_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.580:4): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/usr/lib/systemd/system/auditd.service" dev="vda1" ino=395421 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:auditd_unit_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.580:5): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/etc/init.d/vnstat" dev="vda1" ino=261247 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:vnstatd_initrc_exec_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.580:6): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/usr/lib/systemd/system/vnstat.service" dev="vda1" ino=394196 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:vnstatd_unit_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.580:7): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/usr/lib/systemd/system/dbus-broker.service" dev="vda1" ino=394383 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:dbusd_unit_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.584:8): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/usr/lib/systemd/system/qemu-guest-agent.service" dev="vda1" ino=392981 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:qemu_unit_t:s0 tclass=file permissive=1 type=1400 audit(1708552475.584:9): avc: denied { getattr } for pid=528 comm="systemd-sysv-ge" path="/usr/lib/systemd/system/ssh.service" dev="vda1" ino=393521 scontext=system_u:system_r:systemd_generator_t:s0 tcontext=system_u:object_r:sshd_unit_t:s0 tclass=file permissive=1 Signed-off-by: Christian Göttsche Signed-off-by: Kenton Groombridge --- policy/modules/system/init.if | 20 ++++++++++++++++++++ policy/modules/system/systemd.te | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 3e4192eb..597fd169 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -3858,6 +3858,26 @@ interface(`init_list_all_units',` read_lnk_files_pattern($1, systemdunit, systemdunit) ') +######################################## +## +## Get the attributes of systemd unit directories and the files in them. +## +## +## +## Domain allowed access. +## +## +# +interface(`init_getattr_all_unit_files',` + gen_require(` + attribute systemdunit; + ') + + list_dirs_pattern($1, systemdunit, systemdunit) + getattr_files_pattern($1, systemdunit, systemdunit) + read_lnk_files_pattern($1, systemdunit, systemdunit) +') + ######################################## ## ## Manage systemd unit dirs and the files in them diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 63fef177..e3af8803 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -536,10 +536,11 @@ init_rename_runtime_files(systemd_generator_t) init_search_runtime(systemd_generator_t) init_setattr_runtime_files(systemd_generator_t) init_write_runtime_files(systemd_generator_t) -init_list_all_units(systemd_generator_t) init_read_generic_units_files(systemd_generator_t) init_read_generic_units_symlinks(systemd_generator_t) init_read_script_files(systemd_generator_t) +init_getattr_all_unit_files(systemd_generator_t) +init_getattr_all_script_files(systemd_generator_t) kernel_use_fds(systemd_generator_t) kernel_read_system_state(systemd_generator_t) -- cgit v1.2.3-65-gdbad