Skip to content
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

Fix TLS Routing jumphost flow #11282

Merged
merged 11 commits into from
Mar 28, 2022
Merged

Conversation

smallinsky
Copy link
Contributor

@smallinsky smallinsky commented Mar 21, 2022

Issue: #11271

What

TLS Routing broke JumpHost access in case where leaf cluster is used as JumpHost. The JumpHost address is not properly propagated to makeProxySSHClient function call and alway root cluster is used.

How

Fix JumpHost address propagation. Also added support for case where JumpHost is set to Teleport proxy web port and proxy support TLS Routing.

@smallinsky smallinsky requested a review from r0mant March 21, 2022 14:35
@smallinsky smallinsky marked this pull request as ready for review March 21, 2022 17:44
@github-actions github-actions bot requested review from jakule and timothyb89 March 21, 2022 17:44
@github-actions github-actions bot added the tsh tsh - Teleport's command line tool for logging into nodes running Teleport. label Mar 21, 2022
lib/client/api.go Outdated Show resolved Hide resolved
lib/client/api.go Outdated Show resolved Hide resolved
lib/client/api.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smallinsky Can you also make sure it works with ssh -J before merging?

@@ -166,6 +174,57 @@ func testLeafClusterSSHAccess(t *testing.T, s *suite) {
require.NoError(t, err)
}

func testJumpHostSSHAccess(t *testing.T, s *suite) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think converting this test cases to a test table would make this test easier to understand.

tool/tsh/proxy_test.go Outdated Show resolved Hide resolved
// Check if JumpHost address is a proxy web address.
resp, err := webclient.Find(ctx, sshProxyAddr, tc.InsecureSkipVerify, nil)
// If JumpHost address is a proxy web port and proxy supports TLSRouting dial proxy with TLSWrapper.
if err == nil && resp.Proxy.TLSRoutingEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the error is returned here? Shouldn't be returned instead of "ignored"?

Copy link
Contributor Author

@smallinsky smallinsky Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on purpose if the call err != nil it means sshProxyAddr is not proxy web service flow should proceed with standard dialer.

@smallinsky
Copy link
Contributor Author

Tested it manually both following cases works:

  • jump host as left teleport proxy ssh port:
tsh ssh -J leaf.ice-berg.dev:33023 leafnode
  • TLS Routing enabled when leaf WebPort can be as jump host:
tsh ssh -J leaf.ice-berg.dev:33080 leafnode

@smallinsky smallinsky force-pushed the smallinsky/fix-tls-routing-jumphost branch from ef0006a to fa0e61a Compare March 25, 2022 15:40
@smallinsky smallinsky merged commit 9e1b887 into master Mar 28, 2022
@smallinsky smallinsky deleted the smallinsky/fix-tls-routing-jumphost branch March 28, 2022 10:31
smallinsky added a commit that referenced this pull request Mar 28, 2022
smallinsky added a commit that referenced this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants