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

Reduce Namespace Permissions #3563

Conversation

andrewballantyne
Copy link
Member

https://issues.redhat.com/browse/RHOAIENG-16822

Description

Reduces permissions for the SA around Namespaces. Removed deprecated/unused code to assist with the permissions reduction.

We only PATCH namespaces for model serving today.

How Has This Been Tested?

On a cluster, should be fine to just deploy it with the DSC DevFlag as the code that is removed was never called.

Test Impact

None

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@andrewballantyne andrewballantyne force-pushed the update-namespace-permissions branch from 506bd49 to 8ddce5b Compare December 10, 2024 20:23
@andrewballantyne andrewballantyne force-pushed the update-namespace-permissions branch from 8ddce5b to 4ed20a4 Compare December 10, 2024 21:05
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.41%. Comparing base (7977023) to head (4ed20a4).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3563      +/-   ##
==========================================
- Coverage   85.53%   85.41%   -0.13%     
==========================================
  Files        1378     1378              
  Lines       31244    31315      +71     
  Branches     8738     8761      +23     
==========================================
+ Hits        26724    26747      +23     
- Misses       4520     4568      +48     

see 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7977023...4ed20a4. Read the comment docs.

Copy link
Member

@Gkrumbach07 Gkrumbach07 left a comment

Choose a reason for hiding this comment

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

/lgtm

can still switch model serving platform

Copy link
Contributor

openshift-ci bot commented Dec 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gkrumbach07

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

The pull request process is described 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

@openshift-merge-bot openshift-merge-bot bot merged commit 5331d69 into opendatahub-io:main Dec 12, 2024
6 checks passed
@shalberd
Copy link
Contributor

shalberd commented Jan 13, 2025

@andrewballantyne How is the listing of data science projects in the GUI handled now that namespaces list is not part of the dashboard serviceaccount anymore?
Wondering mostly about namespace labels setting and so on, vs. projects and projectrequest and subjectaccessreview ...

Is this achieved via openshift api calls now, what you call pass-through calls?

And with the rights of the logged-in user for the central namespace and all data science projects namespaces instead of the dashboard serviceaccount? If yes, then the user in the dashboard admin group would need more privileges on all relevant namespaces, Admin to be specific.

I am trying to understand the new Auth CR in relation to operator v2 and dahboard in ODH, but cannot find it. Maybe I am also missing something in the docs.

Unclear to me what the operator does and what dashboard and what the logged-in dashboard user
i.e. what is this for: https://github.com/opendatahub-io/opendatahub-operator/blob/main/config/crd/external/config.openshift.io_authentications.yaml

@andrewballantyne
Copy link
Member Author

@shalberd hey, let me try to answer some of your inquires...

@andrewballantyne How is the listing of data science projects in the GUI handled now that namespaces list is not part of the dashboard serviceaccount anymore?

Nothing was ever listed like this by our service account. If you have access to seeing "all" the data science projects, that's because your user had K8s permissions to do so. This has not changed, your user is your user.

The Service Account does the following:

  • Some infrastructure fetching (who you are, groups, etc)
  • Components (Enabled/Explore/Resources pages)
  • Jupyter Tile
  • Admin functionality

This trimmed the permissions the service account had but never used. Should have no impact what so ever unless you were logging into the service account to do stuff.

Wondering mostly about namespace labels setting and so on, vs. projects and projectrequest and subjectaccessreview ...
Is this achieved via openshift api calls now, what you call pass-through calls?

Our Projects API has always been used through the "pass-through API" directly to K8s using your user's token.

I am trying to understand the new Auth CR in relation to operator v2 and dahboard in ODH, but cannot find it. Maybe I am also missing something in the docs.

Unclear to me what the operator does and what dashboard and what the logged-in dashboard user
i.e. what is this for: https://github.com/opendatahub-io/opendatahub-operator/blob/main/config/crd/external/config.openshift.io_authentications.yaml

There are no changes planned today to "remove access" to features already accessed. The Auth Resource moves the ownership of the group configs away from the Dashboard and into the hands of the Operator (aka Platform).

Platform will grant access to these groups what they need to do to do their role, effectively shifting our product admins (aka ODH Admins) away from using the service account over time... this will be a slow process. In the end, our Admin functionality will be removed from the list above of what our service account does... and the token of the admin will do it all.

In the end the goal will be simply more of a granular check of your admin permissions -- eg. If you want a partial admin (say a Notebook images only admin) you'd be able to craft a role and a binding for that user to do that functionality and get the UI to show up.

This is and will be done through SelfSubjectAccessReview (SSAR) checks on the admin pages themselves. Again, this will happen over time and it's unclear what priority this tech debt will be given.

Let me know if you have any other questions.

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.

3 participants