Skip to content

Commit

Permalink
Fix permissions for userlist and filesystemlist subresources
Browse files Browse the repository at this point in the history
Allow admin, edit and review accounts get access.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Jul 29, 2021
1 parent ecf326b commit b2459f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/generated/operator-csv.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ spec:
- virtualmachineinstances/console
- virtualmachineinstances/vnc
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down Expand Up @@ -717,6 +719,8 @@ spec:
- virtualmachineinstances/console
- virtualmachineinstances/vnc
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down Expand Up @@ -778,6 +782,8 @@ spec:
- subresources.kubevirt.io
resources:
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down
6 changes: 6 additions & 0 deletions manifests/generated/rbac-operator.authorization.k8s.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ rules:
- virtualmachineinstances/console
- virtualmachineinstances/vnc
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down Expand Up @@ -619,6 +621,8 @@ rules:
- virtualmachineinstances/console
- virtualmachineinstances/vnc
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down Expand Up @@ -680,6 +684,8 @@ rules:
- subresources.kubevirt.io
resources:
- virtualmachineinstances/guestosinfo
- virtualmachineinstances/filesystemlist
- virtualmachineinstances/userlist
verbs:
- get
- apiGroups:
Expand Down
6 changes: 6 additions & 0 deletions pkg/virt-operator/resource/generate/rbac/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func newAdminClusterRole() *rbacv1.ClusterRole {
"virtualmachineinstances/console",
"virtualmachineinstances/vnc",
"virtualmachineinstances/guestosinfo",
"virtualmachineinstances/filesystemlist",
"virtualmachineinstances/userlist",
},
Verbs: []string{
"get",
Expand Down Expand Up @@ -212,6 +214,8 @@ func newEditClusterRole() *rbacv1.ClusterRole {
"virtualmachineinstances/console",
"virtualmachineinstances/vnc",
"virtualmachineinstances/guestosinfo",
"virtualmachineinstances/filesystemlist",
"virtualmachineinstances/userlist",
},
Verbs: []string{
"get",
Expand Down Expand Up @@ -308,6 +312,8 @@ func newViewClusterRole() *rbacv1.ClusterRole {
},
Resources: []string{
"virtualmachineinstances/guestosinfo",
"virtualmachineinstances/filesystemlist",
"virtualmachineinstances/userlist",
},
Verbs: []string{
"get",
Expand Down
2 changes: 2 additions & 0 deletions tests/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ var _ = Describe("[rfe_id:500][crit:high][vendor:[email protected]][level:compon
table.Entry("[test_id:3233]on vm stop", "virtualmachines", "stop", allowUpdateFor("admin", "edit"), denyAllFor("view", "default")),
table.Entry("[test_id:3234]on vm restart", "virtualmachines", "restart", allowUpdateFor("admin", "edit"), denyAllFor("view", "default")),
table.Entry("on vmi guestosinfo", "virtualmachineinstances", "guestosinfo", allowGetFor("admin", "edit", "view"), denyAllFor("default")),
table.Entry("on vmi userlist", "virtualmachineinstances", "userlist", allowGetFor("admin", "edit", "view"), denyAllFor("default")),
table.Entry("on vmi filesystemlist", "virtualmachineinstances", "filesystemlist", allowGetFor("admin", "edit", "view"), denyAllFor("default")),
)
})

Expand Down

0 comments on commit b2459f7

Please sign in to comment.