RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 760537 - SELinux "targeted" policy blocks web access to files in directories named "logs"
Summary: SELinux "targeted" policy blocks web access to files in directories named "logs"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Michal Trunecka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-06 13:20 UTC by Robert Vogelgesang
Modified: 2014-09-30 23:33 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.7.19-136.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 723258
Environment:
Last Closed: 2012-06-20 12:29:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0780 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2012-06-19 20:34:59 UTC

Description Robert Vogelgesang 2011-12-06 13:20:15 UTC
+++ This bug was initially created as a clone of Bug #723258 +++

The errata package mentioned in bug #723258 adds the workaround which I originally proposed, but did not fully resolve the issue, because the rule
/var/www(/.*)?/logs(/.*)?       system_u:object_r:httpd_log_t:s0
was not removed from /etc/selinux/targeted/contexts/files, the solution I proposed in comment 5 of bug #723258.  Comment 6 replies only to the possibility to have a boolean for this, but does not say anything about the
reason why this rule even exists.


Description of the remaining problem:
The current SELinux "targeted" policy blocks web access to files in directories named "logs" in hierarchies below /var/www/ other than /var/www/html/.  This is caused by the following entry in /etc/selinux/targeted/contexts/files/file_contexts:
/var/www(/.*)?/logs(/.*)?       system_u:object_r:httpd_log_t:s0

We frequently mount additional disk space for web servers on various directories below of /var/www/,

The above rule blocks access to parts of the additional web space, without any good reason, because the default setup has the Apache log files in /var/log/httpd/, which does not match this rule.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.7.19-126.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install Apache httpd and selinux-policy-targeted on RHEL-6.
2. Create directory /var/www/vweb1 and configure Apache with a VirtualHost
   which has /var/www/vweb1 as its DocumentRoot.
3. Create directory /var/www/vweb1/logs/ and some files in it.
4. Try to access the files with a web browser.
  
Actual results:
The access fails.

Expected results:
The files should be processed like any other content in /var/www/vweb1/.

Additional info:

Comment 2 Robert Vogelgesang 2011-12-06 14:06:57 UTC
One minor correction:

The RHEL-6.2 package is selinux-policy-targeted-3.7.19-126.el6_2.3.noarch, but still contains the rule that I'd like to get removed.

Comment 3 Daniel Walsh 2011-12-06 16:27:53 UTC
I think we should remove these.  If there are real world cases where a user needs httpd_log_t under this directory we should setup the labeling for it.

Comment 4 Robert Vogelgesang 2011-12-06 16:50:42 UTC
Yeah, thank you.

Comment 8 errata-xmlrpc 2012-06-20 12:29:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0780.html


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