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 1491747 - SELinux denies name_connect to mysql_port_t for tomcat_t
Summary: SELinux denies name_connect to mysql_port_t for tomcat_t
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1493278 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-14 14:49 UTC by Billy Mailman
Modified: 2021-09-09 12:36 UTC (History)
14 users (show)

Fixed In Version: selinux-policy-3.13.1-174.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 12:43:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3174331 0 None None None 2017-10-19 09:18:57 UTC
Red Hat Product Errata RHBA-2018:0763 0 None None None 2018-04-10 12:44:27 UTC

Description Billy Mailman 2017-09-14 14:49:14 UTC
SELinux is denying tomcat from connecting to MySQL or MariaDB on port 3306, with the following AVC denial in the audit log:

type=AVC msg=audit(1505399902.845:357696): avc:  denied  { name_connect } for  pid=1168 comm="java" dest=3306 scontext=system_u:system_r:tomcat_t:s0 tcontext=system_u:object_r:mysqld_port_t:s0 tclass=tcp_socket

This worked without issue previously. This is likely the same problem as https://bugzilla.redhat.com/show_bug.cgi?id=1484572 , which reported this for MSSQL, but I'm not sure if that bug's fix will cover this, so I'm reporting here. Feel free to close this as a duplicate if appropriate.

Version of the SELinux policy RPMs is 3.13.1-166.el7_4.4

Comment 2 Lukas Vrabec 2017-09-20 11:55:49 UTC
*** Bug 1493278 has been marked as a duplicate of this bug. ***

Comment 5 Robert Scheck 2017-11-13 20:12:39 UTC
Cross-filed ticket 01972611 at the Red Hat customer portal.

I also requested there that this gets fixed at latest (!) for RHEL 7.5,
because this is a regression introduced by making Tomcat a confined domain.
Further, I am not sure in which release notes this incompatible change was 
documented, just found a knowledgebase article so far.

Comment 6 Lukas Vrabec 2017-11-14 08:37:14 UTC
Robert, 

Yes, Fix will be part of RHEL-7.5. 

Lukas.

Comment 7 msi_bacalm 2017-11-21 12:17:23 UTC
Hi All,

Seriously starting from 7.5.

In my opinion it shall be fixed still in 7.4.

The amount of bugzillas open for it shall increase severity to make it fix in 7.4, doesn't it ?

What is planned date of release of 7.5 ?

Comment 8 Robert Scheck 2017-11-21 12:20:54 UTC
Note: I wrote "at latest". I would like to see this in 7.4.z ideally, too.

Comment 9 Vladimir Mencl 2017-12-05 20:53:34 UTC
Hi,

I see support for mssql has been already rolled out in selinux-policy-3.13.1-166.el7_4.7: I can see this in policy-rhel-7.4.z-contrib.patch:

@@ -82,6 +85,7 @@ corenet_tcp_connect_amqp_port(tomcat_domain)
 corenet_tcp_connect_oracle_port(tomcat_domain)
 corenet_tcp_connect_ibm_dt_2_port(tomcat_domain)
 corenet_tcp_connect_unreserved_ports(tomcat_domain)
+corenet_tcp_connect_mssql_port(tomcat_domain)

 dev_read_rand(tomcat_domain)
 dev_read_urand(tomcat_domain)


And this can be easily extended to also support mysqld_t:

@@ -82,6 +85,8 @@ corenet_tcp_connect_amqp_port(tomcat_domain)
 corenet_tcp_connect_oracle_port(tomcat_domain)
 corenet_tcp_connect_ibm_dt_2_port(tomcat_domain)
 corenet_tcp_connect_unreserved_ports(tomcat_domain)
+corenet_tcp_connect_mssql_port(tomcat_domain)
+corenet_tcp_connect_mysqld_port(tomcat_domain)

 dev_read_rand(tomcat_domain)
 dev_read_urand(tomcat_domain)


Can we please have that out?  I'd prefer to avoid rolling out custom policies that permit tomcat_t to talk to mysqld_t (or have admins start saying: "Just disable SELinux"....)

Thanks a lot in advance!

Cheers,
Vlad

Comment 10 Skip Wyatt 2017-12-19 18:40:18 UTC
Rolling custom policies for something that should have worked out of the box in 7.4 are going to make peopl who are required to stay on minor versions very unhappy.

Can we get this in a zstream?

Best,
Skip

Comment 11 Skip Wyatt 2017-12-19 18:40:53 UTC
Rolling custom policies for something that should have worked out of the box in 7.4 are going to make people who are required to stay on minor versions very unhappy.

Can we get this in a zstream?

Best,
Skip

Comment 14 errata-xmlrpc 2018-04-10 12:43:43 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, 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-2018:0763


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