Bug 1391228 - SELinux is preventing nginx from 'open' accesses on the file /home/mikhail/www/webdj/assets/css.js.
Summary: SELinux is preventing nginx from 'open' accesses on the file /home/mikhail/ww...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a88424c5a37e6fd7e22457a6f69...
: 1391229 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-02 20:04 UTC by Mikhail
Modified: 2016-11-07 20:31 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-07 20:24:10 UTC
Type: ---


Attachments (Terms of Use)

Description Mikhail 2016-11-02 20:04:26 UTC
Description of problem:
SELinux is preventing nginx from 'open' accesses on the file /home/mikhail/www/webdj/assets/css.js.

*****  Plugin restorecon (92.2 confidence) suggests   ************************

If you want to fix the label. 
/home/mikhail/www/webdj/assets/css.js default label should be httpd_user_content_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/mikhail/www/webdj/assets/css.js

*****  Plugin catchall_boolean (7.83 confidence) suggests   ******************

If you want to allow httpd to read user content
Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean.
You can read 'None' man page for more details.
Do
setsebool -P httpd_read_user_content 1

*****  Plugin catchall (1.41 confidence) suggests   **************************

If you believe that nginx should be allowed open access on the css.js 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:user_home_t:s0
Target Objects                /home/mikhail/www/webdj/assets/css.js [ file ]
Source                        nginx
Source Path                   nginx
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-220.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.8.5-300.fc25.x86_64+debug #1 SMP
                              Fri Oct 28 21:21:05 UTC 2016 x86_64 x86_64
Alert Count                   4
First Seen                    2016-11-01 22:29:00 +05
Last Seen                     2016-11-02 13:21:48 +05
Local ID                      211f3276-9cce-4e76-aefc-3d84a3e58044

Raw Audit Messages
type=AVC msg=audit(1478074908.708:1761): avc:  denied  { open } for  pid=13691 comm="nginx" path="/home/mikhail/www/webdj/assets/css.js" dev="sdb" ino=6442530244 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1


Hash: nginx,httpd_t,user_home_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-220.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.5-300.fc25.x86_64+debug
type:           libreport

Potential duplicate: bug 1136086

Comment 1 Lukas Vrabec 2016-11-07 20:24:10 UTC
*****  Plugin restorecon (92.2 confidence) suggests   ************************

If you want to fix the label. 
/home/mikhail/www/webdj/assets/css.js default label should be httpd_user_content_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/mikhail/www/webdj/assets/css.js

*****  Plugin catchall_boolean (7.83 confidence) suggests   ******************

If you want to allow httpd to read user content
Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean.
You can read 'None' man page for more details.
Do
setsebool -P httpd_read_user_content 1

Comment 2 Lukas Vrabec 2016-11-07 20:31:01 UTC
*** Bug 1391229 has been marked as a duplicate of this bug. ***


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