Bug 1045716

Summary: SELinux is preventing /usr/sbin/squid from 'write' accesses on the directory /var/spool/squid.
Product: [Fedora] Fedora Reporter: Randy Gordey <gordey>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ead05d03b2ec36ed83ebc51c87887be975f4b4cefb65dd551fefabfc720a59fa
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-02 23:08:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Randy Gordey 2013-12-21 12:58:43 UTC
Description of problem:
Install Squid to new Fedora20
SELinux is preventing /usr/sbin/squid from 'write' accesses on the directory /var/spool/squid.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/var/spool/squid default label should be squid_cache_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/spool/squid

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that squid should be allowed write access on the squid directory 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 squid /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:squid_t:s0
Target Context                unconfined_u:object_r:var_spool_t:s0
Target Objects                /var/spool/squid [ dir ]
Source                        squid
Source Path                   /usr/sbin/squid
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           squid-3.3.11-1.fc20.x86_64
Target RPM Packages           squid-3.3.11-1.fc20.x86_64
Policy RPM                    selinux-policy-3.12.1-106.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.12.5-302.fc20.x86_64 #1 SMP Tue
                              Dec 17 20:42:32 UTC 2013 x86_64 x86_64
Alert Count                   5
First Seen                    2013-12-21 06:50:54 CST
Last Seen                     2013-12-21 06:51:08 CST
Local ID                      a1d66b5e-a725-4266-bcf8-21ba67ec06e0

Raw Audit Messages
type=AVC msg=audit(1387630268.222:209): avc:  denied  { write } for  pid=4999 comm="squid" name="squid" dev="dm-1" ino=1082748 scontext=system_u:system_r:squid_t:s0 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=dir


type=SYSCALL msg=audit(1387630268.222:209): arch=x86_64 syscall=open success=no exit=EACCES a0=7ff05cd64660 a1=441 a2=1a4 a3=0 items=0 ppid=4829 pid=4999 auid=4294967295 uid=23 gid=23 euid=23 suid=0 fsuid=23 egid=23 sgid=23 fsgid=23 ses=4294967295 tty=(none) comm=squid exe=/usr/sbin/squid subj=system_u:system_r:squid_t:s0 key=(null)

Hash: squid,squid_t,var_spool_t,dir,write

Additional info:
reporter:       libreport-2.1.10
hashmarkername: setroubleshoot
kernel:         3.12.5-302.fc20.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-01-02 23:08:07 UTC
*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/var/spool/squid default label should be squid_cache_t.
Then you can run restorecon.
Do
# /sbin/restorecon -rv /var/spool/squid


The alert told you what to do.  Somehow this directory got mislabeled.