Bug 1528722 - SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 80.
Summary: SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
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: 2017-12-22 23:41 UTC by NM
Modified: 2020-06-04 16:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:41:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description NM 2017-12-22 23:41:11 UTC
Description of problem:
SELinux is preventing php-fpm from 'name_connect' accesses on the tcp_socket port 80.

*****  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 80 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 80 [ tcp_socket ]
Source                        php-fpm
Source Path                   php-fpm
Port                          80
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.17.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.14.6-300.fc27.x86_64 #1 SMP Thu
                              Dec 14 15:31:24 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-12-21 06:36:40 EST
Last Seen                     2017-12-21 06:36:40 EST
Local ID                      2a0532f4-9cad-43ef-a8a0-9f4c2e511966

Raw Audit Messages
type=AVC msg=audit(1513856200.190:20785): avc:  denied  { name_connect } for  pid=1768 comm="php-fpm" dest=80 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.13.1-283.17.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.14.7-300.fc27.x86_64
type:           libreport

Comment 1 Paul Johnson 2017-12-25 11:40:37 UTC
I have this issue too. Same policy and version numbers. I'm running WordPress 4.9.1-1.fc27.

Comment 2 Lukas Vrabec 2018-01-02 16:19:45 UTC
Following boolean will allow this SELinux denial. We should rename this boolean to make it more sense: 

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

Comment 3 NM 2018-01-03 00:51:01 UTC
Thanks, i run as suggested. Should not that be part of selinux policy?

Comment 4 Lukas Vrabec 2018-01-04 15:31:14 UTC
No, 

We changed default value of this boolean to increase security in Fedora.

Comment 5 NM 2018-01-04 16:22:50 UTC
OK. Thanks.

Comment 6 Ben Cotton 2018-11-27 14:32:25 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2018-11-30 22:41:05 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Douglas 2020-06-04 16:59:58 UTC
Could anyone explain what this boolean httpd_graceful_shutdown does? I couldn't find anything about "graceful shutdown" in the httpd documentation or anywhere else.


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