Red Hat Bugzilla – Bug 1491747
SELinux denies name_connect to mysql_port_t for tomcat_t
Last modified: 2018-04-10 08:44:27 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
*** Bug 1493278 has been marked as a duplicate of this bug. ***
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.
Robert, Yes, Fix will be part of RHEL-7.5. Lukas.
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 ?
Note: I wrote "at latest". I would like to see this in 7.4.z ideally, too.
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
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
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
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