[MDEV-13362] implement –require_secure_transport option like in MySQL 5.7 Created: 2017-07-20  Updated: 2023-09-07  Resolved: 2020-03-24

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Fix Version/s: 10.5.2

Type: Task Priority: Critical
Reporter: Robert Dyas Assignee: Julius Goryavsky
Resolution: Fixed Votes: 3
Labels: SkySQL_Cloud

Issue Links:
Blocks
Problem/Incident
causes MDEV-32123 require_secure_transport doesn't allo... Closed

 Description   

Some users would like us to port the require_secure_transport system variable from MySQL 5.7:

Whether client connections to the server are required to use some form of secure transport. When this variable is enabled, the server permits only TCP/IP connections that use SSL, or connections that use a socket file (on Unix) or shared memory (on Windows). The server rejects nonsecure connection attempts, which fail with an ER_SECURE_TRANSPORT_REQUIRED error.

This capability supplements per-account SSL requirements, which take precedence. For example, if an account is defined with REQUIRE SSL, enabling require_secure_transport does not make it possible to use the account to connect using a Unix socket file.

It is possible for a server to have no secure transports available. For example, a server on Windows supports no secure transports if started without specifying any SSL certificate or key files and with the shared_memory system variable disabled. Under these conditions, attempts to enable require_secure_transport at startup cause the server to write a message to the error log and exit. Attempts to enable the variable at runtime fail with an ER_NO_SECURE_TRANSPORTS_CONFIGURED error.

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_require_secure_transport

Currently, if a user wants to require TLS for every connection made over the network, then every user account on the system needs to be created with "REQUIRE SSL" or one of the other TLS options. Porting this system variable would make it a lot easier to require TLS system-wide.

https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/#requiring-tls

https://mariadb.com/kb/en/library/create-user/#tls-options



 Comments   
Comment by Robert Dyas [ 2017-07-25 ]

Will this be assigned to anyone?

Comment by Sergei Golubchik [ 2017-08-05 ]

Eventually, yes. But it'll unlikely make it into 10.3, which has got too many scheduled features already...

Comment by Oleksandr Byelkin [ 2019-04-16 ]

I am not agree with changing REQUIRE SSL or other user options, it looks like more global server option which can be on and off.

but as soon as we already have mandatory SSL option for users I think it will not be super difficult to implement

Comment by Oleksandr Byelkin [ 2020-03-04 ]

OK to push!

Comment by Julius Goryavsky [ 2020-03-11 ]

Some mistakes related to Widnows have been fixed:
1) Named pipes added as a secure Window-based alternative to Unix sockets
2) Impoved mtr test
Updated patch here: https://github.com/MariaDB/server/commit/e9765e6d594d98ae52acf0c1278857cc6c7061cc

Comment by Oleksandr Byelkin [ 2020-03-24 ]

OK

Comment by Julius Goryavsky [ 2020-03-24 ]

Fixed, https://github.com/MariaDB/server/commit/28fabc86dbdb0a3fe08ad66d4550f8821ec66242#diff-dca2f11b2511ceff9960dc3bcd972d04

Generated at Thu Feb 08 08:05:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.