Bug 1729089 - SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 443.
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: 30
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:286f98c7b9cdbe2e31d1368b0f9...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-11 11:43 UTC by Michael Wiktowy
Modified: 2019-07-11 12:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-11 12:58:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael Wiktowy 2019-07-11 11:43:40 UTC
Description of problem:
This php-fpm package is a dependancy of MediaWiki and seems to generate these alerts each time MediaWiki is updated.

The alerts are certainly clear in how to work-around the issues.

I am not sure if this should be included in the default targetted policy so I am reporting it here for comment of those more knowledgable.
SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 443.

*****  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.

Do
setsebool -P httpd_can_network_connect 1

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

If you want to allow httpd to graceful shutdown
Then you must tell SELinux about this by enabling the 'httpd_graceful_shutdown' boolean.

Do
setsebool -P httpd_graceful_shutdown 1

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

If you want to allow httpd to can network relay
Then you must tell SELinux about this by enabling the 'httpd_can_network_relay' boolean.

Do
setsebool -P httpd_can_network_relay 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.

Do
setsebool -P nis_enabled 1

*****  Plugin catchall (3.53 confidence) suggests   **************************

If you believe that php-fpm should be allowed name_connect access on the port 443 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:
# ausearch -c 'php-fpm' --raw | audit2allow -M my-phpfpm
# semodule -X 300 -i my-phpfpm.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:http_port_t:s0
Target Objects                port 443 [ tcp_socket ]
Source                        php-fpm
Source Path                   php-fpm
Port                          443
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-39.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.1.16-300.fc30.x86_64 #1 SMP Wed
                              Jul 3 15:06:51 UTC 2019 x86_64 x86_64
Alert Count                   22
First Seen                    2019-05-16 00:34:36 ADT
Last Seen                     2019-07-11 08:31:13 ADT
Local ID                      018ad969-2747-4db6-98d1-d20280a9bb3c

Raw Audit Messages
type=AVC msg=audit(1562844673.126:348): avc:  denied  { name_connect } for  pid=1183 comm="php-fpm" dest=443 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=0


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

Version-Release number of selected component:
selinux-policy-3.14.3-39.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.1.16-300.fc30.x86_64
type:           libreport

Potential duplicate: bug 1528722

Comment 1 Lukas Vrabec 2019-07-11 12:58:50 UTC
*****  Plugin catchall_boolean (24.7 confidence) suggests   ******************

If you want to allow httpd to graceful shutdown
Then you must tell SELinux about this by enabling the 'httpd_graceful_shutdown' boolean.

Do
setsebool -P httpd_graceful_shutdown 1


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