kubernetes-sigs / kubernetes-sigs/cluster-api

Minimize RBAC roles for controllers

Open
#6,554 14 comments 1 reaction 1 assignee Claimed by @chrischdi View on GitHub
help wanted kind/cleanup priority/important-longterm triage/accepted
Dominant language
Go
Stars
4.3k
Forks
1.6k
Avg merge
1d 3h
Merged PRs (30d)
113

Description

Following on from #https://github.com/kubernetes-sigs/cluster-api/pull/6510#discussion_r882538225

In Cluster API today we create RBAC manifests which are generated using kubebuilder tools. e.g.

https://github.com/kubernetes-sigs/cluster-api/blob/626ab4de03ef1e8f9b68e12bbfaf75e2cb0b4ffc/internal/controllers/clusterclass/clusterclass_controller.go#L42-L44

Many of our controllers seem to generate overly broad RBAC for themselves. e.g. many have the create verb when it is not used.
Removing these roles should have no impact on functitonality, minimize the capabilities of our controllers from a security perspective, and make our RBAC manifests more descriptive about what our controllers are actually doing.

We should audit the following controllers to minimize their RBAC roles:

- [ ] MachineHealthCheck
- [ ] Machinepool
- [ ] KubeadmConfig
- [ ] ClusterResourceSet
- [ ] Cluster
- [ ] Machine
- [ ] MachineDeployment
- [ ] MachineSet
- [ ] Topology/Cluster
- [ ] ClusterClass

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.