-
Notifications
You must be signed in to change notification settings - Fork 45
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
Tighten storage-operator permissions against Salt #2635
Changes from all commits
7bea636
c15890d
803d521
a32c774
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 |
---|---|---|
|
@@ -4,36 +4,63 @@ metadata: | |
creationTimestamp: null | ||
name: storage-operator | ||
rules: | ||
# For recording transition events | ||
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. Good idea to add comments in this file 👍 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. FWIW, if we update 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. Oh yeah... Debt ticket #2644 |
||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- nodes | ||
- services | ||
- endpoints | ||
- persistentvolumes | ||
- persistentvolumeclaims | ||
- events | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- '*' | ||
- create | ||
- patch | ||
# For setting up monitoring for itself | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- create | ||
- update | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
- daemonsets | ||
- replicasets | ||
- statefulsets | ||
verbs: | ||
- '*' | ||
- get | ||
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. Why does the storage-operator need to read deployments and replicasets? 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. It comes from |
||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
verbs: | ||
- get | ||
- create | ||
# For reading its own name and namespace | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
# For managing its lock | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
resourceNames: | ||
- storage-operator-lock | ||
verbs: | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
# NOTE: cannot scope "create" to a resourceName, see | ||
# https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources | ||
- create | ||
# For managing its own graceful termination | ||
- apiGroups: | ||
- apps | ||
resourceNames: | ||
|
@@ -42,24 +69,32 @@ rules: | |
- deployments/finalizers | ||
verbs: | ||
- update | ||
# For managing owned PVs | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- persistentvolumes | ||
verbs: | ||
- get | ||
- '*' | ||
# For reading a Node's MetalK8s version | ||
- apiGroups: | ||
- apps | ||
- "" | ||
resources: | ||
- replicasets | ||
- nodes | ||
verbs: | ||
- get | ||
# NOTE: we only use "get" in code, but the controller-runtime tooling uses | ||
# "list" and "watch" to manage a cache | ||
- list | ||
- watch | ||
# For every custom resource from this Operator | ||
- apiGroups: | ||
- storage.metalk8s.scality.com | ||
resources: | ||
- '*' | ||
verbs: | ||
- '*' | ||
# For reading device preparation details (formatting and mounting options) | ||
- apiGroups: | ||
- storage.k8s.io | ||
resources: | ||
|
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.
Ho, this was simpler than I thought ^^
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.
That's the theory, not working atm 😅
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.
OK it looks like it's working actually!