Bug 827009 - SELinux denies read access for snmpd to /var/run/net-snmp
SELinux denies read access for snmpd to /var/run/net-snmp
Status: CLOSED DUPLICATE of bug 822480
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.2
All Linux
unspecified Severity high
: rc
: ---
Assigned To: Miroslav Grepl
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-31 08:18 EDT by John Horne
Modified: 2012-05-31 09:26 EDT (History)
2 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description John Horne 2012-05-31 08:18:11 EDT
Description of problem:
Configure snmpd to use a pass_persist program which reads data from a file in /var/run/net-snmp. The program runs as root but is denied read access to the file.

Version-Release number of selected component (if applicable):
net-snmp-5.5-37.el6_2.1.x86_64
selinux-policy-3.7.19-126.el6_2.10.noarch


How reproducible:
Always


Steps to Reproduce:
1. Run root cron job to write to a file in /var/run/net-snmp
2. Configure /etc/snmp/snmpd.conf to run a program using the pass_persist directive which reads the above file.
3. The program will run via snmpd but is denied read access.
4. Running 'semodule -DB' will show the AVCs in /var/log/audit/audit.log
  
Actual results:
No output from the pass_persist program, so snmpd gives the error (in my case):
   SNMPv2-SMI::enterprises.141.1.1.10 = No Such Instance currently
   exists at this OID


Expected results:
Snmpd should have read access to anything in /var/run/net-snmp, so SNMP results should be read and returned to snmpd.

Additional info:
This was discussed on the CentOS mailing list, but has been confirmed on our RHEL 6.2 system as well:
http://lists.centos.org/pipermail/centos/2012-May/126403.html
Comment 1 John Horne 2012-05-31 08:45:05 EDT
Sorry, should have added this:

By default '/var/run/net-snmp' has the context 'system_u:object_r:var_run_t:s0'.
If I run:

   chcon -t snmpd_var_run_t /var/run/net-snmp

then the pass_persist program works fine via snmpd.
Comment 4 Miroslav Grepl 2012-05-31 09:22:16 EDT
This has been fixed.

*** This bug has been marked as a duplicate of bug 822480 ***

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