Bug 979795

Summary: SELinux is preventing /usr/lib64/nagios/plugins/check_mysql from 'read' accesses on the directory cpu.
Product: [Fedora] Fedora Reporter: Juan Orti <jorti>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b0788e43ebb1af17bf5f5f6c31aa203b11fdc8d6544a40886fa374195520fe0b
Fixed In Version: selinux-policy-3.12.1-59.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-07 01:32:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan Orti 2013-06-30 17:20:17 UTC
Description of problem:
SELinux is preventing /usr/lib64/nagios/plugins/check_mysql from 'read' accesses on the directory cpu.

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

If cree que de manera predeterminada, check_mysql debería permitir acceso read sobre  cpu directory.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
Do
permita el acceso momentáneamente executando:
# grep check_mysql /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:nagios_services_plugin_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                cpu [ dir ]
Source                        check_mysql
Source Path                   /usr/lib64/nagios/plugins/check_mysql
Port                          <Desconocido>
Host                          (removed)
Source RPM Packages           nagios-plugins-mysql-1.4.16-7.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-54.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.6-301.fc19.x86_64 #1 SMP Mon
                              Jun 17 14:26:26 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-06-30 19:19:07 CEST
Last Seen                     2013-06-30 19:19:07 CEST
Local ID                      30c6eff2-f00c-47b7-88cd-e54e7824b92f

Raw Audit Messages
type=AVC msg=audit(1372612747.202:2349): avc:  denied  { read } for  pid=15494 comm="check_mysql" name="cpu" dev="sysfs" ino=37 scontext=system_u:system_r:nagios_services_plugin_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir


type=SYSCALL msg=audit(1372612747.202:2349): arch=x86_64 syscall=openat success=no exit=EACCES a0=ffffffffffffff9c a1=7fafc03a5b18 a2=90800 a3=0 items=0 ppid=15493 pid=15494 auid=4294967295 uid=981 gid=976 euid=981 suid=981 fsuid=981 egid=976 sgid=976 fsgid=976 ses=4294967295 tty=(none) comm=check_mysql exe=/usr/lib64/nagios/plugins/check_mysql subj=system_u:system_r:nagios_services_plugin_t:s0 key=(null)

Hash: check_mysql,nagios_services_plugin_t,sysfs_t,dir,read

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.6-301.fc19.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-07-01 10:58:57 UTC
commit 5052796b81c0b43048be94b9ea12ff633adc3959
Author: Miroslav Grepl <mgrepl>
Date:   Mon Jul 1 12:58:49 2013 +0200

    Allow nagios plugins to read /sys info

Comment 2 Fedora Update System 2013-07-03 19:49:56 UTC
selinux-policy-3.12.1-59.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-59.fc19

Comment 3 Fedora Update System 2013-07-05 02:13:38 UTC
Package selinux-policy-3.12.1-59.fc19:
* should fix your issue,
* was pushed to the Fedora 19 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.12.1-59.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-12373/selinux-policy-3.12.1-59.fc19
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-07-07 01:32:54 UTC
selinux-policy-3.12.1-59.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.