[MDEV-19268] TLS Setup Documentation Created: 2019-04-17 Updated: 2023-12-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Olaf van der Spek | Assignee: | Joe Cotellese |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
> You need to set the path to the server's X509 certificate by setting the ssl_cert system variable. Where does the server's X509 certificate come from? A guide like [1] suggests the admin can generate it himself. IMO this info should be included in the MariaDB docs. 1. https://www.cyberciti.biz/faq/how-to-setup-mariadb-ssl-and-secure-connections-from-clients/ 2. https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/ |
| Comments |
| Comment by Faustin Lammler [ 2019-09-11 ] | |
|
Hi Olaf! I believe the following documentation explains how to generate the X509 certificate: I am not sure if it was already linked from https://mariadb.com/kb/en/library/securing-connections-for-client-and-server/ by that time tough? Regarding the script that would automates all the steps, it would be nice but I don't know if there is sufficient demand for that? Also I am not sure how difficult it would be to cover all the cases... Regards, | |
| Comment by Olaf van der Spek [ 2019-09-11 ] | |
|
Ah, it's linked from the intro. Perhaps it could be linked from "Enabling TLS for MariaDB Server" too. | |
| Comment by Faustin Lammler [ 2020-09-21 ] | |
|
Hi GeoffMontee! There seems to be a slight difference in the certificate generation commands and format, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927289 and https://mariadb.com/kb/en/certificate-creation-with-openssl/#comment_4242. Do you think that we should integrate better the comment into the documentation or maybe create another documentation for YaSSL? Maybe greenman has a suggestion too? | |
| Comment by Geoff Montee (Inactive) [ 2020-09-21 ] | |
|
Hi faust,
That's right. There is no similar documentation for yaSSL, and that is intentional. yaSSL is a TLS library that is used by some MariaDB Server builds. There are no yaSSL client tools to create certificates. If your MariaDB Server build uses yaSSL, then you would still have to create your certificates using OpenSSL's tools.
To be honest, it looks like the current documentation in the KB already applies to this case. The Debian bug report says this:
If this is true, then this should be covered by this text in the KB:
Both of the commands quoted in the Debian bug report and the KB comment are in the above snippet, so it is not clear what needs to be fixed. (However, the text in the KB is partially incorrect, because there should be no "passphrase" if the -nodes option was provided. Regardless, it sounds like the actual commands shown on the page should work in this scenario.) Regardless, we'll try to make time to re-test these procedures on modern versions of Debian. | |
| Comment by Faustin Lammler [ 2020-09-22 ] | |
|
Hi GeoffMontee! I will be working in the next days in implementing automated TLS tests for the CI and I will comment here if I find errors in the doc. Regarding the size of the key, we may suggest users to use 4096 keys instead of 2048 but I have no strong opinion on that. We should maybe do a quick research about nowadays crypto best practice. Also I have no idea of MariaDB performance implication in changing key size. | |
| Comment by Faustin Lammler [ 2020-09-22 ] | |
|
I finally managed to use TLS and create a script for CI testing (see Here are some missing details in the documentation IMO:
Indeed, this seems very confusing to me, and I did not managed make it work with self signed certificates. See also | |
| Comment by Geoff Montee (Inactive) [ 2020-09-22 ] | |
|
Thanks for the feedback, faust. | |
| Comment by Olaf van der Spek [ 2020-10-04 ] | |
|
Shouldn't generating a self-signed certificate be as simple as – | |
| Comment by Faustin Lammler [ 2020-10-06 ] | |
|
Hi Olaf! But for production environment, as said earlier, Openssl comes with so many options and there are some necessary interaction with the user to configure the CA to it's needs. So it seems too complicated to me, but if you come with a suggestion, maybe we could add it to the documentation? Also, I see another problem, there should be a consensus on some options (size of the keys for instance), and I believe this is not the case. Finally, but this is a bit off-topic, I believe that there are also alternatives such as using VPN tunnels for those needs. OpenVPN or IPSec are of course well known and robust. But maybe still too complicated to setup. So I would also suggest taking a look at wireguard. Faustin |