-
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
use configured algorithms for dynamic SSH host certs #46329
Conversation
@jakule do I need to keep the |
// Deprecated: this block will be removed in v17. It exists so users can | ||
// revert to the old behavior if necessary. | ||
// TODO(strideynet) DELETE IN 17.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@strideynet confirming, am I good to delete this for 17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup - all good to delete :)
2e879e0
to
c3d894b
Compare
This line was needed to make Teleport in Proxy recording more work nicely with OpenSSH 7.4 (default in CentOS 7). I'm not sure if we care about the Proxy recording mode anymore since we replace it with agentless. Since then also Go crypto added a few patches to be compatible with older buggy OpenSSH. The bottom line is, I'm not sure. I'd be very happy to remove it, but we can still break some compatibility. |
I think agentless is probably equivalent to proxy recording mode here since it's still terminating the incoming SSH connection at the proxy. But yeah with those crypto/ssh patches to support the buggy SSH clients I think it will work now without the HostKeyAlgorithms line. Hopefully people are using a recent proxy with those patches if they are using |
c3d894b
to
d814bc0
Compare
// auth and proxy benefit from precomputing keys since they can experience spikes in key | ||
// generation due to web session creation and recorded session creation respectively. | ||
// for all other agents precomputing keys consumes excess resources. | ||
if cfg.Auth.Enabled || cfg.Proxy.Enabled { | ||
native.PrecomputeKeys() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have switched to lazily starting the RSA key precomputation where we actually generate keys for web sessions or proxy-recorded sesssions/agentless sessions. It will now only start the first time we generate an RSA key, which will be never for the newer algorithm suites and should be acceptable even when using the legacy suite. Importantly, most tests will now never start the RSA key precomputation which will be a huge win for saving CPU time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific check was added to prevent agents from precomputing keys(#14021). Do the changes made here limit lazy precomputing of keys to auth and proxy as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, because now we exclusively start the key precomputation closer to where the keys are actually needed, in newWebSession or generateHostCert, which will only be called on auth or proxy
d814bc0
to
7dde2b8
Compare
@rosstimothy can I get an ExcludeFlake for
|
/excludeflake TestTSHConfigConnectWithOpenSSHClient |
This PR updates the SSH host keys/certs generated in
lib/reversetunnel/cache.go
to use the new configurable key algorithms described in RFD 136.To support this change, we need to stop writing a static list of supported
HostKeyAlgorithms
that excludes Ed25519 and ECDSA host certs into our generated OpenSSH config files. The defaults in recent OpenSSH versions are pretty good - we were actually making them unsafe by always including[email protected]
.We have been specifically including
HostKeyAlgorithms [email protected]
because OpenSSH disabled it by default before Go added server-side support for the newer SHA-2 based hashes. It seems safe to remove the entireHostKeyAlgorithms
line intsh
v17:tsh
v17 the oldest proxy you should be dialing is also v17, which definitely supports the new RSA SHA-2 algorithmsHostKeyAlgorithms
line:[email protected]
by default if the cluster uses thelegacy
algorithm suitelegacy
signature algorithm suite in their cluster.changelog: Removed HostKeyAlgorithms from generated OpenSSH config files