Bug 1022235

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: 20CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ba247fd21a0766a8088175a15696e9c3467800c4a33bba89d511558a63aa5f3d
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-23 11:57:37 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-10-22 19:27:22 UTC
Description of problem:
SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the tcp_socket .

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

If you want to allow authlogin to nsswitch use ldap
Then you must tell SELinux about this by enabling the 'authlogin_nsswitch_use_ldap' boolean.
You can read 'None' man page for more details.
Do
setsebool -P authlogin_nsswitch_use_ldap 1

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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

*****  Plugin catchall (3.53 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.5.5-1.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-90.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.6-300.fc20.x86_64+debug #1
                              SMP Fri Oct 18 22:20:05 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-10-23 01:26:41 YEKT
Last Seen                     2013-10-23 01:26:41 YEKT
Local ID                      2dd9db4e-0e33-46e8-bee4-ce4c1f527fb5

Raw Audit Messages
type=AVC msg=audit(1382470001.317:575): avc:  denied  { name_connect } for  pid=721 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(1382470001.317:575): arch=x86_64 syscall=connect success=no exit=EACCES a0=8 a1=7f1136dc84d0 a2=10 a3=0 items=0 ppid=617 pid=721 auid=4294967295 uid=989 gid=986 euid=989 suid=989 fsuid=989 egid=986 sgid=986 fsgid=986 ses=4294967295 tty=(none) 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

Additional info:
reporter:       libreport-2.1.8
hashmarkername: setroubleshoot
kernel:         3.11.6-300.fc20.x86_64+debug
type:           libreport

Potential duplicate: bug 887614

Comment 1 Lukas Vrabec 2013-10-23 11:57:37 UTC
*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

If you want to allow authlogin to nsswitch use ldap
Then you must tell SELinux about this by enabling the 'authlogin_nsswitch_use_ldap' boolean.
You can read 'None' man page for more details.
Do
setsebool -P authlogin_nsswitch_use_ldap 1

*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

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


Alert told you what to do.