{"id":16844874,"url":"https://github.com/sbueringer/kubernetes-rbacq","last_synced_at":"2025-04-11T06:28:15.686Z","repository":{"id":57500313,"uuid":"87685306","full_name":"sbueringer/kubernetes-rbacq","owner":"sbueringer","description":"Querying Kubernetes RBAC Objects","archived":false,"fork":false,"pushed_at":"2018-03-24T17:41:16.000Z","size":7775,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T04:22:28.066Z","etag":null,"topics":["cli","cobra","kubernetes","kubernetes-rbacq","rbac"],"latest_commit_sha":null,"homepage":"https://sbueringer.github.io/kubernetes-rbacq/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbueringer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-09T05:30:55.000Z","updated_at":"2024-10-17T08:29:46.000Z","dependencies_parsed_at":"2022-08-30T20:42:18.295Z","dependency_job_id":null,"html_url":"https://github.com/sbueringer/kubernetes-rbacq","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbueringer%2Fkubernetes-rbacq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbueringer%2Fkubernetes-rbacq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbueringer%2Fkubernetes-rbacq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbueringer%2Fkubernetes-rbacq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbueringer","download_url":"https://codeload.github.com/sbueringer/kubernetes-rbacq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248353957,"owners_count":21089725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cobra","kubernetes","kubernetes-rbacq","rbac"],"created_at":"2024-10-13T12:56:54.588Z","updated_at":"2025-04-11T06:28:15.664Z","avatar_url":"https://github.com/sbueringer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes RBACQ\n\n[![Build Status](https://travis-ci.org/sbueringer/kubernetes-rbacq.svg?branch=master)](https://travis-ci.org/sbueringer/kubernetes-rbacq)\n\nRBACQ simplifies querying Subjects and Rights specified in Kubernetes through Roles/ClusterRoles and RoleBindings/ClusterRoleBindings.\n\n# Installation\n\n## Binary\n\nGo to the [releases](https://github.com/sbueringer/kubernetes-rbacq/releases) page and download the Linux or Windows version. Put the binary to somewhere you want (on UNIX-y systems, /usr/local/bin or the like). Make sure it has execution bits turned on.\n\n# Basic Usage\n\nRBACQ is build with [Cobra](https://github.com/spf13/cobra) so the CLI is build in a familiar way (Cobra is also used in Docker and Kubernetes).\n\nTo print a description what RBACQ can do, just execute:\n```bash\n$ ./rbacq\nrbacq simplifies querying the Kubernetes RBAC API\n\nUsage:\n  rbacq [command]\n\nAvailable Commands:\n  get         Displays one or many resources\n  help        Help about any command\n\nFlags:\n  -a, --all-namespaces      Specifies that all Namespaces should be queried (default \"false\")\n  -c, --cluster-wide        Search cluster-wide (which includes ClusterRoles \u0026 ClusterRolebindings)\n  -k, --kubeconfig string   Path to the kubeconfig file to use for CLI requests (default \"$HOME\\\\.kube\\\\config\")\n  -n, --namespace string    Specifies the Namespace in which to query (default \"default\")\n  -s, --system              Show also System Objects (default \"false\")\n\nUse \"rbacq [command] --help\" for more information about a command.\n```\n\nTo further explore the CLI execute the following: (and so on)\n```bash\n$ ./rbacq get\nYou must specify the type of resource to get. Valid resource types are:\n\n        * subjects (aka 'sub')\n        * rights (aka 'r')\n```\n\n```bash\n$ ./rbacq get subjects --help\nDisplays one or many resources\n\nUsage:\n  rbacq get [RESOURCE-TYPE] [flags]\n\nFlags:\n  -o, --output string   Set jsonpath e.g. with -o jsonpath='{.kind}:{.Name}'\n\nGlobal Flags:\n  -a, --all-namespaces      Specifies that all Namespaces should be queried (default \"false\")\n  -c, --cluster-wide        Search cluster-wide (which includes ClusterRoles \u0026 ClusterRolebindings)\n  -k, --kubeconfig string   Path to the kubeconfig file to use for CLI requests (default \"C:\\\\Users\\\\SBUERIN\\\\.kube\\\\config\")\n  -n, --namespace string    Specifies the Namespace in which to query (default \"default\")\n  -s, --system              Show also System Objects (default \"false\")\n\n```\n\n## Subjects\n\nSubjects used in RoleBindings can be queried with `./rbaq get subjects`. The subjects are queried per default in the default Namespace. The following flags can modify this behaviour:\n* -n \\\u003cnamespace\\\u003e: search in a specific Namespace \n* -a: search in all Namespaces \n* -c: search cluster-wide, which means that also ClusterRoles \u0026 ClusterRoleBindings are queried \n* -s: also show System objects \n\nExamples:\n\nList Subjects in kube-system (including System objects):\n```bash\n$ ./rbacq -n kube-system get subjects -s\nSubjects defined in RoleBindings\n    Namespace: kube-system\n        ServiceAccount:kube-system:token-cleaner\n            Role: system:controller:token-cleaner\n                 secrets: [delete get list watch]\n                 events: [create patch update]\n        ServiceAccount:infra:vault\n            Role: vault:serviceaccount\n                 secrets: [delete create list update]\n        ServiceAccount:kube-system:bootstrap-signer\n            Role: system:controller:bootstrap-signer\n                 secrets: [get list watch]\n```\n\nList all Subjects matching the RegExp `.*kube-system.*` (including System objects):\n```bash\n$ ./rbacq -n kube-system get subjects -s .*kube-system.*\nSubjects defined in RoleBindings\n    Namespace: kube-system\n        ServiceAccount:kube-system:token-cleaner\n            Role: system:controller:token-cleaner\n                 secrets: [delete get list watch]\n                 events: [create patch update]\n        ServiceAccount:kube-system:bootstrap-signer\n            Role: system:controller:bootstrap-signer\n                 secrets: [get list watch]\n```\n\n## Rights\n\nRights used by Roles can be queried with `./rbacq get rights`. The rights are queried per default in the default Namespace. The same flags as with Subjects can modify this behaviour.\n\nExample:\n\nGet all Rights from Namespace kube-system (including System):\n```bash\n$ ./rbacq -n kube-system get rights -s \nRights defined in Roles\n    events:\n        [create patch update]: [ServiceAccount:kube-system:token-cleaner]\n    secrets:\n        [delete create list update]: [ServiceAccount:infra:i3-vault]\n        [delete get list watch]: [ServiceAccount:kube-system:token-cleaner]\n        [get list watch]: [ServiceAccount:kube-system:bootstrap-signer]\n```\n\nGet all Rights from Roles in default Namespaces and ClusterRoles that match `namespaces.*get` (including System):\n```bash\n$ ./rbacq get rights -s -c namespaces.*get\nRights defined in ClusterRoles \u0026 Roles\n    namespaces: [delete get list watch]: [ServiceAccount:kube-system:namespace-controller]\n    namespaces: [get]: [User:system:kube-controller-manager]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbueringer%2Fkubernetes-rbacq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbueringer%2Fkubernetes-rbacq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbueringer%2Fkubernetes-rbacq/lists"}