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

Provide ability to pull multiple domain groups from Google Workspace (formerly gsuite) #5521

Closed
stevenGravy opened this issue Feb 9, 2021 · 5 comments · Fixed by #9697
Closed
Assignees
Labels
c-gj Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements sso Used for single sign on related tasks.

Comments

@stevenGravy
Copy link
Contributor

Feature Request

Provide the ability to pull all or specific domain user groups within a Google Workspace. Currently only the user's specific @Domain groups will be retrieved.
Ex:
[email protected] in groups: [email protected], [email protected], [email protected], [email protected]

Only [email protected], and [email protected] will be retrieved as claims.

If the user was [email protected] then only [email protected] will be retrieved as a claim.

Motivation

Users may be assigned to multiple groups that use different sub-domains then the user. This allows for using all the group assignments for role to claim mapping.

Who's it for?

Pro, Enterprise, Cloud

@stevenGravy stevenGravy added the sso Used for single sign on related tasks. label Feb 9, 2021
@stevenGravy stevenGravy changed the title Provide ability to pull mutliple domain groups from Google Workspace Provide ability to pull multiple domain groups from Google Workspace (formerly gsuite) Feb 9, 2021
@stevenGravy
Copy link
Contributor Author

The google API allows for retrieving the domains in google workspace https://developers.google.com/admin-sdk/directory/reference/rest/v1/domains/list. This would require an additional permission given to a service account.

@pschisa pschisa added c-gj Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements labels Dec 9, 2021
@russjones
Copy link
Contributor

@atburke Take a look at how Google Workspace support was originally implemented below.

Similar to how at the moment your service account has to have the below OAuth scope.

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

You'll need to add one of the following (see link that @stevenGravy provided) to your service account and connector and check for these.

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

With that done, then you simply have to update gsuiteClient.fetchGroups to call the current endpoint and the new endpoint.

https://github.com/gravitational/teleport/blob/master/lib/auth/oidc.go#L659-L698

@russjones russjones assigned espadolini and unassigned atburke Jan 13, 2022
@espadolini
Copy link
Contributor

The current implementation of #9697 actually doesn't filter by domain, which is actually a behavior change. 😬

No scopes other than https://www.googleapis.com/auth/admin.directory.group.readonly or https://www.googleapis.com/auth/cloud-identity.groups.readonly are required, and nothing further has to be done other than removing the domain in the query. The API for transitive group memberships doesn't support that sort of filtering anyway, so to maintain the current behavior we have to do the filtering on our end, I think.

When I asked @klizhentas about it, he said he didn't remember why the claims were filtered by domain, so maybe we can just... stop doing that, instead?

@russjones
Copy link
Contributor

@espadolini Are you referring to this line, if we remove it we won't filter by domain?

https://github.com/gravitational/teleport/blob/master/lib/auth/oidc.go#L706

@espadolini
Copy link
Contributor

Yes, that's correct; it is a breaking change, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-gj Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements sso Used for single sign on related tasks.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants