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

{{internal.logins}} ignored on Teleport Enterprise roles #2561

Closed
lrt512 opened this issue Feb 13, 2019 · 14 comments
Closed

{{internal.logins}} ignored on Teleport Enterprise roles #2561

lrt512 opened this issue Feb 13, 2019 · 14 comments
Assignees

Comments

@lrt512
Copy link

lrt512 commented Feb 13, 2019

What happened:

We're doing a PoC of Teleport Enterprise in k8s without using SSO to start. Every user with the admin role has only the root login, even though the role has

  logins:
    - '{{internal.logins}}'
    - root

Very much an edge case, but entertaining.

What you expected to happen:

I was expecting the local user login to be propagated

How to reproduce it (as minimally and precisely as possible):

Just have a role where you have this

  logins:
    - '{{internal.logins}}'
    - root

In this case, tsh status will give only

Logins:     root

If you omit root and only give

  logins:
    - '{{internal.logins}}'

tsh login will return

*trace.AccessDeniedError this user cannot create SSH sessions, has no allowed logins

Environment:

  • Teleport version (use teleport version): Teleport Enterprise v3.1.5git:v3.1.5-0-g7621bbd5 go1.11.5
  • Tsh version (use tsh version): Teleport v3.1.5 git:v3.1.5-0-g7621bbd5 go1.11.5
  • OS (e.g. from /etc/os-release): Ubuntu 18.04.1
@klizhentas
Copy link
Contributor

Hey Larry, thanks for your report. We will look into it.

@klizhentas
Copy link
Contributor

And just to clarify, it's stopped working for existing users after upgrade or for new local users? If the latter, how did you add new users?

@lrt512
Copy link
Author

lrt512 commented Feb 13, 2019

I'm about to add some context, but all users are on a brand-new enterprise-trial-license deployment via the Helm chart.

Users are created with tctl users add --roles=admin bob

@lrt512
Copy link
Author

lrt512 commented Feb 13, 2019

A few bits of context. I played with this in several ways:

  1. Specifiying the login in the role logins, i.e.
# tctl get roles/admin
kind: role
metadata:
  name: admin
spec:
  allow:
    kubernetes_groups:
    - '{{internal.kubernetes_groups}}'
    logins:
    - '{{internal.logins}}'
    - ltremblay
    node_labels:
      '*': '*'

A tsh status then gives

Profile URL: https://teleport...
Logged in as: ltremblay
Cluster: teleport...
Roles: admin*
Logins: ltremblay
Valid until: 2019-02-14 02:04:51 -0500 EST [valid for 12h0m0s]
Extensions: permit-agent-forwarding, permit-port-forwarding, permit-pty

  1. Adding the login directly to the user's traits:
# tctl get users/ltremblay
kind: user
metadata:
  name: ltremblay
spec:
  created_by:
    time: 0001-01-01T00:00:00Z
    user:
      name: 00b119bc-923f-4d76-a6ab-88457baca6fb.teleport...
  expires: 0001-01-01T00:00:00Z
  roles:
  - admin
  status:
    is_locked: false
    lock_expires: 0001-01-01T00:00:00Z
    locked_time: 0001-01-01T00:00:00Z
  traits:
    kubernetes_groups: null
    logins:
    - ltremblay

And the output of tsh status is the same as in 1)

In these cases, login works as usual (after logging out, clearing out ~/.tsh for good measure, then logging in to get the reflected changes). It's a bit cumbersome to have to go back and add usernames to roles or user traits after the fact, though!

Of course, yes, SSO integration is the better choice.

@M0nsieurChat
Copy link

We've got the same problem for newly created users after upgrading to Teleport Enterprise v3.1.7git:v3.1.7-0-g44074d74 go1.11.5

@klizhentas klizhentas added this to the 4.1 "Seattle" milestone May 13, 2019
@klizhentas klizhentas removed this from the 4.1 "Seattle" milestone Jul 25, 2019
@sgargan
Copy link

sgargan commented Jul 25, 2019

Also seeing this since moving to enterprise, wasted a good chunk of evaluation time looking into it.

@russjones
Copy link
Contributor

russjones commented Jul 25, 2019

@lrt512 @M0nsieurChat @sgargan What was your expected behavior of {{internal.logins}}? Also, are you using Enterprise with an SSO provider or with local accounts?

It's a field that's used in OSS to propagate logins for local users through traits. tctl users add jsmith root,jsmith where "root" and "jsmith" become part of the services.User object under traits which then get filled into {{internal.logins}}.

For Enterprise users, the expectation is to add {{external.claimName}} to allow logins to be fetched from an identity provider.

@klizhentas klizhentas added this to the 4.1 "Seattle" milestone Jul 25, 2019
@klizhentas
Copy link
Contributor

alright, let's take another look into it in the context of 4.1

@M0nsieurChat
Copy link

M0nsieurChat commented Jul 26, 2019

@M0nsieurChat @sgargan What was your expected behavior of {{internal.logins}}? Also, are you using Enterprise with an SSO provider or with local accounts?

I don't know, my users were created like so (old syntax, I know ) :
tctl users add johndoe johndoe,ubuntu,root

The logins: dictionnary containing all the logins specificied would do the trick for me :)

We are using Enterprise with local accounts. We plan to switch on SAML by next year.

@russjones russjones self-assigned this Aug 6, 2019
@klizhentas
Copy link
Contributor

@russjones I don't think it's enough to unhide the flag to solve this issue - we should also re-add processing of internal trait in enterprise mode in addition to the external trait - something we don't do right now.

@russjones
Copy link
Contributor

@klizhentas We do process {{internal.logins}} in Enterprise. There is just no way to set it this trait on services.User which is what the --logins flag does.

@klizhentas
Copy link
Contributor

ok

@webvictim
Copy link
Contributor

I think I just got bitten by this bug as well.

@igtsekov
Copy link

I hit this issue also. Any fix/workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants