-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Teleport-proxy does not serve updated https certificates without restart #3815
Comments
My bad. I actually saw that one and then skipped it when I read 'cert-manager', thinking it was a different situation. |
That's no problem - this explanation is more thorough anyway. I definitely want to see a fix for this issue and will try to see if we can get it worked on. |
I got hit by this one myself this morning.
At first I thought I'd failed to set up My current workaround is to add a post-renew hook to
|
@fspmarshall This is related to cluster upgrades. State machine that can cover CA rotation, but also other upgrades, like nodes, as well as proxy certificates. Watch file and trigger self-reload. |
We're running into this as well with Cloud. Fixing it in Teleport would be preferred as it would remove the need to do any sidecar shenanigans as a workaround. |
It seems that you can update the keys without restarting the service and do it in place where you can use (without knowing all details) we can add a flag to teleport config to autoupdate the keys. When enabled, we would listen to these files and once updated the TLSConfig.GetCertificate callback will make sure that the new keys will be used for the new connections. robustirc/robustirc@3b83e51 |
I have a preliminary patchset implementing certificate reloading functionality here: #9271 I would appreciate feedback on this |
Adding additional customers who've requested this feature, as well as requesting that it work for cert-manager as well for users deploying in a k8s environment. |
For the time being, we solved this by using https://github.com/stakater/Reloader. Once it's deployed you will need to add the annotation Once the |
This is a really important feature that's currently lacking. It is a security recommendation to keep certificates short lived, reason being; otherwise you need clients to do cert verification on massive CRLs. Especially when you have certificates issued by HashiCorp Vault you want to keep certs short lived (hours/days, not weeks) as Vault will keep a copy of the cert until it expires, it will not purge it from the store when it is revoked otherwise it wouldn't be able to serve the CRL. I'm not sure why everyone always wants to come up with difficult solutions, a 30 second refresh interval reading a cert pair from the filesystem would fit anyone's use case, no need to deal with filesystem notifications or other complicated handles. |
Thank you all for your suggestions and thoughts. I've had a quick look at this and formulated a bit of a plan for how we could implement this. Firstly, we'll need to detect changes to the certificate files on disk. This is a little more complex than first imagined as we'll need to make sure we gracefully handle the certificate file being updated before the key file and vice versa (e.g not crashing or stopping serving), as I imagine that some users will be manually For dynamically updating the certificates used by the listener, we can leverage the As for the actual implementation, I'd imagine a
To enable this functionality, we probably want to include an option within the configuration file until we know this is stable and behaves as expected. I think eventually it might be nice to automatically enable this by default, unless anyone can think of a reason why you wouldn't want this behaviour enabled. If anyone has any thoughts, please let me know, especially around whether or not we want to enable this functionality by default. I'm going to go ahead and assign myself to this issue and take ownership of this getting implemented at some point. I can't promise any real deadlines on this, but I fully agree that this is functionality that is needed. |
Description
We use short-lived SSL certificates from a private CA in our environment, and we have provisioned our private teleport-proxies to serve these short-lived https certificates. (teleport.yaml directive: proxy_service.https_cert_file)
It appears that when these short-lived certificates are rotated and placed on the server, the teleport service continues to pass the old certificate out. Obvs this is no good - we COULD code 'systemctl restart teleport' into the cert rotation, but much better for teleport to handle automated cert changes (so we don't have to force-disconnect users)!
What happened:
contents of proxy_service.https_cert_file changed, but teleport service did not reflect the change until after a restart
What you expected to happen:
the teleport service to accurately reflect the cert file after any possible updates without requiring a restart
How to reproduce it (as minimally and precisely as possible):
Helps to have your own CA, but you can spoof this, too!
Environment
Teleport version (use
teleport version
): Teleport Enterprise v4.2.10git:v4.2.10-0-g7fd6c7348 go1.13.2Tsh version (use
tsh version
): Teleport v4.2.10 git:v4.2.10-0-g7fd6c7348 go1.13.2OS (e.g. from
/etc/os-release
): CentOS Linux release 7.7.1908 (Core)Where are you running Teleport? (e.g. AWS, GCP, Dedicated Hardware): AWS EC2s, but treat it like baremetal
Browser environment
Relevant Debug Logs If Applicable
NA
gz#3739
The text was updated successfully, but these errors were encountered: