Skip to content

Commit

Permalink
Use the escalate verb for clusterroleaggregator rather than cluster-a…
Browse files Browse the repository at this point in the history
…dmin permissions
  • Loading branch information
liggitt committed Aug 8, 2019
1 parent f4e39af commit 8b155e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -85,9 +85,8 @@ func buildControllerRoles() ([]rbacv1.ClusterRole, []rbacv1.ClusterRoleBinding)
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "clusterrole-aggregation-controller"},
Rules: []rbacv1.PolicyRule{
// this controller must have full permissions to allow it to mutate any role in any way
rbacv1helpers.NewRule("*").Groups("*").Resources("*").RuleOrDie(),
rbacv1helpers.NewRule("*").URLs("*").RuleOrDie(),
// this controller must have full permissions on clusterroles to allow it to mutate them in any way
rbacv1helpers.NewRule("escalate", "get", "list", "watch", "update", "patch").Groups(rbacGroup).Resources("clusterroles").RuleOrDie(),
},
})
addControllerRole(&controllerRoles, &controllerRoleBindings, rbacv1.ClusterRole{
Expand Down
Expand Up @@ -119,15 +119,16 @@ items:
name: system:controller:clusterrole-aggregation-controller
rules:
- apiGroups:
- '*'
- rbac.authorization.k8s.io
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
- clusterroles
verbs:
- '*'
- escalate
- get
- list
- patch
- update
- watch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down

0 comments on commit 8b155e8

Please sign in to comment.