Giter VIP home page Giter VIP logo

kubectl-who-can's Introduction

GitHub Release GitHub Action Coverage Status Go Report Card License GitHub All Releases

kubectl-who-can

Shows which subjects have RBAC permissions to VERB [TYPE | TYPE/NAME | NONRESOURCEURL] in Kubernetes.

asciicast

Installation

There are several ways to install kubectl-who-can. The recommended installation is via the kubectl plugin manager called krew.

krew

I assume that you've already installed krew. Then run the following command:

kubectl krew install who-can

The plugin will be available as kubectl who-can.

Manual

Download a release distribution archive for your operating system, extract it, and add the kubectl-who-can executable to your $PATH. For example, to manually install kubectl-who-can on macOS run the following command:

VERSION=`git describe --abbrev=0`

mkdir -p /tmp/who-can/$VERSION && \
curl -L https://github.com/aquasecurity/kubectl-who-can/releases/download/$VERSION/kubectl-who-can_darwin_x86_64.tar.gz \
  | tar xz -C /tmp/who-can/$VERSION && \
sudo mv -i /tmp/who-can/$VERSION/kubectl-who-can /usr/local/bin

Build from Source

This is a standard Go program. If you already know how to build and install Go code, you probably won't need these instructions.

Note that while the code is small, it has some rather big dependencies, and fetching + building these dependencies can take a few minutes.

Option 1 (if you have a Go compiler and want to tweak the code):

# Clone this repository (or your fork)
git clone https://github.com/aquasecurity/kubectl-who-can
cd kubectl-who-can
make

The kubectl-who-can binary will be in the current directory.

Option 2 (if you have a Go compiler and just want the binary):

go get -v github.com/aquasecurity/kubectl-who-can/cmd/kubectl-who-can

The kubectl-who-can binary will be in $GOPATH/bin.

Option 3 (if you don't have a Go compiler, but have Docker installed):

docker run --rm -v /usr/local/bin:/go/bin golang go get -v github.com/aquasecurity/kubectl-who-can/cmd/kubectl-who-can

The kubectl-who-can binary will be in /usr/local/bin.

Usage

$ kubectl who-can VERB (TYPE | TYPE/NAME | NONRESOURCEURL) [flags]

Flags

Name Shorthand Default Usage
namespace n If present, the namespace scope for this CLI request
all-namespaces A false If true, check for users that can do the specified action in any of the available namespaces
subresource Specify a sub-resource such as pod/log or deployment/scale

For additional details on flags and usage, run kubectl who-can --help.

kubectl-who-can's People

Contributors

danielpacak avatar gabeduke avatar gituser143 avatar gpjacobs avatar imnotjames avatar itaysk avatar jpetazzo avatar krol3 avatar lizrice avatar mislavcimpersak avatar sebgoa avatar sidhyatikku avatar sumitkharche avatar surajssd avatar thanasisk avatar zubron avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.