Bug 964379 - SELinux is preventing /usr/sbin/nginx from 'open' accesses on the file /home/mikhail/logs/nginx_error.log.
Summary: SELinux is preventing /usr/sbin/nginx from 'open' accesses on the file /home/...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a88424c5a37e6fd7e22457a6f69...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-18 06:50 UTC by Mikhail
Modified: 2013-05-18 10:25 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-18 10:25:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mikhail 2013-05-18 06:50:49 UTC
Description of problem:
SELinux is preventing /usr/sbin/nginx from 'open' accesses on the file /home/mikhail/logs/nginx_error.log.

*****  Plugin catchall_boolean (89.3 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 'user_selinux' man page for more details.
Do
setsebool -P httpd_read_user_content 1

*****  Plugin catchall (11.6 confidence) suggests  ***************************

If you believe that nginx should be allowed open access on the nginx_error.log 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:
# grep nginx /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:user_home_t:s0
Target Objects                /home/mikhail/logs/nginx_error.log [ file ]
Source                        nginx
Source Path                   /usr/sbin/nginx
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nginx-1.4.1-1.fc19.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-44.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.1-301.fc19.i686.PAE #1 SMP Wed
                              May 8 18:21:34 UTC 2013 i686 i686
Alert Count                   1
First Seen                    2013-05-14 23:38:46 YEKT
Last Seen                     2013-05-14 23:38:46 YEKT
Local ID                      84e069c4-e294-4f6a-8185-3d026cf9d46b

Raw Audit Messages
type=AVC msg=audit(1368553126.650:432): avc:  denied  { open } for  pid=1019 comm="nginx" path="/home/mikhail/logs/nginx_error.log" dev="sdb" ino=167773169 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1368553126.650:432): arch=i386 syscall=open success=no exit=EACCES a0=b9398495 a1=8441 a2=1a4 a3=2 items=0 ppid=1 pid=1019 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=nginx exe=/usr/sbin/nginx subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: nginx,httpd_t,user_home_t,file,open

audit2allow

#============= httpd_t ==============

#!!!! This avc can be allowed using the boolean 'httpd_read_user_content'
allow httpd_t user_home_t:file open;

audit2allow -RYou must regenerate interface info by running /usr/bin/sepolgen-ifgen


Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.2-301.fc19.i686.PAE
type:           libreport

Comment 1 Daniel Walsh 2013-05-18 10:25:43 UTC
The alert tells you what to do.

*****  Plugin catchall_boolean (89.3 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 'user_selinux' man page for more details.
Do
setsebool -P httpd_read_user_content 1


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