[v17] fix: tsh label based commands always running serially#63611
Merged
rosstimothy merged 1 commit intobranch/v17from Feb 9, 2026
Merged
[v17] fix: tsh label based commands always running serially#63611rosstimothy merged 1 commit intobranch/v17from
rosstimothy merged 1 commit intobranch/v17from
Conversation
When using tsh ssh user@foo=bar uptime, the command is supposed to be run in parallel on all matching hosts unless Per-Session MFA is required, or the user has a restriction on the number of concurrent sessions. To determine if limits are enforced, tsh would list roles and take the maximum from all of them and add with a small buffer to prevent exceeding the limit. It turns out that this only works for users that have permissions to read Role resources. ListRoles does **not** return the roles of the current user if they do not have permissions to read roles like GetRole does. The result is that users that cannot read roles have all of the command run serially instead of in parallel even if they have _no_ connection limits in their roles. It looks like this has been the case for GetRoles and ListRoles since their inception. This has likely gone unnoticed because this is either a very uncommon workflow, or the users performing this regularly have read permissions for Role resources. There does exist an RPC that provides a user with all of the roles they are assigned regardless of their permissions: GetCurrentUserRoles. This RPC is now used in place of ListRoles when determining connection limits in tsh label based ssh.
espadolini
approved these changes
Feb 9, 2026
okraport
approved these changes
Feb 9, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
When using tsh ssh user@foo=bar uptime, the command is supposed to be run in parallel on all matching hosts unless Per-Session MFA is required, or the user has a restriction on the number of concurrent sessions. To determine if limits are enforced, tsh would list roles and take the maximum from all of them and add with a small buffer to prevent exceeding the limit. It turns out that this only works for users that have permissions to read Role resources. ListRoles does **not** return the roles of the current user if they do not have permissions to read roles like GetRole does. The result is that users that cannot read roles have all of the command run serially instead of in parallel even if they have _no_ connection limits in their roles. It looks like this has been the case for GetRoles and ListRoles since their inception. This has likely gone unnoticed because this is either a very uncommon workflow, or the users performing this regularly have read permissions for Role resources. There does exist an RPC that provides a user with all of the roles they are assigned regardless of their permissions: GetCurrentUserRoles. This RPC is now used in place of ListRoles when determining connection limits in tsh label based ssh.
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.
Backport #63555 to branch/v17
changelog: Fixed
tsh ssh user@foo=bar uptimefrom running serially if users did not haverole:readpermissions.