-
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
Conversation
✅ Deploy Preview for karpenter-docs-prod canceled.
|
- apiGroups: ["admissionregistration.k8s.io"] | ||
resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"] | ||
verbs: ["get", "watch", "list"] | ||
# Write |
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!
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
resources: ["configmaps", "namespaces", "secrets"] | ||
verbs: ["get", "list", "watch"] |
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.
Can we scope this down to the specific ConfigMaps (logging, batchingConfig) and Secrets that we need via resourceNames
?
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.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Created the role
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
resourceNames:
- karpenter-global-settings
- karpenter-leader-election
- config-logging
karpenter-6746fb6c66-m7ttl controller E0621 17:29:47.216205 1 reflector.go:138] k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1.ConfigMap: failed to list *v1.ConfigMap: configmaps is forbidden: User "system:serviceaccount:karpenter:karpenter" cannot list resource "configmaps" in API group "" in the namespace "karpenter"
Get is subsumed by list, so I don't see the value in restricting get.
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.
LGTM
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.
lgtm
Chart Version: 0.12.0
|
Fixes #973
Description
Tighten RBAC permissions
How was this change tested?
make test
make apply
Does this change impact docs?
Release Note
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.