Skip to main content

A secret environment management

Project description

dENVer

Treat your secrets like password

purpose

We live in a devops world, the devops world is awesome, so many neat tools and deployment management, API, ...

Many vendors will treat the security as "next vendor's problem".

As a user, we end-up with many dotfiles containing critical API keys in plain-text, or we just export BASH_VARS=SeCrEt, and the secret end-up in .bash_history.

On another side, we start to implement saner password management policies, thanks to tools such as password-store, keepass, 1password, lastpass, and so many more.

Let's try to fix it.

Denver is super simple and tool-agnostic script which let you export the environment variables AWS and Vault love so much, from your password manager (granted it offers you a way to write it to stdout). And set an alias (fdenver) to forget about it when you're done (or just close the terminal, I'm not your boss)

installation

It's currently a WIP (work in progress), but due to being a pretty dumb wrapper around more mature tools, you can start to use it safely with actual secrets.

It could work, with some effort, in windows, but it's out of scope for now.

The demo.cfg file can be copied to $HOME/.denver.cfg.

pip install denver

Please do use a virtual environment.

usage

on the password manager side

Store a secret in the form of:

VAR_NAME_FOO=a_secret
VAR_BAR=another_secret

If you use keepass, use the Notes field.

on denver side

Adapt the command to your use-case, examples are provided for keepassxc and gopass

It should work without any problem in any shell providing subshell support (ie. bash and zsh)

If your environment already has a variable with the same name in its scope, denver won't overwrite it, nor set it to be unset.

# source it from a subshell
source <(denver.py -n NAME)

# display the commands
denver.py -n NAME
[ keep the space as 1st char if you copy/paste those commands so they're not
appended to your .history file ]

# look at the variables being correctly set up:
env

# forget about these
fdenver

XXXX marks the spot

You can see 'XXXX' in command parameters, they're magic-value, and will be replaced with the name (-n key, or --name key) parameter at runtime.

more help

Haven't you tried this already ?

denver.py --help

a note about stdin password prompts

You can't (easily) reach the subshell's stdin, it means you should use an external prompt program if the password tool give an interactive prompt, use a graphical tool in order to pipe your password there (cf. keepassxc command)

bugs

  • there's no context awareness, if you run it twice with different variables bundles, the fdenver alias won't be properly created, and will fail to unset every variables (should you be in that situation : just exit the damn shell)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

denver-0.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

denver-0.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file denver-0.0.2.tar.gz.

File metadata

  • Download URL: denver-0.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for denver-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a66fb25129a0025e3c65b825b522cce5234bf8af62901426246d1ddc09cc72df
MD5 d3685407875b17b6dddc212c1e49220f
BLAKE2b-256 4a86f9073eb5d2bdc8f6484423c984aa082217d32184aac8bc338338f8a496d2

See more details on using hashes here.

File details

Details for the file denver-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: denver-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for denver-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 357909c1ca9176b4dfcba2cde826740c70582214c82371f6f038bd1f735cea2a
MD5 843f1397d673160c1dcc09abec1b1425
BLAKE2b-256 dcd9d234f9f03ecc519191f45ff46ca73019c7440027c01c1de0da323c8772a0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page