Skip to content

rbac: replace wildcard with a clear list of allowed verbs#6233

Merged
zhangzujian merged 1 commit intokubeovn:masterfrom
zhangzujian:fix-rbac
Feb 2, 2026
Merged

rbac: replace wildcard with a clear list of allowed verbs#6233
zhangzujian merged 1 commit intokubeovn:masterfrom
zhangzujian:fix-rbac

Conversation

@zhangzujian
Copy link
Copy Markdown
Member

Pull Request

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes

Fixes #(issue-number)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zhangzujian, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the Role-Based Access Control (RBAC) configurations within Kube-OVN by moving away from broad wildcard permissions. It explicitly defines the allowed actions for specific resources, enhancing security and clarity in access management.

Highlights

  • RBAC Verb Specificity: Replaced the wildcard "*" verb with an explicit list of allowed verbs (create, get, list, update, patch, watch, delete) for qos-policies and qos-policies/status resources in RBAC configurations.
  • Lease Resource Permissions: Updated the RBAC rules for leases resources, replacing the wildcard verb with a specific list (create, update, patch, get, watch) and adding a resourceNames constraint to kube-ovn-controller.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the security of Kube-OVN by adhering to the principle of least privilege in its RBAC configuration. The changes replace wildcard verb permissions with an explicit list of required verbs for various resources. A significant improvement is scoping the permissions for leader election leases to a specific resource name, which greatly reduces the potential attack surface. These changes are applied consistently across both Helm chart versions and the installation script. The implementation is correct and enhances the overall security posture of the project.

Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21505206718

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 22.933%

Files with Coverage Reduction New Missed Lines %
pkg/ovs/ovn-nb-logical_router_route.go 2 74.6%
Totals Coverage Status
Change from base Build 21504907115: 0.0%
Covered Lines: 12330
Relevant Lines: 53765

💛 - Coveralls

@zhangzujian zhangzujian marked this pull request as ready for review January 30, 2026 05:45
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 30, 2026
@zhangzujian zhangzujian requested a review from oilbeater January 30, 2026 05:45
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 30, 2026
@zhangzujian zhangzujian merged commit 7cd3789 into kubeovn:master Feb 2, 2026
77 checks passed
@zhangzujian zhangzujian deleted the fix-rbac branch February 2, 2026 01:00
@dosubot
Copy link
Copy Markdown

dosubot bot commented Feb 2, 2026

Related Documentation

No published documentation to review for changes on this repository.

Write your first living document

How did I do? Any feedback?  Join Discord

zhangzujian added a commit that referenced this pull request Feb 2, 2026
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
zhangzujian added a commit that referenced this pull request Feb 2, 2026
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
zbb88888 pushed a commit to qiniu/kube-ovn that referenced this pull request Feb 2, 2026
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer need backport security size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants