Bug 1141548 - SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 3306.
Summary: SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c456e909424f89a947b19fd35cf...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-14 15:28 UTC by Mikhail
Modified: 2015-02-26 07:38 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-09-15 07:43:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
I am just install this firmware upgrade (161.03 KB, image/png)
2014-09-14 15:46 UTC, Mikhail
no flags Details

Description Mikhail 2014-09-14 15:28:14 UTC
Description of problem:
SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 3306.

*****  Plugin catchall_boolean (47.5 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_boolean (47.5 confidence) suggests   ******************

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

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

If you believe that php-fpm should be allowed name_connect access on the port 3306 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:mysqld_port_t:s0
Target Objects                port 3306 [ tcp_socket ]
Source                        php-fpm
Source Path                   php-fpm
Port                          3306
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-79.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.2-301.fc21.x86_64+debug #1
                              SMP Thu Sep 11 12:35:05 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-09-14 21:27:04 YEKT
Last Seen                     2014-09-14 21:27:04 YEKT
Local ID                      c5abf86f-b11f-4ebe-aca8-cf3b02a47315

Raw Audit Messages
type=AVC msg=audit(1410708424.583:728): avc:  denied  { name_connect } for  pid=865 comm="php-fpm" dest=3306 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:mysqld_port_t:s0 tclass=tcp_socket permissive=0


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

Version-Release number of selected component:
selinux-policy-3.13.1-79.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.2-301.fc21.x86_64+debug
type:           libreport

Potential duplicate: bug 887774

Comment 1 Mikhail 2014-09-14 15:36:50 UTC
Description of problem:
Realy don't understand. Why it begin occurs after router firmware upgrade.

Version-Release number of selected component:
selinux-policy-3.13.1-79.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.2-301.fc21.x86_64+debug
type:           libreport

Comment 2 Mikhail 2014-09-14 15:46:14 UTC
Created attachment 937346 [details]
I am just install this firmware upgrade

Comment 3 Miroslav Grepl 2014-09-15 07:43:11 UTC
*****  Plugin catchall_boolean (47.5 confidence) suggests   ******************

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

Comment 4 chopin xiao 2015-02-26 07:38:26 UTC
Description of problem:
when use php-fpm connect remote mysql

Version-Release number of selected component:
selinux-policy-3.13.1-105.3.fc21.noarch

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         3.18.7-200.fc21.x86_64
type:           libreport


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