Skip to content
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: rolebindingRolePodExecAttach check #1070

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

greg5813
Copy link
Contributor

@greg5813 greg5813 commented Oct 2, 2024

Fix the case of a RoleBinding that points to a ClusterRole.
In that case, we ignore the RoleBinding validation altogether since it will be evaluated by the rolebindingClusterRolePodExecAttach check.

This PR fixes the rolebindingRolePodExecAttach check

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

Fix the check of a RoleBinding that references a Role allowing pods/exec or pods/attach in the case that it points to a ClusterRole.

What changes did you make?

Modify the kind field value of the roleRef field of the RoleBinding from "Role" to "ClusterRole" in the schemaString

What alternative solution should we consider, if any?

NA

Fix the case of a RoleBinding that points to a ClusterRole.
In that case, we ignore the RoleBinding since it will be evaluated by the rolebindingClusterRolePodExecAttach check.
@vitorvezani
Copy link
Member

Thanks for your contribution Greg, I've added a test to avoid regressions in the future

Copy link
Member

@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!!

@sudermanjr sudermanjr merged commit 9b5438d into FairwindsOps:master Oct 2, 2024
4 checks passed
@greg5813 greg5813 deleted the patch-1 branch October 3, 2024 06:57
YuMuuu pushed a commit to YuMuuu/polaris that referenced this pull request Oct 3, 2024
* Fix: rolebindingRolePodExecAttach check

Fix the case of a RoleBinding that points to a ClusterRole.
In that case, we ignore the RoleBinding since it will be evaluated by the rolebindingClusterRolePodExecAttach check.

* add tests for role-binding that uses a cluster-role binding

---------

Co-authored-by: Vitor Vezani <vitor.vezani@fairwinds.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants