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

Fetch groups for GSuite SSO. #2456

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Fetch groups for GSuite SSO. #2456

merged 1 commit into from
Jan 17, 2019

Conversation

klizhentas
Copy link
Contributor

Fixes #2455

This commit adds support for fetching
groups for GSuite SSO logins via
OIDC connector interface.

If OIDC connector has a special scope:

https://www.googleapis.com/auth/admin.directory.group.readonly

teleport will fetch user's group membership and populate
groups claim.

@klizhentas
Copy link
Contributor Author

@kontsevoy @russjones please review the PR and the referenced ticket - it includes documentation base too.

@kontsevoy
Copy link
Contributor

The code looks fine to me as always. Can we please make sure that the reference ticket won't get auto-closed when you mege? It needs to stay open with 'documentation' label.

@klizhentas
Copy link
Contributor Author

@kontsevoy sure, that's the plan

@klizhentas
Copy link
Contributor Author

@russjones ping

lib/auth/oidc.go Outdated
for {
if count > MaxPages {
warningMessage := "Truncating list of teams used to populate claims: " +
"hit maximum number pages that can be fetched from GitHub."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hit maximum number pages that can be fetched from GSuite."

count := 0
var groups []string
var nextPageToken string
collect:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd break this out into it's own function, seems like a lot packed into a single function.

Fixes #2455

This commit adds support for fetching
groups for GSuite SSO logins via
OIDC connector interface.

If OIDC connector has a special scope:

`https://www.googleapis.com/auth/admin.directory.group.readonly`

teleport will fetch user's group membership and populate
groups claim.
@klizhentas klizhentas merged commit 0fdad30 into branch/3.1 Jan 17, 2019
@klizhentas klizhentas deleted the sasha/gsuite branch January 17, 2019 00:56
klizhentas added a commit that referenced this pull request Jan 17, 2019
Fixes #2455

This commit adds support for fetching
groups for GSuite SSO logins via
OIDC connector interface.

If OIDC connector has a special scope:

`https://www.googleapis.com/auth/admin.directory.group.readonly`

teleport will fetch user's group membership and populate
groups claim.
klizhentas added a commit that referenced this pull request Jan 17, 2019
* Fetch groups for GSuite SSO. (#2456)

Fixes #2455

This commit adds support for fetching
groups for GSuite SSO logins via
OIDC connector interface.

If OIDC connector has a special scope:

`https://www.googleapis.com/auth/admin.directory.group.readonly`

teleport will fetch user's group membership and populate
groups claim.

* Pass kubernetes groups to the remote cluster. (#2484)

This commit allows remote cluster to reference
the kubernetes groups coming from the roles
of the main cluster in the trusted clusters
configuration.

For example, main cluster can have a user
with a role 'main' and kubernetes groups:

kube_groups: ['system:masters']

and SSH logins:

logins: ['root']

Remote cluster can choose to map
this 'main' cluster to it's own:
'remote-admin' cluster in the trusted cluster config:

role_map:
  - remote: 'main'
    local: 'remote-admin'

The role 'remote-admin' of the remote cluster
can now be templated to use the main cluster role main
logins and kubernetes_groups using variables:

logins: ['{{internal.logins}}']
kubernetes_groups: ['{{internal.kubernetes_groups}}']

This is possible because teleport now encodes
both values in X509 certificate metadata
and remote cluster passes these values as 'internal' traits
to the template engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants