route based on match quality score#40559
Merged
fspmarshall merged 1 commit intomasterfrom Apr 18, 2024
Merged
Conversation
zmb3
reviewed
Apr 15, 2024
c04eb24 to
51277ce
Compare
rosstimothy
approved these changes
Apr 18, 2024
51277ce to
16d064c
Compare
zmb3
approved these changes
Apr 18, 2024
|
@fspmarshall See the table below for backport results.
|
fspmarshall
added a commit
that referenced
this pull request
Apr 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves the quality of teleport ssh routing by scoring matches, with stronger matches being given priority.
When a user attempts to ssh into a teleport node, the teleport proxy needs to decide what node to route to based on the host value typed in by the user. The proxy does this both by matching the exact literal and, if the user entered a valid hostname, by matching nodes whose IPs match the IPs associated with that hostname. This can lead to unexpected behavior when multiple nodes share the same IP address. Take the following example nodes:
Given the above, a user running
tsh ssh alice@node1.example.comshould be unambiguous, but ifnode1.example.comcorresponds to a valid DNS entry, the resolved IPs will make the match ambiguous becausenode2.example.comshares the same IP.This PR changes the behavior of route matching to prioritize nodes that match the literal value typed in by the user over indirect/resolved matches when both match kinds are present.
note: this change only affects routing to direct dial and agentless nodes. tunnel nodes continue to only be routable by ID/hostname, which are always considered direct matches.
changelog: fixed spurious ambiguous host errors in ssh routing