envchain - set environment variables with macOS keychain or D-Bus secret service
What?
Secrets for common computing environments, such as AWS_SECRET_ACCESS_KEY, are
set with environment variables.
A common practice is to set them in shell's intialization files such as .bashrc and .zshrc.
Putting these secrets on disk in this way is a grave risk.
envchain allows you to secure credential environment variables to your secure vault, and set to environment variables only when you called explicitly.
Currently, envchain supports macOS keychain and D-Bus secret service (gnome-keyring) as a vault.
Don't give any credentials implicitly!
Requirement (macOS)
macOS
Confirmed to work on OS X 10.11 (El Capitan), macOS 10.12 (Sierra).
OS X 10.7 (Lion) or later is required, but not confirmed
Requirement (Linux)
readline
libsecret
D-Bus Secret Service
GNOME keyring
KeePassXC
Installation
From Source
$ make
$ sudo make install
(or)
$ cp ./envchain ~/bin/
Homebrew (OS X)
brew install envchain
Usage
Saving variables
Environment variables are set within a specified namespace. You can set variables in a single command:
envchain --set NAMESPACE ENV [ENV ..]
You will be prompted to enter the values for each variable.
For example, we can set two variables... AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY here, within a namespace called aws:
$ envchain hubot env | grep AWS_ || echo "No AWS_ env vars for hubot"
No AWS_ env vars for hubot
$ envchain hubot env | grep HUBOT_
HUBOT_HIPCHAT_PASSWORD: xxxx
You may specify multiple namespaces at once, with separating by commas:
请发表评论