Bug 601940 - SELinux prevented httpd (/usr/sbin/httpd) add_name access to configuration.php.
Summary: SELinux prevented httpd (/usr/sbin/httpd) add_name access to configuration.php.
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:3f19ee36cbc...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-08 21:36 UTC by Daniel Scott
Modified: 2010-11-06 02:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-29 16:56:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Scott 2010-06-08 21:36:16 UTC
Summary:

SELinux prevented httpd (/usr/sbin/httpd) add_name access to configuration.php.

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux prevented httpd add_name access to configuration.php. httpd scripts are
not allowed to write to content without explicit labeling of all files. If
configuration.php is writable content. it needs to be labeled
httpd_sys_content_rw_t or if all you need is append you can label it
httpd_sys_content_ra_t. Please refer to 'man httpd_selinux' for more information
on setting up httpd and selinux.

Allowing Access:

You can alter the file context by executing chcon -R -t httpd_sys_content_rw_t
'configuration.php' You must also change the default file context files on the
system in order to preserve them even on a full relabel. "semanage fcontext -a
-t httpd_sys_content_rw_t 'configuration.php'"

Fix Command:

chcon -R -t httpd_sys_content_rw_t 'configuration.php'

Additional Information:

Source Context                unconfined_u:system_r:httpd_t:s0
Target Context                system_u:object_r:httpd_sys_content_t:s0
Target Objects                configuration.php [ dir ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.15-1.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-21.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   httpd_write_content
Host Name                     (removed)
Platform                      Linux (removed) 2.6.33.5-112.fc13.x86_64 #1
                              SMP Thu May 27 02:28:31 UTC 2010 x86_64 x86_64
Alert Count                   3
First Seen                    Tue 08 Jun 2010 05:07:41 PM EDT
Last Seen                     Tue 08 Jun 2010 05:07:41 PM EDT
Local ID                      50684e3a-896d-49c8-9217-d8154b7e5b40
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1276031261.559:3159278): avc:  denied  { add_name } for  pid=1156 comm="httpd" name="configuration.php" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir

node=(removed) type=AVC msg=audit(1276031261.559:3159278): avc:  denied  { create } for  pid=1156 comm="httpd" name="configuration.php" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file

node=(removed) type=AVC msg=audit(1276031261.559:3159278): avc:  denied  { write } for  pid=1156 comm="httpd" name="configuration.php" dev=dm-1 ino=395829 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1276031261.559:3159278): arch=c000003e syscall=2 success=yes exit=12 a0=7ffb91234680 a1=241 a2=1b6 a3=7068702e6e6f69 items=0 ppid=1129 pid=1156 auid=768 uid=48 gid=475 euid=48 suid=48 fsuid=48 egid=475 sgid=475 fsgid=475 tty=(none) ses=1 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)



Hash String generated from  httpd_write_content,httpd,httpd_t,httpd_sys_content_t,dir,add_name
audit2allow suggests:

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:dir add_name;
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:file { write create };

Comment 1 Daniel Walsh 2010-06-09 11:20:28 UTC
What directory is configuration.php?

It should be labeled httpd_sys_content_rw_t.


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