Upon issuing any of the above commands, Teleport will ignore the requested remote host login, and instead only use the first principal in the logins list to authenticate with the Teleport proxy.
This is problematic because you may have two roles that, when merged together, have differing role options. For example, one role may have agent forwarding enabled, while the other is disabled.
If the first principal in the logins list has agent forwarding disabled, and you're operating with proxy recording mode, you will get the following error from the tsh client.
error: failed connecting to node master. agent forwarding not requested or not authorized
What you expected to happen:
Teleport to respect role options for the specified remote login principal.
Reproduction Steps
As minimally and precisely as possible, describe step-by-step how to reproduce the problem.
Enable proxy recording mode. Create two roles. One with forward_agent: true and the other with forward_agent: false.
Set your SSO mapping to map both roles onto the user.
Authenticate with your cluster.
Run tsh login. In the output, observe which user is listed first. Is it root, admin, devops or admin, devops, root?
If root appears first, go back to your SSO mapping and reorder your role mappings to change the order of logins. Logout and log back in and admin, devops should be listed first.
Logins: admin, devops, root
Now, attempt tsh ssh root@<node>. You should run into the error. This should work, because root has permission to forward the agent. However, under the hood, Teleport is actually authenticating with admin.
error: failed connecting to node master. agent forwarding not requested or not authorized
Server Details
Teleport version (run teleport version): 6.0.2
Server OS (e.g. from /etc/os-release): 16.04.6 LTS (Xenial Xerus)
Where are you running Teleport? (e.g. AWS, GCP, Dedicated Hardware): AWS
Client Details
Tsh version (tsh version): 6.0.2
Computer OS (e.g. Linux, macOS, Windows): macOS
Browser version (for UI-related issues): N/A
Installed via (e.g. apt, yum, brew, website download): website download
Debug Logs
Please include or attach debug logs, when appropriate. Obfuscate sensitive information!
Start Teleport with --debug flag (teleport --debug)
Description
What happened:
Via RBAC, a Teleport user can be permitted to authenticate with more than one principal. The following role defines three principals (aka logins).
After authenticating with
tsh
. The following is displayed:This means, a user with the
admin
role can perform the following:OR
Upon issuing any of the above commands, Teleport will ignore the requested remote host login, and instead only use the first principal in the logins list to authenticate with the Teleport proxy.
This is problematic because you may have two roles that, when merged together, have differing role options. For example, one role may have agent forwarding enabled, while the other is disabled.
If the first principal in the logins list has agent forwarding disabled, and you're operating with proxy recording mode, you will get the following error from the
tsh
client.What you expected to happen:
Teleport to respect role options for the specified remote login principal.
Reproduction Steps
As minimally and precisely as possible, describe step-by-step how to reproduce the problem.
forward_agent: true
and the other withforward_agent: false
.tsh login
. In the output, observe which user is listed first. Is itroot, admin, devops
oradmin, devops, root
?root
appears first, go back to your SSO mapping and reorder your role mappings to change the order of logins. Logout and log back in andadmin, devops
should be listed first.tsh ssh root@<node>
. You should run into the error. This should work, because root has permission to forward the agent. However, under the hood, Teleport is actually authenticating withadmin
.Server Details
teleport version
): 6.0.2/etc/os-release
): 16.04.6 LTS (Xenial Xerus)Client Details
tsh version
): 6.0.2Debug Logs
Please include or attach debug logs, when appropriate. Obfuscate sensitive information!
teleport --debug
)tsh --debug
)