-
Notifications
You must be signed in to change notification settings - Fork 110
fix(operator): Restrict webhook and CRD permissions with resourceNames #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(operator): Restrict webhook and CRD permissions with resourceNames #638
Conversation
…ions in operator.yaml
…r.yaml and config_controller.go
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
enoodle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you for all your contributions! Please update the change log next time. I will do it on another PR soon for this change.
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
Description
This PR enhances the security posture of the KAI Scheduler operator by restricting RBAC permissions for webhook configurations and Custom Resource Definitions (CRDs) through the use of
resourceNamesfield.Changes
RBAC Operator Permissions (
deployments/kai-scheduler/templates/rbac/operator.yaml):Webhook Configurations - Added
resourceNamesrestrictions for:mutating-kai-admissionvalidating-kai-admissionkai-queue-validation-v2kai-podgroup-validation-v2alpha2Custom Resource Definitions - Added
resourceNamesrestrictions for:queues.scheduling.run.aiRationale
By adding the
resourceNamesfield to the RBAC ClusterRole, we follow the principle of least privilege by restricting the operator's permissions to only the specific resources it needs to manage, rather than allowing blanket access to all webhook configurations and CRDs in the cluster.Special thanks to @pabbanihanthkumarpab from the CCOE team for the valuable insights during the installation of KAI Scheduler into our enterprise cluster, which highlighted the importance of this security enhancement.
Related Issues
Fixes #
Checklist
Breaking Changes
No breaking changes. This is a security enhancement that restricts permissions to be more specific without affecting functionality.
Additional Notes
Security Considerations
This change improves cluster security by:
Testing Recommendations