feat(bff): authorize endpoints based on kubeflow-userid and kubeflow-groups header #660
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Authorize endpoints based on kubeflow-userid and kubeflow-groups header
Description
This PR sits on top of #644
Important: THIS PR makes namespace parameter mandatory. It will require a FUP PR with frontend by @lucferbux to don't disrupt our develoopment
How this works?
Authorization is performed using Kubernetes SubjectAccessReview (SAR), which validates user access to resources.
kubeflow-userid
: Required header that specifies the user’s email. Access is checked directly for the user via SAR.kubeflow-groups
: Optional header with a comma-separated list of groups. If the user does not have access, SAR checks group permissions using OR logic. If any group has access, the request is authorized.Access to Model Registry List:
Access to Specific Model Registry Endpoints:
In this PR:
How Has This Been Tested?
Regular query filtering by namespace ([email protected] is a cluster admin)
Dora user cannot see services on kubeflow namespace
But can access on it's namespace
If I miss namespace:
If I add namespace
Dora user cannot access service directly
We now return 404 for a non existent service
Dora user has access for a service
Group permissions work (note that the user is invalid)
With the right groups
Right group for services
Wrong group for service
Merge criteria:
DCO
check)