Bug 887614

Summary: SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the tcp_socket .
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: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:ba247fd21a0766a8088175a15696e9c3467800c4a33bba89d511558a63aa5f3d
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-16 20:40:39 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 2012-12-16 19:26:51 UTC
Description of problem:
SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the tcp_socket .

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that php-fpm should be allowed name_connect access on the  tcp_socket 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 php-fpm /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:ldap_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        php-fpm
Source Path                   /usr/sbin/php-fpm
Port                          389
Host                          (removed)
Source RPM Packages           php-fpm-5.4.9-1.fc18.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-62.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.6.10-5.fc18.i686.PAE #1 SMP Fri
                              Dec 14 17:25:56 UTC 2012 i686 i686
Alert Count                   2
First Seen                    2012-12-16 22:49:39 YEKT
Last Seen                     2012-12-16 22:49:51 YEKT
Local ID                      38061ef9-4cc8-4010-8cfc-a0a2ab5c155e

Raw Audit Messages
type=AVC msg=audit(1355676591.151:1207): avc:  denied  { name_connect } for  pid=7355 comm="php-fpm" dest=389 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:ldap_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1355676591.151:1207): arch=i386 syscall=socketcall success=no exit=EACCES a0=3 a1=bfb0dfa0 a2=b6cd3000 a3=a3210e8 items=0 ppid=7353 pid=7355 auid=4294967295 uid=991 gid=988 euid=991 suid=991 fsuid=991 egid=988 sgid=988 fsgid=988 tty=(none) ses=4294967295 comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: php-fpm,httpd_t,ldap_port_t,tcp_socket,name_connect

audit2allow

#============= httpd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_connect_ldap, nis_enabled, authlogin_nsswitch_use_ldap, httpd_can_network_connect

allow httpd_t ldap_port_t:tcp_socket name_connect;

audit2allow -R

#============= httpd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_connect_ldap, nis_enabled, authlogin_nsswitch_use_ldap, httpd_can_network_connect

allow httpd_t ldap_port_t:tcp_socket name_connect;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.6.10-5.fc18.i686.PAE
type:           libreport

Comment 1 Miroslav Grepl 2012-12-16 20:40:39 UTC
#============= httpd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_connect_ldap, nis_enabled, authlogin_nsswitch_use_ldap, httpd_can_network_connect

Just turn on the httpd_can_connect_ldap boolean.

# setsebool -P httpd_can_connect_ldap 1