-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Aurora Serverless root certificate #2276
base: master
Are you sure you want to change the base?
Conversation
Mirror change to this project to align with the node-mysql2 PR here: sidorares/node-mysql2#1026
Thanks. Looks like there is a lint issue and also, should this be in the Amazon RDS profile? Isn't Aurora a separate product from RDS? (Don't take this as instructions to split, I'm just asking but ultimately unfamiliar with the AWS products). |
Aurora is not a separate product from RDS. Aurora, and Aurora Serverless are additional engines supported by Amazon RDS. The engines are listed here: https://aws.amazon.com/rds/ |
Ah, thanks. I will get this merged as soon as I can into a new minor release. |
Since this root certificate seems to be separate from all the rest, even in their documentation (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html vs https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html), would anyone object with me adding this cert under a new profile called |
In my case that’d be cumbersome because we connect to serverless Aurora and traditional Aurora interchangeably which means I believe we’d have to start tracking which profile to use with each specific database instead of just using the RDS profile. |
Right, but that would be the same if you connected to both Amazon RDS and a non Amazon SSL server. The SSL profiles are supposed to reflect each different type of system and not just all possible certificates. Why would Amazon use a different root CA for RDS vs Aurora? That to me makes it seem like a different SSL profile for how this module is set up. Especially since Amazon went and separated the docs for the Aurora SSL from all the RDS docs. Of course you can always define your own, custom SSL profile if you wanted to use a single one for convenience. |
I can't comment on why Amazon would choose a different root CA but from my perspective it's all RDS and when you connect you don't know whether it's Serverless or traditional RDS as that's an implementation detail from the client perspective. I'd prefer we keep the certificate in the same RDS profile. |
Gotcha, that's what I'm trying to understand. So by you don't know which you are connecting to, does that mean that Amazon just as a single "object" to create on or the other on the backend and they are just interchangeable? They all just share the same domain names or something? Like as an example, you could stand up a MySQL server instance inside AWS, which would end up with different SSL certificates. I'm trying to understand how these two are different, as they are not documented together. |
The servers are different from an implementation perspective. For example in Serverless Aurora Amazon manages the compute resources automatically whereas in traditional Aurora you manually manage the cluster. From the perspective of a client trying to connect to these databases it's no different. You have a host/port/user/password combination. |
So it does sound like from the SSL profile perspective they are just as different as if you stood up your own MySQL sevrer -- the certificate for your own server would not be within the existing profile, either. The SSL certificate to trust is an aspect of the host/port combination in this module, currently. You can always make your own, custom profile to trust a different subset of certificates that would encompass all the different types of endpoint you may connect to. This would be no different than if you added another MySQL server to the mix where it was just stood up on a VM inside the AWS environment. Looking at the Amazon RDS product page https://aws.amazon.com/rds/ seems to list MySQL (the current profile) distinct from Aurora (the SSL cert here). That's probably why they document them separately, as Amazon seems to be indicating they are separate from each other. |
From Amazon's perspective Aurora and Aurora Serverless are the same product. When you're provisioning an Aurora DB in the AWS Console you pick which one you want. As I mentioned previously from the client's perspective I don't believe it needs to understand the specific Aurora implementation that was chosen only that it's attempting to connect to an Aurora instance and hence use the existing |
I mean, the page I linked to above seems to say they are separate "engines":
If there is no page where Amazon just includes all these certs in one location, I am not convinced this is the same thing and they should be the same SSL profile. I am seeing a lot of evidence through out the docs where Amazon treats them as separate things, so it is more apparent to me that these are separate SSL profiles and the only arguments I've hear so far have no evidence that the argument would change if it was a Amazon RDS MySQL instance vs a standalone MySQL VM on AWS. |
I have a suspicion we're not referring to the same thing. Can you clarify your perspective? Amazon Aurora is Amazon's engine that is compatible with both MySQL and PostgreSQL. When you provision a MySQL compatible Amazon Aurora engine today you can use the existing |
The RDS page https://aws.amazon.com/rds/ lists 6 different "database engines" to choose from:
Amazon Aurora https://aws.amazon.com/rds/aurora/ is listed distinctly from MySQL https://aws.amazon.com/rds/mysql/ The documentation says that the Amazon Aurora certs are https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html and the MySQL certs are https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html In what way are they the "same thing" from the SSL perspective? |
The existing |
Oh, sorry, I didn't realize that. Which certs in the current profile are Aurora certs? |
I can't tell you exactly without printing the certs for my Aurora DBs and even then it might not represent both. What I can say however is the Amazon Aurora MySQL docs noted here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Security.html link directly to these docs for root RDS certs https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html |
My read on those docs is:
ACM is the top level they use for automated provisioning for domain validated certificates. After validating that you're in control of a given domain (ex: example.com), they'll let you issue certs for *.example.com. That let's you automatically set up things like HTTP load balancers that identify as "foo.example.com" and have it work in your web browser without cert errors. For serverless they're using the same infrastructure so the certificate for the DB is signed by the ACM CA. IIUC, it should work out of the box with up to date system level certificate chains as the ACM CA itself is trusted. If not, including that top level CA in the chain alongside the RDS ones should work for both regular and serverless RDS. Reference:
That last part links to this cert: https://www.amazontrust.com/repository/AmazonRootCA1.pem
You likely have that cert already in your local /etc/ssl/certs. I'm not sure if node / this driver falls back to verifying against that system wide trust store (maybe it only does that if the cert fields are totally blank). If not then including it in the chain should work and I think cover things up to 2038. |
Thanks for that information @sehrope . So it sounds like the serverless RDS is set up with different certificate chains because it seems like the profile this module has is basically "legacy". I found even more information on this, and it seems like Amazon operates it's own set of CAs for all services managed though ACM. All of those roots (including the one included in this PR) can be found here: https://www.amazontrust.com/repository/ It seems like we should add a new profile to this module called simply "Amazon" and include all these core Amazon CAs. The Amazon RDS profile can stay the same with the current CAs that are specific to RDS. The main difference is that the current Amazon RDS profile will only trust actual Amazon RDS endpoints, while the new Amazon profile (which includes this cert) can trust any service one wants to set up on Amazon. But even that is likely unnecessary, as those Amazon CAs (including the one added here) is signed by Starfield Services Root Certificate Authority - G2, which is in turn signed by Starfield Class 2 Certification Authority. Node.js already trusts this, and so connecting to these services is already trusted by Node.js without a custom profile needed at all :) ! |
Mirror change to this project to align with the node-mysql2 PR here: sidorares/node-mysql2#1026