Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list my current RBAC roles and groups I belong to?

I authenticated to kubernetes cluster, how can I view my RBAC roles and groups attached to my current account?

like image 660
animekun Avatar asked Oct 14 '25 07:10

animekun


1 Answers

Found better tool

this tool looks way better than rakkess
exactly what I was looking for

https://github.com/reactiveops/rbac-lookup

In the simplest use case, rbac-lookup will return any matching user, service account, or group along with the roles it has been given.

rbac-lookup rob

SUBJECT                   SCOPE             ROLE
[email protected]           cluster-wide      ClusterRole/view
[email protected]           nginx-ingress     ClusterRole/edit
The wide output option includes the kind of subject along with the source role binding.
rbac-lookup ro --output wide

SUBJECT                   SCOPE             ROLE                SOURCE
User/[email protected]      cluster-wide      ClusterRole/view    ClusterRoleBinding/rob-cluster-view
User/[email protected]      nginx-ingress     ClusterRole/edit    RoleBinding/rob-edit
User/[email protected]      web               ClusterRole/edit    RoleBinding/ron-edit
ServiceAccount/rops       infra             ClusterRole/admin   RoleBinding/rops-admin
like image 150
animekun Avatar answered Oct 17 '25 10:10

animekun