Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
sesearch -s httpd_t -t http_port_t -A -C
ET allow httpd_t http_port_t : tcp_socket name_connect ; [ httpd_graceful_shutdown ]
This is on by default. This allows the apache process to connect out on 80/443 by default, which may allow an attacker to create a network connection.
httpd_graceful_shutdown should either limit this connection to localhost, or not allow this rule.
apachectl gracefull I believe causes
the apache server to connect to itself to shut itself down.
Over the years I have tried to get policy to fix the name_connect to take the IP Address into account (localhost) but we have never gotten the code written for this.
I would prefer not to have this boolean turned on for security purposes, but the httpd people complained about breakage.
"Fixed In Version: jorton", well that made me laugh :)
Yes, you remember right. Strictly, httpd needs to be able to connect to any (addr, port) on which it has bound, listening sockets; "localhost" is not exactly what is required, unless that is taken to mean any addr/port on the local host.
This is used to pop children out of poll() loops during graceful restart and stop; if those connections are denied the httpd parent will spam the error log a lot.
Previous discussion at bug 757747, also bug 812926, probably others...
Somewhere around here I have some proof of concept kernel code for SELinux to add an IP address to a port label so we assign port labels using the addr/proto/port triple. However, it still needs the associated userspace work and testing before we can do anything with it.
Who is working on the SELinux userspace these days? I ask because I doubt I'll have time to work on it anytime soon.
This problem is being discussed on https://github.com/SELinuxProject/selinux-kernel/issues/21 We would need to have a working solution in upstream kernel, userspace and policy before we can use it Red Hat Enterprise Linux. Therefore I'm closing this as WONTFIX.
Note that in Fedora 27+ apache server has been updated and there is no need to have httpd_graceful_shutdown enabled anymore.