All Projects → team-soteria → Rback

team-soteria / Rback

Licence: apache-2.0
RBAC in Kubernetes visualizer

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Rback

setup-graphviz
▶️ GitHub Action to set up Graphviz cross-platform(Linux, macOS, Windows).
Stars: ✭ 20 (-92.98%)
Mutual labels:  graphviz
vscode-graphviz
This extension provides GraphViz (dot) language support for VS Code.
Stars: ✭ 21 (-92.63%)
Mutual labels:  graphviz
Octopus
🐙 Octopus - Internal wiki with diagrams for software and product teams
Stars: ✭ 274 (-3.86%)
Mutual labels:  graphviz
rbac
RBAC - Simple, concurrent Role Based Access Control(GO)
Stars: ✭ 67 (-76.49%)
Mutual labels:  rbac
caddy-authorize
Authorization Plugin for Caddy v2 (JWT/PASETO)
Stars: ✭ 235 (-17.54%)
Mutual labels:  rbac
Krane
Kubernetes RBAC static Analysis & visualisation tool
Stars: ✭ 254 (-10.88%)
Mutual labels:  rbac
sequelize-adapter
Sequelize adapter for Casbin
Stars: ✭ 51 (-82.11%)
Mutual labels:  rbac
Blog.core
💖 ASP.NET Core 6.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
Stars: ✭ 3,542 (+1142.81%)
Mutual labels:  rbac
graphviz-react
React component for displaying Graphviz graphs
Stars: ✭ 65 (-77.19%)
Mutual labels:  graphviz
Go Erd
Go-ERD (Entity Relationship Diagrams) for Golang with Graphviz [WIP]
Stars: ✭ 271 (-4.91%)
Mutual labels:  graphviz
yii2-rest-rbac
yii2 rbac yii2 rest RBAC Auth manager for Yii2 RESTful(YII2权限管理rbac--rest接口方式)
Stars: ✭ 79 (-72.28%)
Mutual labels:  rbac
poddotify
A command line tool: from a Podfile.lock to an image.
Stars: ✭ 79 (-72.28%)
Mutual labels:  graphviz
Graphviz Visual Editor
A web application for interactive visual editing of Graphviz graphs described in the DOT language.
Stars: ✭ 261 (-8.42%)
Mutual labels:  graphviz
alphasql
AlphaSQL provides Integrated Type and Schema Check and Parallelization for SQL file set mainly for BigQuery
Stars: ✭ 35 (-87.72%)
Mutual labels:  graphviz
Maxkey
MaxKey is Single Sign On(SSO) System,Leading-Edge Enterprise-Class open source IAM(Identity and Access management) product.
Stars: ✭ 274 (-3.86%)
Mutual labels:  rbac
codeigniter-role-base-access-control
CodeIgniter Role Base Access Control library is an easy understandable, comprehensive and convenient way to manage users.
Stars: ✭ 59 (-79.3%)
Mutual labels:  rbac
devops-governance
Example end-to-end Governance Model from CI/CD to Azure Resource Manager. Use this project to deploy example AAD, ARM and Azure DevOps resources to learn about e2e RBAC.
Stars: ✭ 79 (-72.28%)
Mutual labels:  rbac
Kingraph
Plots family trees using JavaScript and Graphviz
Stars: ✭ 285 (+0%)
Mutual labels:  graphviz
Phpdocumentor
Documentation Generator for PHP
Stars: ✭ 3,341 (+1072.28%)
Mutual labels:  graphviz
Role core
🔐A Rails engine providing essential industry of Role-based access control.
Stars: ✭ 262 (-8.07%)
Mutual labels:  rbac

rback

A simple "RBAC in Kubernetes" visualizer. No matter how complex the setup, rback queries all RBAC related information of an Kubernetes cluster in constant time and generates a graph representation of service accounts, (cluster) roles, and the respective access rules in dot format.

For example, here is an Amazon EKS cluster as seen by rback:

EKS cluster

Another example would be a local K3S cluster:

K3S cluster

Here in action in the Katacoda Kubernetes playground:

Katacoda

See for more details the examples/ directory …

Install

