Skip to content
/ safe Public

Safe space from accidental secret-leaking.

License

Notifications You must be signed in to change notification settings

nobe4/safe

Repository files navigation

Safe

Don't look at the credentials on the screen. - me, sometimes

Sharing one's terminal is a great way to explain, help, contribute. It's possible to display secrets inadvertently, cating a configuration file.

This simple binary helps to prevent this from happening.

Usage

Shell Mode

Running safe in shell mode opens up a new shell which will filter out all output.

E.g.

$ safe
$ cat config.yml
node-dev:
  hostname: mynode-dev.local
  username: node-user
  password: XXXXXXXXXXXXXXXX

Warning: Dynamic program might not work as expected. For instance, top, vim, nano will fail to run properly. This is due to the underlying parsing of the input.

Pipe Mode

Running safe in pipe mode reads from stdin and filter out the output to stdout.

E.g.

$ cat config.yml | safe
node-dev:
  hostname: mynode-dev.local
  username: node-user
  password: XXXXXXXXXXXXXXXX

Installation

Release

This is the prefered way.

Check the lastest release.

Note: If you use the macOs binary, they are not currently signed. You need to right-click and open first (ref).

Manual build

Currently you can git pull and run make.

Go Get

$ go get github.com/nobe4/safe/tree/master/cmd/safe

Note: This method doesn't embed version information in the binary, prefer the release.

Contribute

Feel free to open issues/PR.

Improvement ideas in no particular order:

  • Write tests
  • Support dynamic programs (vim, top, ...)
  • Add signal handler when terminal closes
  • Support windows
  • Improve logger formatting
  • Sign apple binary

License

MIT