Bug 601940

Summary: SELinux prevented httpd (/usr/sbin/httpd) add_name access to configuration.php.
Product: [Fedora] Fedora Reporter: Daniel Scott <dan>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, mgrepl, rasec23rj
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3f19ee36cbc6ccfc7066d2a5dcc34610b8548d60105980d99d97d75e6c2aa44d
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-29 16:56:06 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:

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.