Giter VIP home page Giter VIP logo

kubectl-whisper-secret's Introduction

kubectl-whisper-secret

kubectl-whisper-secret plugin allows users to create secrets with secure input prompt to prevent information leakages through terminal history, shoulder surfing attacks, etc

Installation

Installing with krew

kubectl krew install whisper-secret

Installing with wget

wget https://github.com/rewanthtammana/kubectl-whisper-secret/releases/download/v1.1.0/kubectl-whisper-secret-Linux-x86_64.tar.gz
sudo tar xvf kubectl-whisper-secret-Linux-x86_64.tar.gz -C /usr/bin/

Why to use

Problem statement

Analyze the examples below

$ kubectl create secret generic my-secret --from-literal key1=value1 --from-literal key2=value2
$ kubectl create secret docker-registry my-secret --docker-password s3cur3D0ck3rP@ssw0rD

kubectl create secret has a few sub-commands we use most often that can possibly leak sensitive information in multiple ways like terminal history, shoulder surfing, etc.

Proposed solution with examples

kubectl whisper-secret plugin allows users to create secrets with secure input prompt for fields like --from-literal and --docker-password that contain sensitive information

$ kubectl whisper-secret generic my-secret --from-literal key1 --from-literal key2
Enter value for key1: 
Enter value for key2: 
secret/my-secret created
$ kubectl whisper-secret docker-registry my-secret --docker-password -- -n test --docker-username admin
Enter value for docker password: 
secret/my-secret created
$ kubectl whisper-secret docker-registry my-secret --docker-password --verbose -- -n test --docker-username admin
Enter value for docker password: 
[+] Command: kubectl create docker-registry my-secret --docker-password abcdef -n test --docker-username admin
secret/my-secret created
$ kubectl whisper-secret docker-registry my-secret --docker-password --print-only
Enter value for docker password: 
[*] Command: kubectl create docker-registry my-secret --docker-password abcdef

Developer build

Build from Makefile

make build

Build only for Linux

make build-linux

Build with go

go get ./...
go build -o kubectl-whisper-secret main.go
mv kubectl-whisper-secret /usr/bin

Cross platform builds with go

go get ./...
GOOS=windows GOARCH=amd64 go build -o kubectl-whisper-secret.exe main.go

Usage

rewanth@ubuntu:~/go/src/kubectl-whisper-secret$ kubectl whisper-secret -h
"kubectl whisper-secret" creates kubectl secrets by taking sensitive input from console.
More info: https://github.com/rewanthtammana/kubectl-whisper-secret

Usage:
  kubectl-whisper-secret [flags]
  kubectl-whisper-secret [command]

Examples:

Create generic secret in default namespace:
$ kubectl whisper-secret generic my-secret --from-literal key1 --from-literal key2

Provide non-existing/unknown flags after double hypen (--)

Create generic secret in test namespace:
$ kubectl whisper-secret generic my-secret --from-literal key1 --from-literal key2 -- -n test

Create docker-registry secret in default namespace:
$ kubectl whisper-secret docker-registry my-secret --docker-password -- --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-email=DOCKER_EMAIL

Available Commands:
  docker-registry Take docker-registry password input from console
  generic         Create generic secrets by taking input from console
  help            Help about any command

Flags:
  -h, --help   help for kubectl-whisper-secret

Use "kubectl-whisper-secret [command] --help" for more information about a command.

kubectl-whisper-secret's People

Contributors

rewanthtammana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

pdf drgarridus

kubectl-whisper-secret's Issues

unrecognized OS: darwin

ccsecret generic my-secret --from-literal key1 --from-literal key2
Enter value for key1 :
Enter value for key2 :
Unrecognized OS: darwin
Please create an issue here, https://github.com/rewanth1997/kubectl-ccsecret/issues

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.