-
Notifications
You must be signed in to change notification settings - Fork 980
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
Chore: Tighten RBAC permissions #1954
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,25 +10,34 @@ metadata: | |
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["configmaps"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: [""] | ||
resources: ["configmaps/status"] | ||
verbs: ["get", "update", "patch"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create"] | ||
# Read | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["create", "get", "patch", "update", "watch"] | ||
verbs: ["get", "watch"] | ||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
resources: ["configmaps", "namespaces", "secrets"] | ||
verbs: ["get", "list", "watch"] | ||
Comment on lines
17
to
19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we scope this down to the specific ConfigMaps (logging, batchingConfig) and Secrets that we need via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you can't restrict list requests by resource name, but we need list/watch for the informer. Since these are read permissions, I think this is acceptable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we can't restrict list, can we atleast restrict get and watch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created the role
Get is subsumed by list, so I don't see the value in restricting get. |
||
# Write | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create"] | ||
- apiGroups: [""] | ||
resources: ["secrets"] | ||
verbs: ["update"] | ||
resourceNames: ["{{ include "karpenter.fullname" . }}-cert"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: [""] | ||
resources: ["secrets"] | ||
verbs: ["get", "list", "watch"] | ||
resources: ["configmaps"] | ||
verbs: ["create", "update", "patch", "delete"] | ||
resourceNames: | ||
- karpenter-global-settings | ||
- karpenter-leader-election | ||
- config-logging | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["create", "patch", "update"] | ||
resourceNames: | ||
- "karpenter-leader-election" | ||
- "webhook.configmapwebhook.00-of-01" | ||
- "webhook.defaultingwebhook.00-of-01" | ||
- "webhook.validationwebhook.00-of-01" | ||
- "webhook.webhookcertificates.00-of-01" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like that we're separating out the Read and Write permissions!