Skip to content

Commit

Permalink
fix: Use least privileges for CM role (#18)
Browse files Browse the repository at this point in the history
Removing unnecessary permissions.
  • Loading branch information
jimmidyson authored Sep 4, 2024
1 parent 73f6785 commit 069b742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
21 changes: 2 additions & 19 deletions charts/cluster-api-ipam-provider-nutanix/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ rules:
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- ipaddressclaims/status
- ipaddressclaims/finalizers
- ipaddresses/finalizers
- nutanixippools/finalizers
verbs:
- update
- apiGroups:
Expand Down Expand Up @@ -85,24 +86,6 @@ rules:
resources:
- nutanixippools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- nutanixippools/finalizers
verbs:
- update
- apiGroups:
- ipam.cluster.x-k8s.io
resources:
- nutanixippools/status
verbs:
- get
- patch
- update
5 changes: 2 additions & 3 deletions internal/controllers/ipaddressclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,12 @@ func (i *NutanixProviderAdapter) ClaimHandlerFor(
}
}

// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=nutanixippools,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=nutanixippools/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=nutanixippools,verbs=get;list;watch
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=nutanixippools/finalizers,verbs=update
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims,verbs=get;list;watch;update;patch
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddresses,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims/status;ipaddresses/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims/status;ipaddresses/finalizers,verbs=update
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims/finalizers;ipaddresses/finalizers,verbs=update
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=secrets;configmaps,verbs=get;list;watch

Expand Down

0 comments on commit 069b742

Please sign in to comment.