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

Narrow down RBAC rules #2091

Merged
merged 21 commits into from
Jan 25, 2023
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions manifests/v1beta1/components/controller/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,45 @@ rules:
- ""
resources:
- configmaps
- serviceaccounts
- services
- events
- namespaces
verbs:
- "*"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need * for services ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

We do get/create/delete/watch

- apiGroups:
- ""
resources:
- serviceaccounts
- persistentvolumes
- persistentvolumeclaims
verbs:
- "get"
- "list"
- "watch"
- "create"
- apiGroups:
- ""
resources:
- secrets
verbs:
- "get"
- "create"
- "delete"
- apiGroups:
- ""
resources:
- namespaces
Copy link
Member

Choose a reason for hiding this comment

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

Do we need permission for namespace in the Controller @johnugeorge @tenzen-y ?

Copy link
Member

Choose a reason for hiding this comment

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

As I can see, we operate namespaces only from UI. So we can remove the permission for namespaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It is needed only in UI.

Copy link
Member Author

Choose a reason for hiding this comment

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

I retested it. Currently, Katib needs get/list/watch for namespaces as well. Need to investigate separately

verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- ""
resources:
- pods
- pods/log
- pods/status
- secrets
verbs:
- "*"
- "get"
- apiGroups:
- apps
resources:
Expand All @@ -32,7 +59,10 @@ rules:
- roles
- rolebindings
verbs:
- "*"
- "get"
- "create"
- "list"
- "watch"
- apiGroups:
- batch
resources:
Copy link
Member

Choose a reason for hiding this comment

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

@johnugeorge Should we limit scope for deployment, batch, and kubeflow.org jobs ?

Copy link
Member Author

Choose a reason for hiding this comment

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

we do get/create/delete/watch for all

Expand Down