Bug 915514

Summary: SELinux is preventing /usr/sbin/collectd from read access on the file utmp
Product: [Fedora] Fedora Reporter: Joel Uckelman <uckelman>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-04 00:04:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joel Uckelman 2013-02-25 23:04:16 UTC
Description of problem:

SELinux is preventing /usr/sbin/collectd from read access on the file utmp.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that collectd should be allowed read access on the utmp file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep collectd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:collectd_t:s0
Target Context                system_u:object_r:initrc_var_run_t:s0
Target Objects                utmp [ file ]
Source                        collectd
Source Path                   /usr/sbin/collectd
Port                          <Unknown>
Host                          clio
Source RPM Packages           collectd-4.10.8-2.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-167.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     clio
Platform                      Linux clio 3.7.6-102.fc17.x86_64 #1 SMP Mon Feb 4
                              17:40:25 UTC 2013 x86_64 x86_64
Alert Count                   285
First Seen                    2013-02-25 23:13:07 CET
Last Seen                     2013-02-25 23:56:23 CET
Local ID                      55257c99-39aa-457b-9c1f-2ce081d65bf5

Raw Audit Messages
type=AVC msg=audit(1361832983.196:13624): avc:  denied  { read } for  pid=22738 comm="collectd" name="utmp" dev="tmpfs" ino=11800 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1361832983.196:13624): arch=x86_64 syscall=open success=no exit=EACCES a0=3f6ad77c62 a1=80000 a2=3f6ad77c62 a3=1 items=0 ppid=1 pid=22738 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=collectd exe=/usr/sbin/collectd subj=system_u:system_r:collectd_t:s0 key=(null)

Hash: collectd,collectd_t,initrc_var_run_t,file,read

audit2allow

#============= collectd_t ==============
allow collectd_t initrc_var_run_t:file read;

audit2allow -R

#============= collectd_t ==============
allow collectd_t initrc_var_run_t:file read;


Version-Release number of selected component (if applicable):

selinux-policy-3.10.0-167.fc17.noarch

How reproducible:

Always.

Steps to Reproduce:
1. Enable collectd "users" plugin.
2. Restart collectd.
  
Actual results:

collectd is stopped from reading /etc/utmp by SELinux.

Expected results:

collectd should be able to read /etc/utmp.

Comment 1 Miroslav Grepl 2013-02-28 12:37:47 UTC
commit b3927c2d683a65294d0d0b3e1ba55a3d8cfd2be9
Author: Miroslav Grepl <mgrepl>
Date:   Thu Feb 28 13:36:45 2013 +0100

    Allow collectd to read utmp

Comment 2 Joel Uckelman 2013-03-02 15:59:47 UTC
NB: On F18, it also seems to need open and lock privileges.

Comment 3 Fedora Update System 2013-03-05 14:33:03 UTC
selinux-policy-3.10.0-168.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-168.fc17

Comment 4 Fedora Update System 2013-03-05 23:30:26 UTC
Package selinux-policy-3.10.0-168.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-168.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3466/selinux-policy-3.10.0-168.fc17
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-04-04 08:31:57 UTC
selinux-policy-3.10.0-169.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-169.fc17

Comment 6 Fedora Update System 2013-05-04 00:04:51 UTC
selinux-policy-3.10.0-169.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.