Bug 1464524 - SELinux is preventing nginx from 'getattr' accesses on the file /home/mikhail/www/apcu/index.php.
SELinux is preventing nginx from 'getattr' accesses on the file /home/mikhail...
Status: NEW
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
26
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
abrt_hash:236f6e68b199cbc20d4d01b0675...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-23 12:13 EDT by Mikhail
Modified: 2017-06-23 13:03 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mikhail 2017-06-23 12:13:11 EDT
Description of problem:
SELinux is preventing nginx from 'getattr' accesses on the file /home/mikhail/www/apcu/index.php.

*****  Plugin catchall_boolean (32.5 confidence) suggests   ******************

If you want to allow httpd to enable homedirs
Then you must tell SELinux about this by enabling the 'httpd_enable_homedirs' boolean.

Do
setsebool -P httpd_enable_homedirs 1

*****  Plugin catchall_boolean (32.5 confidence) suggests   ******************

If you want to allow httpd to unified
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.

Do
setsebool -P httpd_unified 1

*****  Plugin public_content (32.5 confidence) suggests   ********************

If you want to treat index.php as public content
Then you need to change the label on index.php to public_content_t or public_content_rw_t.
Do
# semanage fcontext -a -t public_content_t '/home/mikhail/www/apcu/index.php'
# restorecon -v '/home/mikhail/www/apcu/index.php'

*****  Plugin catchall (4.5 confidence) suggests   ***************************

If you believe that nginx should be allowed getattr access on the index.php file 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:
# ausearch -c 'nginx' --raw | audit2allow -M my-nginx
# semodule -X 300 -i my-nginx.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:httpd_user_content_t:s0
Target Objects                /home/mikhail/www/apcu/index.php [ file ]
Source                        nginx
Source Path                   nginx
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-257.fc26.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.11.6-301.fc26.x86_64+debug #1
                              SMP Tue Jun 20 15:56:36 UTC 2017 x86_64 x86_64
Alert Count                   4
First Seen                    2017-06-21 19:58:44 +05
Last Seen                     2017-06-23 20:49:46 +05
Local ID                      7a24c45d-00be-4ea8-b46b-28fa0240d848

Raw Audit Messages
type=AVC msg=audit(1498232986.370:376): avc:  denied  { getattr } for  pid=941 comm="nginx" path="/home/mikhail/www/apcu/index.php" dev="sdb" ino=4697942998 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_user_content_t:s0 tclass=file permissive=0


Hash: nginx,httpd_t,httpd_user_content_t,file,getattr

Version-Release number of selected component:
selinux-policy-3.13.1-257.fc26.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.11.6-301.fc26.x86_64+debug
type:           libreport

Potential duplicate: bug 1380934

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