Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 152f48e

Browse files
authored
Merge pull request #2331 from thedadams/revert-sar-changes
Revert "Expand * verbs when doing SAR checks on images"
2 parents 4cfe634 + bf974ee commit 152f48e

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

pkg/roles/roles.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
},
3131
ClusterEdit: {
3232
{
33-
Verbs: []string{"create", "update", "delete", "deletecollection"},
33+
Verbs: []string{"create", "update", "delete"},
3434
Resources: []string{
3535
"projects",
3636
},
@@ -91,7 +91,7 @@ var (
9191
},
9292
Edit: {
9393
{
94-
Verbs: []string{"create", "update", "delete", "deletecollection", "patch"},
94+
Verbs: []string{"create", "update", "delete", "patch"},
9595
Resources: []string{
9696
"apps",
9797
"devsessions",
@@ -100,7 +100,7 @@ var (
100100
},
101101
},
102102
{
103-
Verbs: []string{"update", "delete", "deletecollection", "patch"},
103+
Verbs: []string{"update", "delete", "patch"},
104104
Resources: []string{
105105
"images",
106106
},
@@ -117,7 +117,7 @@ var (
117117
},
118118
},
119119
{
120-
Verbs: []string{"delete", "deletecollection"},
120+
Verbs: []string{"delete"},
121121
Resources: []string{
122122
"services",
123123
"volumes",
@@ -136,7 +136,7 @@ var (
136136
},
137137
Build: {
138138
{
139-
Verbs: []string{"create", "delete", "deletecollection"},
139+
Verbs: []string{"create", "delete"},
140140
Resources: []string{
141141
"builders",
142142
"acornimagebuilds",
@@ -151,7 +151,7 @@ var (
151151
},
152152
Admin: {
153153
{
154-
Verbs: []string{"create", "update", "delete", "deletecollection", "patch", "get", "list", "watch"},
154+
Verbs: []string{"create", "update", "delete", "patch", "get", "list", "watch"},
155155
Resources: []string{
156156
"projectvolumeclasses",
157157
"clustervolumeclasses",
@@ -163,7 +163,7 @@ var (
163163
APIGroups: []string{admin_acorn_io.Group},
164164
},
165165
{
166-
Verbs: []string{"create", "update", "delete", "deletecollection", "patch"},
166+
Verbs: []string{"create", "update", "delete", "patch"},
167167
Resources: []string{
168168
"imageallowrules",
169169
},

pkg/server/registry/apigroups/acorn/apps/validator.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,6 @@ func (s *RBACValidator) getSARResourceRole(sar *authv1.SubjectAccessReview, serv
439439
if len(rule.Verbs) == 0 {
440440
return nil, fmt.Errorf("can not deploy acorn due to requesting role with empty verbs")
441441
}
442-
if slices.Contains(rule.Verbs, "*") {
443-
rule.Verbs = v1.DefaultVerbs
444-
}
445442
if len(rule.Resources) == 0 {
446443
rule.Resources = []string{"*"}
447444
}

0 commit comments

Comments
 (0)