Bug 539963

Summary: SELinux is preventing /usr/sbin/nagios "write" access on nagios.pid.
Product: [Fedora] Fedora Reporter: Richard T Walraven <richard.walraven>
Component: nagiosAssignee: Peter Lemenkov <lemenkov>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: blogcomment, dwalsh, k.georgiou, mgrepl, mmcgrath, redhat, rzhou, sebastian.gosenheimer, spamfuehrer, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:1282d8663649c65f62a30eab4d800f5008454b2d31a2b6e7e7a9695511b702bd
Fixed In Version: nagios-3.2.0-4.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-09 03:16:12 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 Richard T Walraven 2009-11-21 19:14:20 UTC
Summary:

SELinux is preventing /usr/sbin/nagios "write" access on nagios.pid.

Detailed Description:

SELinux denied access requested by nagios. It is not expected that this access
is required by nagios and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                system_u:system_r:nagios_t:s0
Target Context                system_u:object_r:initrc_var_run_t:s0
Target Objects                nagios.pid [ file ]
Source                        nagios
Source Path                   /usr/sbin/nagios
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nagios-3.2.0-2.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-41.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux raptor.rwal.net 2.6.31.5-127.fc12.i686.PAE
                              #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686
Alert Count                   1
First Seen                    Wed 18 Nov 2009 07:01:54 PM HST
Last Seen                     Wed 18 Nov 2009 07:01:54 PM HST
Local ID                      e3b49ca8-af34-4ab5-99eb-d104aee3e523
Line Numbers                  

Raw Audit Messages            

node=raptor.rwal.net type=AVC msg=audit(1258606914.777:6): avc:  denied  { write } for  pid=1801 comm="nagios" name="nagios.pid" dev=sdb3 ino=2097783 scontext=system_u:system_r:nagios_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file

node=raptor.rwal.net type=SYSCALL msg=audit(1258606914.777:6): arch=40000003 syscall=5 success=no exit=-13 a0=92d60c8 a1=8042 a2=1a4 a3=0 items=0 ppid=1792 pid=1801 auid=4294967295 uid=485 gid=466 euid=485 suid=485 fsuid=485 egid=466 sgid=466 fsgid=466 tty=(none) ses=4294967295 comm="nagios" exe="/usr/sbin/nagios" subj=system_u:system_r:nagios_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.32-41.fc12,catchall,nagios,nagios_t,initrc_var_run_t,file,write
audit2allow suggests:

#============= nagios_t ==============
allow nagios_t initrc_var_run_t:file write;

Comment 1 Daniel Walsh 2009-11-23 15:01:54 UTC
I will fix the labeling

Fixed in selinux-policy-3.6.32-48.fc12.noarch

Bug nagios need to run restorecon on the pid file if it is created within the init script

                        touch $NagiosRunFile
                        chown $NagiosUser:$NagiosGroup $NagiosRunFile
                        restorecon $NagiosRunFile

Comment 2 Ricky Zhou 2010-01-20 16:44:57 UTC
Reassigning to new owners.  By the way, the init script patch in bug #546561 includes Daniel's fix as well.

Comment 3 Miroslav Grepl 2010-02-08 09:52:22 UTC
*** Bug 562704 has been marked as a duplicate of this bug. ***

Comment 4 Miroslav Grepl 2010-02-22 15:06:49 UTC
*** Bug 567270 has been marked as a duplicate of this bug. ***

Comment 5 Peter Lemenkov 2010-02-25 10:14:47 UTC
So, seems that this issue was fixed - could someone quickly confirm that?

Comment 6 Fedora Update System 2010-02-25 12:16:59 UTC
nagios-3.2.0-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc12

Comment 7 Fedora Update System 2010-02-25 12:17:21 UTC
nagios-3.2.0-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc13

Comment 8 Fedora Update System 2010-02-25 12:17:46 UTC
nagios-3.2.0-4.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/nagios-3.2.0-4.fc11

Comment 9 Fedora Update System 2010-02-26 03:36:48 UTC
nagios-3.2.0-4.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2010-2903

Comment 10 Fedora Update System 2010-02-26 03:37:53 UTC
nagios-3.2.0-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-2917

Comment 11 Fedora Update System 2010-02-26 03:45:52 UTC
nagios-3.2.0-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nagios'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F13/FEDORA-2010-2957

Comment 12 Fedora Update System 2010-03-09 03:15:49 UTC
nagios-3.2.0-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2010-03-09 03:27:21 UTC
nagios-3.2.0-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2010-03-09 03:36:52 UTC
nagios-3.2.0-4.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.