Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1491747 - SELinux denies name_connect to mysql_port_t for tomcat_t
SELinux denies name_connect to mysql_port_t for tomcat_t
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
7.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Lukas Vrabec
Milos Malik
:
: 1493278 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-14 10:49 EDT by Billy Mailman
Modified: 2018-04-10 08:44 EDT (History)
14 users (show)

See Also:
Fixed In Version: selinux-policy-3.13.1-174.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 08:43:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3174331 None None None 2017-10-19 05:18 EDT
Red Hat Product Errata RHBA-2018:0763 None None None 2018-04-10 08:44 EDT

  None (edit)
Description Billy Mailman 2017-09-14 10:49:14 EDT
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 07:55:49 EDT
*** Bug 1493278 has been marked as a duplicate of this bug. ***
Comment 5 Robert Scheck 2017-11-13 15:12:39 EST
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 03:37:14 EST
Robert, 

Yes, Fix will be part of RHEL-7.5. 

Lukas.
Comment 7 msi_bacalm 2017-11-21 07:17:23 EST
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 07:20:54 EST
Note: I wrote "at latest". I would like to see this in 7.4.z ideally, too.
Comment 9 Vladimir Mencl 2017-12-05 15:53:34 EST
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 13:40:18 EST
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 13:40:53 EST
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 08:43:43 EDT
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.