cloud-ark / kubeplus

Kubernetes Operator for multi-instance multi-tenancy
https://cloudark.io/
Apache License 2.0
654 stars 78 forks source link

Effective permissions of a running application instance #1231

Open devdattakulkarni opened 5 months ago

devdattakulkarni commented 5 months ago

We should provide a kubectl plugin to find out the effective permissions of a Helm release.

KubePlus creates each application instance (Helm release) in a separate Namespace. The ServiceAccount with which this Helm release is running is scoped to this Namespace. While this provides some assurance of the runtime permissions that the Helm release is running with, it will be helpful to provide a kubectl plugin for this.

kubectl showpermissions <Resource-Composition> <Resource-Instance>

This should find out the ServiceAccount with which the underlying Helm release is running, and then query rolebinding/cluster rolebindings to find out what resources is this ServiceAccount a subject for.