From 49766072ff2c5c222bb898405e78df7e796be8d4 Mon Sep 17 00:00:00 2001 From: Zdenek Pytela Date: Wed, 15 Nov 2023 11:16:44 +0100 Subject: [PATCH] Allow collectd read udev pid files The commit addresses the following AVC denial: type=PROCTITLE msg=audit(11/13/2023 11:36:52.646:207) : proctitle=/usr/sbin/collectd type=PATH msg=audit(11/13/2023 11:36:52.646:207) : item=0 name=/run/udev/data/b259:0 inode=1253 dev=00:1a mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:udev_var_run_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=SYSCALL msg=audit(11/13/2023 11:36:52.646:207) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=AT_FDCWD a1=0x7fd79ce6d850 a2=O_RDONLY|O_CLOEXEC a3=0x0 items=1 ppid=1 pid=1632 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=reader#0 exe=/usr/sbin/collectd subj=system_u:system_r:collectd_t:s0 key=(null) type=AVC msg=audit(11/13/2023 11:36:52.646:207) : avc: denied { read } for pid=1632 comm=reader#0 name=b259:0 dev="tmpfs" ino=1253 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0 Resolves: rhbz#2249257 --- policy/modules/contrib/collectd.te | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/policy/modules/contrib/collectd.te b/policy/modules/contrib/collectd.te index 21ae0205b6..c4fa7f5985 100644 --- a/policy/modules/contrib/collectd.te +++ b/policy/modules/contrib/collectd.te @@ -136,6 +136,10 @@ optional_policy(` snmp_read_snmp_var_lib_dirs(collectd_t) ') +optional_policy(` + udev_read_pid_files(collectd_t) +') + optional_policy(` virt_read_config(collectd_t) virt_stream_connect(collectd_t)