1

I'm trying to get my head around the use of SSL with MySQL replication. I've spent all day reading blog posts / articles about this, and I'm still no closer to getting an answer to this question:

Essentially I'm trying to understand the relationship between the ca, client & server files.

In my fictional setup I have:

1 x Master DB - Main Site
5 x Slave DBs - Main Site
Each Slave DB connects to a Slave DB on a remote (all different) Customer Site.

Am I right in thinking therefore that I would:

  1. generate the ca-cert.pem and ca-key.pem files on the Master DB
  2. create a set of client-xxx and server-xxx files on each Slave DB (and a copy of the ca-xxx.pem files)
  3. Onto each Customer DB I would copy the ca-cert.pem,client-cert.pem,client-key.pem from the matching Slave DB

If one of the customer DB's was compromised would I need to generate a new ca-cert.pem file on the master, and re-distribute it to all remaining slaves & customer DB's (requiring all my DB's to be restarted). Or could I just delete the server-cert.pem file from that one slave server?

(obviously I could revoke the username/password - but I'm trying to understand the SSL side at present).

2 Answers 2

1

Create the server and client cert/key files on the master server and then copy only the client cert/key files to each slave server and configure SSL replication. So basically you have the same client cert and key on all slave servers. If a slave gets compromised change the replication user's credentials.

2
  • But surely if I rely on the MySQL user credentials, then there is no need for the Client cert/key files. I can use the ca-cert file to encrypt the data. My understanding was the client files would become unique to that client/server pair. And then I could simply revoke those files to prevent a connection, Thus providing an additional layer of security over and above just relying on the MySQL user credentials.
    – IGGt
    Commented Jul 25, 2016 at 9:20
  • IMHO, The point of having SSL replication is to encrypt the replicated data on-the-wire. if you are worried about your servers getting compromised then You should make sure that appropriate safeguards are inplace to prevent it. Put your db servers behind a firewall or a vpn where you can revoke access individually. Commented Jul 25, 2016 at 10:14
1

The SSL keys are good for encrypting the transmission only - the data stored on the slaves, once transmitted, will be unencrypted. So, if a slave is compromised, the data will be compromised. It doesnt make any sense, as far as I understand, to protect the transmission key, if somebody will already have the entire data.

1
  • ok, but if customer1 is compromised, could they not 'potentially' use that key to try and access the other slave databases (assuming the rest of my security was quite lax)?
    – IGGt
    Commented Oct 14, 2016 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.