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.

Bug 2213965

Summary: Policy for httpd to connect to Redis via TCP socket missing
Product: Red Hat Enterprise Linux 8 Reporter: Daniel Bodky <dbodky>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.8CC: lvrabec, mmalik
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-123.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-14 15:47:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Bodky 2023-06-10 12:31:37 UTC
While installing a web application communicating with a redis service via TCP socket, I witnessed connectivity issues related to SELinux.

Connections could be established only after setting 'httpd_can_network_connect' to 'on' due to a missing policy for connecting to redis with httpd.

This had me double-check the available policies related to httpd and redis:

# sesearch -s httpd_t --allow | grep redis
allow httpd_t redis_t:unix_stream_socket connectto;
allow httpd_t redis_var_run_t:dir { getattr open search };
allow httpd_t redis_var_run_t:sock_file { append getattr open write };

When compared to the available policies related to httpd and memcache, a service similar to redis, it shows that there are available policies for connecting via TCP:

# sesearch -s httpd_t --allow | grep memcache
allow httpd_t memcache_port_t:tcp_socket name_connect; [ httpd_can_network_memcache ]:True
allow httpd_t memcache_port_t:tcp_socket name_connect; [ httpd_can_network_relay ]:True
allow httpd_t memcached_t:unix_stream_socket connectto;
allow httpd_t memcached_var_run_t:dir { add_name getattr ioctl lock open read remove_name search write }; [ httpd_manage_ipa ]:True
allow httpd_t memcached_var_run_t:dir { getattr open search };
allow httpd_t memcached_var_run_t:file { append create getattr ioctl link lock open read rename setattr unlink write }; [ httpd_manage_ipa ]:True
allow httpd_t memcached_var_run_t:sock_file { append getattr open write };

Thus, I think the equivalent policies for httpd<->redis connectivity have been omitted accidentally?


Version-Release number of selected component (if applicable):
httpd - 2.4.37-56.module+el8.8.0+18758+b3a9c8da.6
selinux-policy - 3.14.3-117.el8
selinux-policy-targeted - 3.14.3-117.el8

Additional notes:

This problem might very well affect other derivates of RHEL8.8 as well as other versions of RHEL, too.

Comment 10 errata-xmlrpc 2023-11-14 15:47:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7091