mirror of
https://github.com/gravitational/teleport
synced 2024-10-21 09:44:51 +00:00
4092acaf87
Reduces latency creating ssh sessions via the web ui by: 1) No longer uses `TeleportClient.SSH` to establish a session 2) Reuses the user auth client for the web session to perform MFA ceremony 3) Ensures that connection attempts follow the flow outlined in RFD 93 The web api server now leverages the `proxy.Router` and `srv.SessionController` directly, instead of doing so indirectly via `TeleportClient.SSH`. Using the `TeleportClient` required an ssh connection to be established from the web api server to the proxy ssh server, which are in the same process. This added overhead can be avoided now that the routing logic and session control logic exists in a reusable component. To create an interactive session on the node once the connection is established, `client.NodeClient` is used. A new constructor was added to facilitate creating one and remove duplicated creation code and a `RunInteractiveShell` receiver method was added to allow callers outside of `lib/client` to spawn a session. `TerminalHandler.issueSessionMFACerts` used to check if per-session mfa was enabled and perform the mfa ceremony via the `client.ProxyClient` which was constructed with the `TeleportClient` established from connecting to the proxy ssh server. This would dial the Auth server under the hood directly and call `IsMFARequired` and do the ceremony if required. Each web session established via the web ui already established an auth client with the credentials of the logged in user. Again overhead is removed by leveraging the existing auth client and performing the mfa ceremony manually. Finally `TerminalHandler.makeClient` always attempted to perform the mfa ceremony prior to returning the `TeleportClient`. As outlined in [RFD 93](https://github.com/gravitational/teleport/blob/master/rfd/0093-offline-access.md), this causes additional latency and requires Auth connectivity to connect to nodes. The connection flow is now modified to attempt connection to the nodes first, and fall back to the mfa ceremony and reconnecting only if the node denies access. Partially addresses #15167 |
||
---|---|---|
.. | ||
app | ||
desktop | ||
mfajson | ||
scripts | ||
ui | ||
apiserver.go | ||
apiserver_login_test.go | ||
apiserver_ping_test.go | ||
apiserver_test.go | ||
apps.go | ||
assets.go | ||
conn_upgrade.go | ||
conn_upgrade_test.go | ||
connection_diagnostic.go | ||
cookie.go | ||
databases.go | ||
databases_test.go | ||
desktop.go | ||
desktop_playback.go | ||
envelope.pb.go | ||
files.go | ||
fuzz_test.go | ||
gziphandler.go | ||
join_tokens.go | ||
join_tokens_test.go | ||
mfa.go | ||
mfa_codec.go | ||
password.go | ||
resources.go | ||
resources_test.go | ||
servers.go | ||
sessions.go | ||
sessions_test.go | ||
sign.go | ||
static_test.go | ||
terminal.go | ||
users.go | ||
users_test.go | ||
web.go | ||
ws_io.go |