Bug 887614 - SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the tcp_socket .
Summary: SELinux is preventing /usr/sbin/php-fpm from 'name_connect' accesses on the t...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ba247fd21a0766a8088175a1569...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-16 19:26 UTC by Mikhail
Modified: 2012-12-16 20:40 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-16 20:40:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


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