Skip to content

enveloper

CI License: AGPL-3.0-or-later Python 3.10+ Ruff mypy PyPI version

Background

News Headlines

[ KrebsOnSecurity, DockerHub/GitGuardian, Toyota/GitGuardian]


When developing software, there are often secrets that every developer or team need to deal with. These include:

  • API keys
  • API secrets
  • Web passwords
  • User-Ids
  • User and Administrative Passwords
  • Tokens
  • Private endpoints
  • File paths
  • Universal Identifiers
  • Authorization keys
  • etc.

In some cases, these are inadvertently hard-coded into code, which is then pushed out to shared repositories. There are services to scan for these, but a recommended practice has been to place these in .env files.

News Headlines

[GitGuardian]


A Different Approach

.env files open up a new range of problems:

News Headlines

File-based .env files are best to be avoided.


Enter enveloper

enveloper allows you to avoid .env files or hard-coded credentials by storing secrets in your own protected system keychain. These can be injected into a build session at runtime, without any risk of inadvertent release.

Local keychains work well for individuals. But what about sharing secrets? Fortunately, cloud-based services have already solved this problem, by offering Secret Managers or Vaults stored in cryptographically secure locations.

enveloper lets you store all your secrets in your local keychain or cloud-based secret managers, and easily move them back and forth or share them without having to leave any data in the open.

Envelope Services

Manage environment secrets via your system keychain or cloud secret stores. Don't leave exposed .env files laying about your filesystem.


Installation

pip install enveloper            # CLI only (scripts, Make, Docker, CI)
pip install enveloper[sdk]       # CLI + SDK — recommended for Python apps (load_dotenv / dotenv_values)
pip install enveloper[all]        # CLI + SDK + all cloud backends

For Python applications that load secrets at runtime (keychain or cloud), install the SDK extra: pip install enveloper[sdk].

Examples: Runnable samples for Docker, Makefile, Kubernetes, CI/CD, shell scripts, GitHub Secrets, the Python SDK, and domains/versioning are in the examples folder.

Quick Start

# Sample .env file
Sample .env file

# Import an existing .env file into the keychain
enveloper import sample.env --domain dev --project Enveloper

Keys are stored in local keychain.

Sample .env file

# List what's stored

enveloper list key --domain dev --project Enveloper

Import and list values

# Load local environment settings from keychain

eval "$(enveloper --domain dev --project Enveloper export --format unix)"

# Values are loaded into local environment variables. 
# Use in Makefile, shell scripts, etc. 
# 'unix' format works for Linux, Mac, and Windows WSL. 
# For Windows Powershell, use 'win' as format.

Export from keychain to environment then unexport to clear out

# When done, you can use 'unexport' command to remove the set of env variables

eval "$(enveloper --domain dev --project Enveloper unexport --format unix)"

# Push to cloud service

enveloper --domain dev --project Enveloper push --service aws

Push all values from keychain to cloud

In the console, we can verify that the values are stored (in the case of AWS, in the SSM Parameter Store)

AWS Service Console

# Verify that they got pushed in AWS console for System Store > Parameters

enveloper list key --domain dev --project Enveloper --service aws
Env values in AWS SSM

# Pull from AWS SSM into local keychain

enveloper pull --domain dev --project Enveloper --service aws

# Clear environment settings
enveloper clear --domain dev --project Enveloper --service aws
Clear settings from cloud

Multiple cloud services

AWS logo

Amazon Web Services (aws)

AWS Terminal Push

AWS Console Push

AWS logo

Google Cloud (gcp)

GCP Terminal Push

GCP Console Push

AWS logo

Microsoft Azure Cloud (azure)

Azure Terminal Push

Azure Console Push

AWS logo

Hashicorp Vault (vault)

Vault Terminal Push

Vault Console Push

Features

  • Backward compatible with .env files.
  • Store values in local keychains (Mac, Linux, Windows), or cloud service secret stores (see below).
  • Work with individual environment variables or sets.
  • Versioning of environment values using Semantic Versioning.
  • Use in build chains (Make, Gradle, etc.) or CI/CD, including Github Actions.
  • Support for hierarchical settings via domain and project sets.
  • Shared sanitization for keys, values, and file paths before secrets are persisted or exported.

Supported Backends

Backend Description
Local Keychain MacOS Keychain, Linux Secret Service, Windows Credential Locker
File Plain .env files
AWS SSM AWS Systems Manager Parameter Store
Vault HashiCorp Vault KV v2
GCP Google Cloud Secret Manager
Azure Azure Key Vault
Alibaba Alibaba Cloud KMS Secrets Manager (untested)
GitHub GitHub Actions secrets (coming soon)

Documentation

License

GNU AGPL v3.0 or later