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

Adding groups support from request #2145

Closed
wants to merge 1 commit into from

Conversation

axel7083
Copy link

@axel7083 axel7083 commented Apr 7, 2023

Description

The oidc-authservice support the GROUPS_HEADER. In the current implementation the Groups field in the SubjectAccessReviewSpec is not used. Kubernetes have a build-in support for them.

The format for the value of GROUPS_HEADER is a string containing the groups separated with commas.

By default Kubeflow and specifically the authn-filter envoyFilter will not propagate the kubeflow-groups header only the kubeflow-userid, but this is only a configuration files, the changes in this PR will allow to get the groups the user is associated with, and create a subject review with its user-id (email) and groups.

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: axel7083
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tenzen-y
Copy link
Member

@axel7083 Thank you for creating this PR.

@apo-ger Do you remember the reason why we didn't support the feature for the user groups in katib-ui?

@apo-ger
Copy link
Contributor

apo-ger commented Apr 19, 2023

hey @tenzen-y, IIRC KF did not support user groups back then.

@tenzen-y
Copy link
Member

hey @tenzen-y, IIRC KF did not support user groups back then.

Ah, I see. Thank you for reminding me!
@apo-ger I'd be happy if you help us with reviewing this PR :)

@axel7083
Copy link
Author

axel7083 commented Apr 20, 2023

The Go Test / Unit Test (1.25.0) (pull_request) which failed surprise me a bit, I tried to reproduce it in local but got the following for the failing test

$ go mod download && make test ENVTEST_K8S_VERSION=1.25.0
[...]
ok      github.com/kubeflow/katib/pkg/controller.v1beta1/experiment     6.842s  coverage: 76.7% of statements
[...]

@andreyvelich
Copy link
Member

@axel7083 Yeah, that tests are flaky. I will restart it

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Overall looks good to me :)

user := r.Header.Get(USER_HEADER)
user = strings.Replace(user, USER_PREFIX, "", 1)

var groups []string
if header := r.Header.Get(GROUPS_HEADER); header != "" {
groups = strings.Split(header, ",")
Copy link
Member

Choose a reason for hiding this comment

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

Uhm. Probably, we should mention using , as a separator in the documentation.

@andreyvelich @johnugeorge Where should we notify users about this?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we have any documentation regarding the Katib UI auth. I think, we should create separate page for Katib UI, and move all relative docs there. For example, move this one: https://www.kubeflow.org/docs/components/katib/hyperparameter/#accessing-the-katib-ui.

@apo-ger @kimwnasptd @elenzio9 Do we have any place in the docs where we explain users how to use Kubeflow UIs ?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds great.
Also, adding more documentation for the Katib UI auth there would be better. Through I see the section, we don't mention the auth.

Copy link
Author

Choose a reason for hiding this comment

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

@tenzen-y do you want me to include in this PR a section in the accessing-the-katib-ui about the auth system ?

Copy link
Member

Choose a reason for hiding this comment

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

@axel7083 Let's wait until @apo-ger, @elenzio9 , or @kimwnasptd comment.
They were the main contributors to support authzn in Katib UI.

Copy link
Member

Choose a reason for hiding this comment

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

I meant we'd like to work on that at https://github.com/kubeflow/website.

@andreyvelich
Copy link
Member

Hi @axel7083, do we have enough time to finish this PR before our feature freeze date Aug 2nd to include it in the next Katib release ?

@axel7083
Copy link
Author

Hi @axel7083, do we have enough time to finish this PR before our feature freeze date Aug 2nd to include it in the next Katib release ?

As discussed with @kimwnasptd and @thesuperzapper in kubeflow#7085 Enabling RBAC Based on User Groups we aim for another approach than making the change of adding the support for another header.

The goal would probably to migrate out of oidc-authservice in favor of oauth2-proxy, making a JWT token propagate instead of a plain text header.

Closing this as will not be completed in this form.

@axel7083 axel7083 closed this Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants