| Summary: | Wordpress needs a bit of SELinux love to run in the Enforcing mode | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Matěj Cepl <mcepl> |
| Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> |
| Status: | CLOSED ERRATA | QA Contact: | Michal Trunecka <mtruneck> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.3 | CC: | dwalsh, ebenes, gwync, mgrepl, mmalik, mtruneck, nobody, wendellcraigbaker |
| Target Milestone: | rc | Keywords: | Reopened, SELinux |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | selinux-policy-3.7.19-156.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-02-21 08:34:25 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
I added changes to the latest RHEL6.2 policy. Not good. After removing all my local fixes, I still have [root@luther ~]# restorecon -v -R /usr/share/wordpress/ restorecon reset /usr/share/wordpress/wp-config.php context system_u:object_r:httpd_sys_script_exec_t:s0->system_u:object_r:usr_t:s0 restorecon reset /usr/share/wordpress/wp-content/plugins/akismet/index.php context unconfined_u:object_r:usr_t:s0->unconfined_u:object_r:httpd_sys_script_exec_t:s0 restorecon reset /usr/share/wordpress/wp-content/plugins/browserid/browserid.php context system_u:object_r:usr_t:s0->system_u:object_r:httpd_sys_script_exec_t:s0 restorecon reset /usr/share/wordpress/wp-includes/class-simplepie.php context system_u:object_r:httpd_sys_script_exec_t:s0->system_u:object_r:usr_t:s0 [root@luther ~]# Specifically I am missing [root@luther ~]# semanage fcontext -a -t httpd_sys_script_exec_t '/usr/share/wordpress/.*\.php$' [root@luther ~]# restorecon -v -R /usr/share/wordpress/restorecon reset /usr/share/wordpress/wp-config.php context system_u:object_r:usr_t:s0->system_u:object_r:httpd_sys_script_exec_t:s0 restorecon reset /usr/share/wordpress/wp-includes/class-simplepie.php context system_u:object_r:usr_t:s0->system_u:object_r:httpd_sys_script_exec_t:s0 [root@luther ~]# $ rpm -q selinux-policy wycliff:~ $ ssh luther rpm -q selinux-policy selinux-policy-3.7.19-145.el6.noarch wycliff:~ $ [root@localhost ~]# matchpathcon /usr/share/wordpress/wp-config.php /usr/share/wordpress/wp-config.php system_u:object_r:httpd_sys_script_exec_t:s0 [root@localhost ~]# matchpathcon /usr/share/wordpress/wp-ine.phes/class-simplepi /usr/share/wordpress/wp-includes/class-simplepie.ph system_u:object_r:usr_t:s0 I am fixing the second path. Thank you 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-2013-0314.html |
Description of problem: In order to make wordpress as packaged for RHEL 6 (in EPEL) I needed to do these little changes. Special module mywordpress: [root@luther selinux]# cat mywordpress.te module mywordpress 1.0; require { type httpd_t; type httpd_sys_script_exec_t; class lnk_file { read getattr }; } #============= httpd_t ============== allow httpd_t httpd_sys_script_exec_t:lnk_file { read getattr }; (/etc/wordpress/wp-config.php is a symlink to /usr/share/wordpress/wp-config.php). Also I added these fcontext patterns: [root@luther selinux]# semanage fcontext -l -C SELinux fcontext type Context /usr/share/wordpress/.*\.php$ all files system_u:object_r:httpd_sys_script_exec_t:s0 SELinux fcontext Equivalence /usr/share/wordpress/wp-content/upgrade(/.*)? = /usr/share/wordpress/wp-content/uploads/ [root@luther selinux]# Version-Release number of selected component (if applicable): wordpress-3.1-1.el6.noarch selinux-policy-3.7.19-54.el6_0.5.noarch