Open synfinatic opened 4 months ago
I'm guessing the two primary AWS SDK's people use aws-sso is Boto3 and Go. What is interesting is they handle the CA bundle very differently.
The key thing here is that these files may or may not be under the control of the user. Users may find their company's endpoint software manages these files (inserting a corporate CA for MITM/etc) or whatever. So while it might be acceptable to document this for users, actually making it easy for them seems like a bad idea since the requirements will be all over the map
Looks like someone already built this, but it is EOL: https://github.com/mdbraber/acmeproxy
There are a few forks with some changes which implement some fixes it seems? One of them may work already? Seems like if I were to build my own, it should be based on https://github.com/mholt/acmez
Overview
Asking users to create/manage their own CA/SSL certificates for the ecs server running on
localhost
really sucks. Right now users can't use self-signed certs or certs signed by an internal-CA, but must use a public trusted CA by the AWS SDK. This will become more painful, as Google/etc are pushing for even shorter certificate lifetimes.What I would like to do is be able to help users to get valid certificates signed by Let's Encrypt for a custom FQDN which points at 127.0.0.1/localhost in a secure manner. This way, a user would point at
custom-host.aws-sso-cli.org
or something like that and only they would be able to get a signed cert for that FQDN.Since the private key would never leave the aws-sso SecureStore, there is no risk (more on that later) of MITM attacks due to DNS poisoning.
Solution
aws-sso ecs ssl configure --api-key $API_KEY --hostname $UNIQUE_HOSTNAME
aws-sso ecs ssl renew
-- would generate a new private key, CSR and upload it to the aws-sso-cli.org service.aws-sso
client and stored in the SecureStore for future use.Benefits
Challenges
Risks
https://localhost.example.com
is that they assume the app ships with the private key and can be extracted so someone else can generate a valid SSL cert and perform a MITM attack.Other Options
aws-sso
client. User will need to create their own LE account, own their own domain, etc. Less work for people, but still assumes a lot of users.aws-sso
CA.Conclusion
Letting users manually manage their SSL key/certificate lets savvy users who are very concerned with their security to deploy and manage this with strong security. But I suspect most users will not be able to easily get a signed cert by a trusted CA easily and will need something else.
It might be semi-possible to figure out how to manually add a custom CA to the
botocore/cacert.pem
file, but the location of this is highly dependent on a lot of variables. Not sure if there is an easy/programatic way to ask python to tell us. The downside of this is that every time the user updates theiraws-cli
package, we will need to re-add the CA.Probably best to wait a bit and see what AWS does with my bug report and see if they take it seriously?