rbac-tool icon indicating copy to clipboard operation
rbac-tool copied to clipboard

Added functionality to fetch subresources

Open eightseventhreethree opened this issue 3 years ago • 1 comments

Added fetching subresources. The filtering mechanism is unchanged since the syntax is:

rbac-tool gen --deny-resources=clusterrolebindings.rbac.authorization.k8s.io,clusterroles.rbac.authorization.k8s.io,pods/exec. --allowed-verbs=get,list,watch

eightseventhreethree avatar Sep 15 '22 20:09 eightseventhreethree

https://github.com/alcideio/rbac-tool/issues/48

eightseventhreethree avatar Sep 15 '22 20:09 eightseventhreethree

@eightseventhreethree - thanks for the PR.

I looked into the change here and while it is minimal - it would change the entire behavior in a way that is likely broader then what one would intend.

subresources such as pods/exec have specific verbs that they support - the way that the code works today is by grouping rules for resources that share verbs.

The introduction of the change with existing code would create policies that are inaccurate - for example pods/exec with list verb - which is not supported/relevant and would create confusion.

Take a look at the output of the new command kubectl rbac-tool show - it should give a better color why supporting subresources requires a slightly different UX and implementation

gadinaor-r7 avatar Sep 30 '22 23:09 gadinaor-r7

@eightseventhreethree - thanks for the PR.

I looked into the change here and while it is minimal - it would change the entire behavior in a way that is likely broader then what one would intend.

subresources such as pods/exec have specific verbs that they support - the way that the code works today is by grouping rules for resources that share verbs.

The introduction of the change with existing code would create policies that are inaccurate - for example pods/exec with list verb - which is not supported/relevant and would create confusion.

Take a look at the output of the new command kubectl rbac-tool show - it should give a better color why supporting subresources requires a slightly different UX and implementation

Understood, however in it's current implementation it's also non functional since without the subresources the RBAC policy doesn't actually allow you access to the resources you have defined.

eightseventhreethree avatar Oct 03 '22 17:10 eightseventhreethree

@eightseventhreethree - i'll find time to further look into it .

gadinaor-r7 avatar Oct 20 '22 12:10 gadinaor-r7

kubectl rbac-tool show should provide enough functionality to address this

gadinaor-r7 avatar Nov 24 '22 12:11 gadinaor-r7