Bug 979755

Summary: SELinux is preventing /usr/sbin/nginx from 'search' accesses on the directory mikhail.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:c00803a68a6bfb956c60134f4e47faf40f3974019b7463976189bffa26fe7586
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-01 10:29:24 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 Mikhail 2013-06-30 09:04:30 UTC
Description of problem:
SELinux is preventing /usr/sbin/nginx from 'search' accesses on the directory mikhail.

*****  Plugin catchall_boolean (47.5 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_boolean (47.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.
You can read 'None' man page for more details.
Do
setsebool -P httpd_enable_homedirs 1

*****  Plugin catchall (6.38 confidence) suggests  ***************************

If you believe that nginx should be allowed search access on the mikhail directory 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                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                mikhail [ dir ]
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-57.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.8-300.fc19.i686.PAE #1 SMP Thu
                              Jun 27 19:29:30 UTC 2013 i686 i686
Alert Count                   2
First Seen                    2013-06-30 15:03:20 YEKT
Last Seen                     2013-06-30 15:03:51 YEKT
Local ID                      34222e3e-37ef-4bfe-b3c9-9437f642a3fb

Raw Audit Messages
type=AVC msg=audit(1372583031.996:487): avc:  denied  { search } for  pid=4551 comm="nginx" name="mikhail" dev="sdb" ino=74055681 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir


type=SYSCALL msg=audit(1372583031.996:487): arch=i386 syscall=open success=no exit=EACCES a0=b90e948d a1=8441 a2=1a4 a3=2 items=0 ppid=1 pid=4551 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_dir_t,dir,search

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.8-300.fc19.i686.PAE
type:           libreport

Comment 1 Daniel Walsh 2013-07-01 10:29:24 UTC
If you want to allow apache to use content in your home dir you have to use one of the booleans suggested above.