Bug 826784 - SELinuxs prevents Nagios check_procs plugin from accessing password file
SELinuxs prevents Nagios check_procs plugin from accessing password file
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2012-05-30 20:14 EDT by Ben Webb
Modified: 2012-06-16 20:05 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-16 20:05:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ben Webb 2012-05-30 20:14:44 EDT
Description of problem:
The Nagios check_procs plugin has a -u option to only check processes belonging to a named user. It consequently needs to read /etc/passwd. However, SELinux prevents it from doing this.

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

How reproducible:

Steps to Reproduce:
1. Set up the Nagios check_procs plugin on a Fedora 17 machine; I install nrpe, and add the following to /etc/nagios/nrpe.cfg:
command[check_ntpd]=/usr/lib64/nagios/plugins/check_procs -u ntp -C ntpd -w 1:1 -c 1:1

2. Check the plugin (I run on my Nagios server "/usr/lib64/nagios/plugins/check_nrpe -H <f17machine> -c check_ntpd")

Actual results:

AVC on the Fedora 17 machine:
May 30 17:09:42 f17machine kernel: [ 1887.911663] type=1400 audit(1338422982.262:48): avc:  denied  { read } for  pid=11373 comm="check_procs" name="passwd" dev="sda1" ino=421537 scontext=system_u:system_r:nagios_system_plugin_t:s0 tcontext=system_u:object_r:passwd_file_t:s0 tclass=file

check_nrpe on the Nagios server fails with:
check_procs: User name was not found - ntp

Expected results:
No AVC; Nagios server reports:
PROCS OK: 1 process with UID = 38 (ntp), command name 'ntpd'

Additional info:
Temporary workaround:
chcon -t nagios_unconfined_plugin_exec_t /usr/lib64/nagios/plugins/check_procs
Comment 1 Miroslav Grepl 2012-05-31 02:48:03 EDT
Great analysis. 

Fixed in selinux-policy-3.10.0-129.fc17
Comment 2 Fedora Update System 2012-06-11 17:03:20 EDT
selinux-policy-3.10.0-130.fc17 has been submitted as an update for Fedora 17.
Comment 3 Fedora Update System 2012-06-15 20:00:14 EDT
Package selinux-policy-3.10.0-130.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-130.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-06-16 20:05:09 EDT
selinux-policy-3.10.0-130.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.