Giter Site home page Giter Site logo

kubectl-view-secret's Introduction

Hi, I'm Jonas. I like ๐Ÿง— and ๐Ÿ“š.

Currently, I work @Snowflake in the Platform team. In my spare time I ๐Ÿ‘จโ€๐Ÿ’ป stuff mostly in Go and contribute to all things Kubernetes.

You can follow me on GitHub (obviously), Twitter or bookmark my personal website ๐Ÿ˜‰.

kubectl-view-secret's People

Contributors

cnmcavoy avatar elsesiy avatar jiroshin avatar pradeepnnv avatar pratikkumar-mohite avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubectl-view-secret's Issues

use escape characters while printing secret values

Command kubectl view-secret secret-name -a prints the secret keys and their values per line, delimited by = which makes it shell compatible but not always

so secret keys with multiline values or special characters are printed as is, which makes it impossible to always run source <(kubectl view-secret cluster-configs -a)

escaping will bring us the advantage of directly declaring them in shell as well

Error while installing in Apple M1 chip

Hi. I see that this plugin has apple m1 support by #21

But installation fails:

โฏ kubectl krew install view-secret
Updated the local copy of plugin index.
Installing plugin: view-secret
W0523 02:17:40.791955   47529 install.go:164] failed to install plugin "view-secret": plugin "view-secret" does not offer installation for this platform
F0523 02:17:40.792015   47529 root.go:79] failed to install some plugins: [view-secret]: plugin "view-secret" does not offer installation for this platform
โฏ kubectl krew info view-secret
NAME: view-secret
INDEX: default
VERSION: v0.8.0
HOMEPAGE: https://github.com/elsesiy/kubectl-view-secret
DESCRIPTION: 
Base64 decode by key or all key/value pairs in a given secret.
...

Problem with docs

$ kubectl view-secret default-token-5pgsw
Error: unknown command "view-secret" for "kubectl"
Run 'kubectl --help' for usage.

$ kubectl view secret default-token-5pgsw
Multiple sub keys found. Specify another argument, one of:
-> ca.crt
-> namespace
-> token

$ kubectl version --short
Client Version: v1.16.2

Are you sure the command is view-secret?

Printing decoded secrets should not add a newline

When decoding a secret, view-secret should not add a newline, as this changes the content in the secret. For example, when storing a password, it makes a difference if the string is my-password or my-password\n

See

_, _ = fmt.Fprintln(w, string(b64d))


Also, when decoding all key/value pairs in a secret, it would be nice to separate those visually by an extra newline between the entries.

Improve CI setup

  • Run action steps in a container as opposed to using actions/setup-go as it's quite slow.
  • Only run CI on PR events

support sort values and do not print empty lines

I'm almost always using view-secret with this command:

kubectl view-secret <name> --all | sort | grep "\S"

that is because the view-secret output has empty lines and keeps keys unordered.

I hope we can support sort keys and without empty lines as default for better usability and portability(like windows support).

Add support for impersonating groups with flag

Adding support for impersonation of groups by passing --as-group through to kubectl exec/get secret cli. We use impersonation as cluster-admins to elevate access to cluster secrets and cluster exec, kubectl supports this with the --as-group flag and supporting this in view-secret makes this much easier to utilize with kubernetes RBAC.

kubectl view-secret --as=pratikkumar.mohite --as-group=system:masters  default-secret                                                         
Error: unknown flag: --as-group

Replace encoding/json

For simple type de-serialization from JSON, there's a few libraries that perform a lot better than stdlib. While there's the caveat of a new external dependency, the anticipated performance gains especially for large secret objects outweigh the costs IMO

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.