Bug 1029119

Summary: nagios-plugins-mrtgtraf-1.4.16-10.el6.x86_64 is unable to access mrtg logfiles required to function.
Product: [Fedora] Fedora Reporter: Nick <nick>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-13 16:24:00 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 Nick 2013-11-11 17:13:47 UTC
Description of problem:
 nagios-plugins-mrtgtraf-1.4.16-10.el6.x86_64 is unable to access mrtg logfiles
required to function.

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


How reproducible:


Steps to Reproduce:
 Enable selinux with default policy
Install MRTG and monitor one or more devices
Install Nagios and nagios-plugins-mrtgtraf
Define a service in Nagios to monitor an MRTG graph similar to:
define service{
        use                     generic-service ; Inherit values from a template
        host_name               router
        service_description     Port 2 Bandwidth Usage
        check_command
check_local_mrtgtraf!/var/lib/mrtg/my_router.log!AVG!1000000,1000000!5000000,5000000!10
        }

Actual results:
Check fails to access log file

Expected results:
Check accesses log file and parses results

Additional info:
 This SELinux policy will correct the issue:
require {
        type nagios_system_plugin_t;
        type nagios_t;
        type mrtg_var_lib_t;
        type nagios_log_t;
        type var_lib_t;
        class process { siginh noatsecure rlimitinh };
        class file { write read getattr open };
        class dir search;
}

#============= nagios_system_plugin_t ==============

#!!!! This avc is allowed in the current policy
allow nagios_system_plugin_t mrtg_var_lib_t:file { read getattr open };
allow nagios_system_plugin_t mrtg_var_lib_t:dir search;
#allow nagios_system_plugin_t nagios_log_t:file write;
allow nagios_system_plugin_t var_lib_t:dir search;

#============= nagios_t ==============
#allow nagios_t nagios_system_plugin_t:process { siginh rlimitinh noatsecure };


This .te should probably be reparsed into the correct format, and added to /usr/share/selinux/devel/include/services/nagios.if.

Comment 1 Miroslav Grepl 2014-01-13 16:24:00 UTC
Thank you.