-
Notifications
You must be signed in to change notification settings - Fork 23
fix: remove unnecessary rbac rights for service accounts #1133
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
Conversation
Reviewer's GuideThis PR centralizes RBAC setup by extracting a generic Class Diagram: Structure of Removed Inline Per-Controller RBAC ActionsclassDiagram
class Removed_Inline_rbacAction {
<<Struct, Removed>>
+BaseAction
+Name() string
+CanHandle(ctx context.Context, instance ObjectType) bool
+Handle(ctx context.Context, instance ObjectType) *action.Result
# // Implementation for creating ServiceAccount,
# // Role, and RoleBinding using kubernetes.CreateOrUpdate.
# // This structure was removed from ctlog, fulcio, tuf,
# // rekor, and trillian controller action packages.
}
Removed_Inline_rbacAction : ObjectType varies (e.g., CTlog, Fulcio)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
650d513 to
34e7d0b
Compare
|
@sourcery-ai review |
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.
Hey @osmman - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Include default PolicyRules when using generic RBAC action (link)
General comments:
- Ensure each rbac.NewAction invocation includes the necessary PolicyRule(s) (e.g., configmaps and secrets) so that Roles aren’t created with empty rule sets.
- The
enabledhelpers inrekor/actions/uiandrekor/actions/backfillRedisare duplicating the same logic—consider centralizing that into a shared utility.
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 4 other issues
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Hey @osmman - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Hey @osmman - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
34e7d0b to
458e501
Compare
adeb4b3 to
417ac7f
Compare
|
@sourcery-ai review |
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.
Hey @osmman - I've reviewed your changes - here's some feedback:
- Ensure that controllers without any WithRule invocations still correctly delete their Roles and RoleBindings while preserving ServiceAccounts as before.
- Verify that each custom WithCanHandle callback (UI, backfill, DB, etc.) reproduces the original enabled-flag and status-condition logic exactly.
- Review the new split RBAC constants to confirm there are no naming collisions and that the generated resource names match existing deployments.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Hey @osmman - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
fef8c1e to
2acd40e
Compare
Fixes: SECURESIGN-2157 Signed-off-by: Tomas Turek <tturek@redhat.com>
2acd40e to
98827f1
Compare
Fixes: SECURESIGN-2157
Summary by Sourcery
Centralize and tighten RBAC permissions by replacing scattered controller-specific RBAC code with a generic RBAC action framework, define component-scoped RBAC names and rules, introduce a restricted RBAC action for TUF init jobs, refactor controllers to use the new pattern, and add unit tests for the new RBAC logic.
New Features:
Enhancements:
Tests: