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 - Policy for httpd to connect to Redis via TCP socket missing
Summary: Policy for httpd to connect to Redis via TCP socket missing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.8
Hardware: Unspecified
OS: Linux
medium
unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-10 12:31 UTC by Daniel Bodky
Modified: 2023-11-14 17:58 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.14.3-123.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-14 15:47:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-159441 0 None None None 2023-06-10 12:32:08 UTC
Red Hat Product Errata RHBA-2023:7091 0 None None None 2023-11-14 15:48:09 UTC

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


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