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

Show [Cluster]RoleBinding in rbac-tool lookup #96

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

cr7258
Copy link
Contributor

@cr7258 cr7258 commented Jan 5, 2024

Why

When I'm looking up the permissions (Role/ClusterRole) a user has, I might want to know how those permissions are bound in order to facilitate adjustments to the permissions.

What

Add a new column Binding to display RoleBinding or ClusterRoleBinding.

Before

rbac-tool lookup kube-controller-manager

  SUBJECT                        | SUBJECT TYPE   | SCOPE       | NAMESPACE   | ROLE
+--------------------------------+----------------+-------------+-------------+------------------------------------------------+
  kube-controller-manager        | ServiceAccount | Role        | kube-system | system::leader-locking-kube-controller-manager
  system:kube-controller-manager | User           | ClusterRole |             | system:kube-controller-manager
  system:kube-controller-manager | User           | Role        | kube-system | extension-apiserver-authentication-reader
  system:kube-controller-manager | User           | Role        | kube-system | system::leader-locking-kube-controller-manager

Now

rbac-tool lookup kube-controller-manager

  SUBJECT                        | SUBJECT TYPE   | SCOPE       | NAMESPACE   | ROLE                                           | BINDING
+--------------------------------+----------------+-------------+-------------+------------------------------------------------+---------------------------------------------------+
  kube-controller-manager        | ServiceAccount | Role        | kube-system | system::leader-locking-kube-controller-manager | system::leader-locking-kube-controller-manager
  system:kube-controller-manager | User           | ClusterRole |             | system:kube-controller-manager                 | system:kube-controller-manager
  system:kube-controller-manager | User           | Role        | kube-system | extension-apiserver-authentication-reader      | system::extension-apiserver-authentication-reader
  system:kube-controller-manager | User           | Role        | kube-system | system::leader-locking-kube-controller-manager | system::leader-locking-kube-controller-manager

@gadinaor gadinaor requested a review from gadinaor-r7 January 7, 2024 11:08
@gadinaor gadinaor added the enhancement New feature or request label Jan 7, 2024
Copy link
Contributor

@gadinaor-r7 gadinaor-r7 left a comment

Choose a reason for hiding this comment

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

LGTM

@gadinaor-r7 gadinaor-r7 merged commit fb6b567 into alcideio:master Jan 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants