What you would like to be added?
Tighten ClusterRole configmaps permissions so each KAI component only gets the verbs it actually needs:
The reason is that they never use the ConfigMap API; current full CRUD is leftover leader-election scaffolding.
Why is this needed?
Several ClusterRoles currently grant cluster-wide configmaps verbs (get/list/watch/create/update/patch/delete) via ClusterRoleBindings, so a compromised or buggy component can read and mutate ConfigMaps in every namespace.
Those write verbs come from leftover +kubebuilder:rbac markers next to lease-based leader election scaffolding and are merged by controller-gen even though the components already have coordination.k8s.io/leases permissions and do not need ConfigMaps for leader election. Reducing unused cluster-wide ConfigMap access lowers blast radius without changing binder/operator behavior.
I will make changes to this tomorrow
What you would like to be added?
Tighten ClusterRole
configmapspermissions so each KAI component only gets the verbs it actually needs:kai-admission,queuecontroller,kai-podgroup-controller, andkai-node-scale-adjuster#2061kai-admissionqueuecontrollerkai-podgroup-controllerkai-node-scale-adjusterThe reason is that they never use the ConfigMap API; current full CRUD is leftover leader-election scaffolding.
Limit
kai-schedulerandkai-podgroupertoget/list/watch(they only read ConfigMaps for scheduling predicates / optional defaults).Leave
kai-binderandkai-operatorConfigMap write permissions unchanged (they create/manage ConfigMaps as part of normal operation for pod in any of the namespace where the workload is created).Regenerate Helm RBAC manifests from updated
+kubebuilder:rbacmarkers and add chart unit tests so the least-privilege rules do not regress.Why is this needed?
Several ClusterRoles currently grant cluster-wide
configmapsverbs (get/list/watch/create/update/patch/delete) via ClusterRoleBindings, so a compromised or buggy component can read and mutate ConfigMaps in every namespace.Those write verbs come from leftover
+kubebuilder:rbacmarkers next to lease-based leader election scaffolding and are merged bycontroller-geneven though the components already havecoordination.k8s.io/leasespermissions and do not need ConfigMaps for leader election. Reducing unused cluster-wide ConfigMap access lowers blast radius without changing binder/operator behavior.I will make changes to this tomorrow