Created attachment 1182746 [details] Outputs ot audit2allow -w -a and audit2allow -a Description of problem: There is a missing type enforcement rule for collectd in selinux which causes errors in /var/log/messages Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. install and run collectd with enabled log_logstash plugin on a selinux enabled machine Actual results: /var/log/messages: Jul 22 10:00:51 <hostname> collectd: log_logstash plugin: fopen (/var/log/collectd.json.log) failed: Permission denied Expected results: -no error/access allowed Additional info: In case additional information is required, I will provide it (at the moment, I am not sure what might be further required)
Could you attach raw avc msgs? (/var/log/audit/audit.log) Thank you.
I identified these messages (/var/log/audit/audit.log): type=AVC msg=audit(1469692671.315:224730): avc: denied { execute } for pid=26260 comm="collectd" name="mpstat" dev="dm-0" ino=9752245 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file type=SYSCALL msg=audit(1469692671.315:224730): arch=c000003e syscall=59 success=no exit=-13 a0=7f63c4002b10 a1=7f63c4027ff0 a2=7f63e0506860 a3=7f63cbffdb70 items=0 ppid=1466 pid=26260 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="collectd" exe="/usr/sbin/collectd" subj=system_u:system_r:collectd_t:s0 key=(null) type=AVC msg=audit(1469692671.317:224731): avc: denied { write } for pid=2224 comm="collectd" name="log" dev="dm-2" ino=1476395520 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir type=SYSCALL msg=audit(1469692671.317:224731): arch=c000003e syscall=2 success=no exit=-13 a0=7f63e05149e0 a1=441 a2=1b6 a3=24 items=0 ppid=1 pid=2224 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="collectd" exe="/usr/sbin/collectd" subj=system_u:system_r:collectd_t:s0 key=(null)
This bugzilla was triaged as "WONTFIX" by the SELinux team, due to third-party software component which can be fixed by component maintainer. To take advantage of Mandatory Access Control mechanism provided by SELinux, you (component maintainer) can ship custom SELinux policy as a subpackage of the affected component. As a starting point you can use policy provided by selinux-policy package. For more details about the custom product policy, please follow the https://fedoraproject.org/wiki/SELinux/IndependentPolicy guideline.
Lukas, wait a second. The collectd policy is in selinux-policy-targeted, but you're now expecting me to work around these AVCs in the collectd package itself? I never confined collectd, and don't have the time, skills or the energy to maintain the SELinux policy for it. If I'm not mistaken you guys wrote the policy in the first place. So I'm sorry, but I'm giving you this issue back. If you can't keep up with the AVCs for collectd, please just remove the policy from selinux-policy-targeted.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
https://github.com/fedora-selinux/selinux-policy-contrib/pull/60
selinux-policy-3.13.1-284.37.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-4bb4de2d86
selinux-policy-3.13.1-284.37.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-4bb4de2d86
selinux-policy-3.13.1-284.37.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.