rback depends on you having access to a Kubernetes cluster, either in the cloud (like Amazon EKS) or locally (k3s, kind, Minikube, Docker for Desktop) as well as kubectl installed and configured, locally.

To install it for macOS, do:

$ curl -sL https://github.com/team-soteria/rback/releases/download/v0.4.0/macos_rback -o rback
$ chmod +x rback && sudo mv rback /usr/local/bin

To install it for Linux, do:

$ curl -sL https://github.com/team-soteria/rback/releases/download/v0.4.0/linux_rback -o rback
$ chmod +x rback && sudo mv rback /usr/local/bin

You can also build it from source, with Go 1.12 like so:

$ git clone https://github.com/team-soteria/rback.git && cd rback
$ go build

Using rback directly

Run rback locally against the target cluster and store its output in a .dot file like shown in the following:

$ kubectl get sa,roles,rolebindings,clusterroles,clusterrolebindings --all-namespaces -o json | rback > result.dot

Now that you have result.dot, you can render the graph either online or locally.

Render online

There are plenty of Graphviz (dot) online visualization tools available, for example, use magjac.com/graphviz-visual-editor/ for interaction or the simpler dreampuf.github.io/GraphvizOnline. Head over there and paste the output of rback into it.

Render locally

Install Graphviz, for example, on macOS you can do brew install graphviz. Then you can do the following (on macOS):

$ kubectl get sa,roles,rolebindings,clusterroles,clusterrolebindings --all-namespaces -o json | rback | dot -Tpng  > /tmp/rback.png && open /tmp/rback.png

Using rback as a kubectl plugin

There is also a very crude first version of a kubectl plugin in https://github.com/team-soteria/rback/blob/master/kubectl-plugin/kubectl-rback. Add the file to your path, ensure it is executable and modify it to suit your environment. Then, you'll be able to simply run:

$ kubectl rback

This will generate the .dot file, render it using GraphViz (must be installed on your system) and open the rendered image using xgd-open.

We welcome contributions to make the plugin work in other environments.

More usage examples

By default, rback shows all RBAC resources in your cluster, but you can also focus on a single namespace by using the -n switch. The switch supports multiple namespaces as well:

$ kubectl rback -n my-namespace
$ kubectl rback -n my-namespace1,my-namespace2

If you're particularly interested in a single ServiceAccount, you can run:

$ kubectl rback serviceaccount my-service-account
or
$ kubectl rback sa my-service-account

This makes the specified ServiceAccount the focal point of the graph, meaning that only it and directly-related RBAC resources are shown.

Instead of ServiceAccounts, you can also focus on Roles, RoleBindings, ClusterRoles or ClusterRoleBindings:

$ kubectl rback role my-role
$ kubectl rback clusterrole my-cluster-role
$ kubectl rback rolebinding my-role-binding
$ kubectl rback clusterrolebinding my-cluster-role-binding

You can also use the abbreviated form:

$ kubectl rback r my-role
$ kubectl rback cr my-cluster-role
$ kubectl rback rb my-role-binding
$ kubectl rback crb my-cluster-role-binding

If you'd like to inspect more than one resource, you can specify multiple resource names:

$ kubectl rback r my-role1 my-role2

In addition to focusing on a specific resource, rback can also show you who can perform a particular action. For example, if you'd like to see who can create pods, run:

$ kubectl rback who-can create pods

This renders the matched (Cluster)Roles, all directly-related (Cluster)RoleBindings and subjects (ServiceAccounts, Users and Groups). The matched access rule will be shown in bold font.

Whether using who-can or not, you can turn off the rendering of the (possibly long) list of access rules with:

$ kubectl rback --show-rules=false

When using who-can, you can also tell rback to only show matched rules instead of hiding rules completely:

$ kubectl rback --show-matched-rules-only who-can create pods

How it works

To follow the "Do One Thing And Do It Well" Unix philosophy, rback does not call out to kubectl to read RBAC resources (although initial versions did do that) and does not actually render the image. All it does is parse a list of RBAC resources passed in through stdin, and then prints out a GraphViz .dot file to stdout using the github.com/emicklei/dot package.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].