Skip to content

Commit

Permalink
Restrict config.openshift.io/networks RBAC permissions
Browse files Browse the repository at this point in the history
This resource type is only used for network settings discovery to query
the "cluster" Network so restrict the RBAC to only "get" access to the
"cluster" resource name.

This applies to both the submariner-operator:

https://github.com/submariner-io/submariner/blob/85fea596f30b0e84d6962c92bb129a6b8bce8028/pkg/routeagent_driver/handlers/ovn/connection.go#L358

and route-agent components:

https://github.com/submariner-io/submariner/blob/85fea596f30b0e84d6962c92bb129a6b8bce8028/pkg/routeagent_driver/handlers/ovn/connection.go#L358

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis authored and skitt committed May 6, 2024
1 parent 586e350 commit 9d5ba43
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/rbac/submariner-operator/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ rules:
resources:
# Needed for network settings discovery
- networks
resourceNames:
- cluster
verbs:
- get
- list
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
3 changes: 2 additions & 1 deletion config/rbac/submariner-route-agent/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ rules:
- config.openshift.io
resources:
- networks
resourceNames:
- cluster
verbs:
- get
- list
- apiGroups:
- ""
resources:
Expand Down
6 changes: 4 additions & 2 deletions pkg/embeddedyamls/yamls.go
Original file line number Diff line number Diff line change
Expand Up @@ -2732,9 +2732,10 @@ rules:
resources:
# Needed for network settings discovery
- networks
resourceNames:
- cluster
verbs:
- get
- list
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down Expand Up @@ -2997,9 +2998,10 @@ rules:
- config.openshift.io
resources:
- networks
resourceNames:
- cluster
verbs:
- get
- list
- apiGroups:
- ""
resources:
Expand Down

0 comments on commit 9d5ba43

Please sign in to comment.