Closed kontsevoy closed 7 years ago
I looked at the code. The remote users (i.e. users coming from remote clusters) do not have their "traits" available for evaluation against {{internal.logins}}
. I looked into ApplyTraits()
function and it always gets nil
for its second parameter.
By the way, here's my certificate, issued by the master cluster: (i.e. the cert I can't use to login):
ekontsevoy-cert.pub:
Type: ssh-rsa-cert-v01@openssh.com user certificate
Public key: RSA-CERT SHA256:vd9Rozqeun4AfcAizjnLWWNhLN2cG7/5RXf4huK6/Q8
Signing CA: RSA SHA256:SP/h9VeDELHurs5lKSFhdqbDqNqxdPoGdN7G6hw3HqE
Key ID: "ekontsevoy"
Serial: 0
Valid: before 2017-09-11T04:08:37
Principals:
ekontsevoy
root
Critical Options: (none)
Extensions:
permit-port-forwarding
permit-pty
teleport-roles UNKNOWN OPTION (len 38)
In both OSS and Enterprise mode we should evaluate SSH cert principals for internal.logins
and covert them to traits for remote trusted clusters. @russjones talk to me before doing this ticket.
Here when fetching roles, for remote users, we should call ApplyTraits
:
https://github.com/gravitational/teleport/blob/master/lib/srv/sshserver.go#L526
to allow roles to process internal.logins
The notion of "Role" is absent in the OSS Teleport. Therefore I have the following definition of a trusted cluster:
I successfully create it, because I have added the following snipped to
CheckAndSetDefaults()
:... basically added 'admin' role to the trusted cluster spec.
The trusted cluster is established and I can see it via
tsh clusters
. But when I try to connect, I get "access denied" and here's what I see in the logs:(with nicer formatting)
Dump of the trusted cluster:
So the role mapping appears to be set. Yet it still won't let me in even though I'm an admin.
Here's my "admin" role on the cluster that's denying me access: