Bug 999229 - SELinux is preventing /var/www/cgi-bin/cachemgr.cgi from 'search' accesses on the directory /etc/squid.
Summary: SELinux is preventing /var/www/cgi-bin/cachemgr.cgi from 'search' accesses on...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: squid
Version: 19
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Luscon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a60d1e0c06e1d467c6cba239b89...
: 999247 999253 999264 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-21 00:45 UTC by Nivag
Modified: 2014-04-28 10:07 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-28 10:07:08 UTC
Type: ---


Attachments (Terms of Use)

Description Nivag 2013-08-21 00:45:04 UTC
Description of problem:

trying to run:
http://localhost/cgi-bin/cachemgr.cgi
SELinux is preventing /var/www/cgi-bin/cachemgr.cgi from 'search' accesses on the directory /etc/squid.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that cachemgr.cgi should be allowed search 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 cachemgr.cgi /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_sys_script_t:s0
Target Context                system_u:object_r:squid_conf_t:s0
Target Objects                /etc/squid [ dir ]
Source                        cachemgr.cgi
Source Path                   /var/www/cgi-bin/cachemgr.cgi
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           squid-3.2.13-1.fc19.x86_64
Policy RPM                    selinux-policy-3.12.1-69.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.10.7-200.fc19.x86_64 #1 SMP Thu
                              Aug 15 23:19:45 UTC 2013 x86_64 x86_64
Alert Count                   22
First Seen                    2013-08-21 12:04:15 NZST
Last Seen                     2013-08-21 12:33:27 NZST
Local ID                      300c666d-b999-4e31-a518-c366574bb073

Raw Audit Messages
type=AVC msg=audit(1377045207.440:1134): avc:  denied  { search } for  pid=14754 comm="cachemgr.cgi" name="squid" dev="dm-1" ino=1198289 scontext=system_u:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:squid_conf_t:s0 tclass=dir


type=SYSCALL msg=audit(1377045207.440:1134): arch=x86_64 syscall=open success=no exit=EACCES a0=7f7484bb8d58 a1=0 a2=1b6 a3=ffffffe0 items=0 ppid=950 pid=14754 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 ses=4294967295 tty=(none) comm=cachemgr.cgi exe=/var/www/cgi-bin/cachemgr.cgi subj=system_u:system_r:httpd_sys_script_t:s0 key=(null)

Hash: cachemgr.cgi,httpd_sys_script_t,squid_conf_t,dir,search

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.10.7-200.fc19.x86_64
type:           libreport

Potential duplicate: bug 666104

Comment 1 Miroslav Grepl 2013-08-22 13:23:34 UTC
*** Bug 999247 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2013-08-22 13:23:40 UTC
*** Bug 999253 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2013-08-22 13:26:26 UTC
*** Bug 999264 has been marked as a duplicate of this bug. ***

Comment 4 Miroslav Grepl 2013-08-22 13:39:25 UTC
# chcon -t httpd_squid_script_exec_t /var/www/cgi-bin/cachemgr.cgi

will fix it. What does

$ rpm -qf /var/www/cgi-bin/cachemgr.cgi

Comment 5 Nivag 2013-08-22 21:22:36 UTC
# rpm -qf /var/www/cgi-bin/cachemgr.cgi
file /var/www/cgi-bin/cachemgr.cgi is not owned by any package

N.B.  I got the same answer before & after executing:
chcon -t httpd_squid_script_exec_t /var/www/cgi-bin/cachemgr.cgi

Comment 6 Miroslav Grepl 2013-08-27 14:07:25 UTC
Is this your own CGI script?

Comment 7 Nivag 2013-08-27 21:06:20 UTC
No - I assume cachemgr.cgi was installed by the Fedora Squid package, I have not even looked at it.

Comment 8 Miroslav Grepl 2013-08-29 07:46:36 UTC
# rpm -qf /var/www/cgi-bin/cachemgr.cgi
file /var/www/cgi-bin/cachemgr.cgi is not owned by any package

Comment 9 Daniel Walsh 2013-08-29 12:52:28 UTC
Looks like that file should be in /usr/lib64/squid/cachemgr.cgi

Comment 10 Daniel Walsh 2013-08-29 12:53:01 UTC
But we should probably label in that location also, since that might be where the upstream package puts it.

Comment 11 Michal Luscon 2014-04-28 10:07:08 UTC
I presume you manually copied cachemgr.cgi into your /var/www/cgi-bin/ or installed squid from different source. Fedora package installs cachemgr.cgi into /usr/lib64/squid and you can access it on http://localhost/Squid/cgi-bin/cachemgr.cgi with selinux in enforcing mode.

Feel free to reopen this bugzilla if I am wrong.


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