Bug 878645

Summary: SELinux is preventing /usr/sbin/snmpd from 'read' accesses on the file snmpd.conf.
Product: [Fedora] Fedora Reporter: Micah Shennum <jimtahu>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:5330305e158594fa120644e0cb7516560ebe7cd14c7a525dc999bd68f44c68fd
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-21 10:52:22 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:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description Micah Shennum 2012-11-20 20:56:36 UTC
Description of problem:
I created a new snmpd.conf using snmpconf and copyed it to /etc/snmp/

Additional info:
libreport version: 2.0.18
kernel:         3.6.6-1.fc17.x86_64

description:
:SELinux is preventing /usr/sbin/snmpd from 'read' accesses on the file snmpd.conf.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that snmpd should be allowed read access on the snmpd.conf file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep snmpd /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:snmpd_t:s0
:Target Context                unconfined_u:object_r:user_home_t:s0
:Target Objects                snmpd.conf [ file ]
:Source                        snmpd
:Source Path                   /usr/sbin/snmpd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           net-snmp-5.7.1-5.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-159.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.6-1.fc17.x86_64 #1 SMP Mon Nov
:                              5 21:59:35 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    2012-11-20 14:54:48 CST
:Last Seen                     2012-11-20 14:54:48 CST
:Local ID                      1b3a176b-095c-4a63-9b16-824d7bd03398
:
:Raw Audit Messages
:type=AVC msg=audit(1353444888.683:232): avc:  denied  { read } for  pid=9535 comm="snmpd" name="snmpd.conf" dev="dm-1" ino=1180388 scontext=system_u:system_r:snmpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1353444888.683:232): arch=x86_64 syscall=open success=no exit=EACCES a0=7fff96de78a0 a1=0 a2=1b6 a3=238 items=0 ppid=1 pid=9535 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=snmpd exe=/usr/sbin/snmpd subj=system_u:system_r:snmpd_t:s0 key=(null)
:
:Hash: snmpd,snmpd_t,user_home_t,file,read
:
:audit2allow
:
:#============= snmpd_t ==============
:allow snmpd_t user_home_t:file read;
:
:audit2allow -R
:
:#============= snmpd_t ==============
:allow snmpd_t user_home_t:file read;
:
:I created a new snmpd.conf using snmpconf

Comment 1 Micah Shennum 2012-11-20 20:56:38 UTC
Created attachment 648831 [details]
File: type

Comment 2 Micah Shennum 2012-11-20 20:56:39 UTC
Created attachment 648832 [details]
File: hashmarkername

Comment 3 Miroslav Grepl 2012-11-21 10:52:22 UTC
You need to fix labeling. 

# restorecon -R -v /etc/snmp/

Comment 4 Micah Shennum 2012-11-24 01:13:49 UTC
Thank you, everything seems to work well now.