mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #81199 from liggitt/narrow-aggregation-permissions
Use the escalate verb for clusterroleaggregator rather than cluster-admin permissions
This commit is contained in:
commit
77c9e98198
@ -85,9 +85,8 @@ func buildControllerRoles() ([]rbacv1.ClusterRole, []rbacv1.ClusterRoleBinding)
|
|||||||
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
||||||
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "clusterrole-aggregation-controller"},
|
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "clusterrole-aggregation-controller"},
|
||||||
Rules: []rbacv1.PolicyRule{
|
Rules: []rbacv1.PolicyRule{
|
||||||
// this controller must have full permissions to allow it to mutate any role in any way
|
// this controller must have full permissions on clusterroles to allow it to mutate them in any way
|
||||||
rbacv1helpers.NewRule("*").Groups("*").Resources("*").RuleOrDie(),
|
rbacv1helpers.NewRule("escalate", "get", "list", "watch", "update", "patch").Groups(rbacGroup).Resources("clusterroles").RuleOrDie(),
|
||||||
rbacv1helpers.NewRule("*").URLs("*").RuleOrDie(),
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
|
||||||
|
@ -119,15 +119,16 @@ items:
|
|||||||
name: system:controller:clusterrole-aggregation-controller
|
name: system:controller:clusterrole-aggregation-controller
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- '*'
|
- rbac.authorization.k8s.io
|
||||||
resources:
|
resources:
|
||||||
- '*'
|
- clusterroles
|
||||||
verbs:
|
verbs:
|
||||||
- '*'
|
- escalate
|
||||||
- nonResourceURLs:
|
- get
|
||||||
- '*'
|
- list
|
||||||
verbs:
|
- patch
|
||||||
- '*'
|
- update
|
||||||
|
- watch
|
||||||
- apiVersion: rbac.authorization.k8s.io/v1
|
- apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
metadata:
|
metadata:
|
||||||
|
Loading…
Reference in New Issue
Block a user