Skip to main content

Securely manage encrypted environment variables with ease.

Project description

logo

🔒 EnvCloak

"Because Your Secrets Deserve Better Than Plaintext!"

GitHub License Contrib Welcome Code style CI/CD Pipeline

PyPI - Status PyPI - Version PyPI - Python Version

Welcome to EnvCloak, the ultimate sidekick for developers, ops folks, and anyone who’s ever accidentally committed an API key to version control. (Yes, I know… it happens to the best of us. 😅) EnvCloak takes the stress out of managing environment variables by wrapping them in the cozy blanket of encryption, so you can focus on building awesome things—without the lingering fear of a security breach.

🛠️ Installation

In order to install envcloak simply run:

pip install envcloak

or if you want dev tools too 😎:

pip install envcloak[dev]

🚀 Example Workflow

ℹ️ More examples are present in examples section.

Generating key:

# With password and salt
envcloak generate-key-from-password --password "YourTopSecretPassword" \
--salt "e3a1c8b0d4f6e2c7a5b9d6f0cr2ad1a2" --output secretkey.key

# With password without salt (we will add random salt then)
envcloak generate-key-from-password --password "YourTopSecretPassword" --output secretkey.key

# From random password and salt
envcloak generate-key --output secretkey.key

What it does: generates your private key used to encrypt and decrypt files. Appends (or creates if needed) .gitignore as well as super-hero should! 🎉

If someone knows your password and salt (option 1) can recreate same key - keep those variables safe as key itself

Encrypting Variables:

envcloak encrypt --input .env --output .env.enc --key-file mykey.key

What it does: Encrypts your .env file with a specified key, outputting a sparkling .env.enc file.

Decrypting Variables:

envcloak decrypt --input .env.enc --output .env --key-file mykey.key

What it does: Decrypts the .env.enc file back to .env using the same key. Voilà!

or you may want to use it ...

🐍 In Your Python Code

from envcloak import load_encrypted_env

load_encrypted_env('.env.enc', key_file='mykey.key').to_os_env()
# Now os.environ contains the decrypted variables

What it does: Loads decrypted variables directly into os.environ. Secrets delivered, stress-free.

🛠️ Implementation Details

🔑 Encryption Algorithm

  • Powered by AES-256-GCM for speed and security.

🗝️ Key Storage

  • Local key files with strict permissions.
  • Secure environment variables for CI/CD systems.

🗂️ File Handling

  • Works with individual files.
  • Works with directories using --directory instead of --input on encrypt and decrypt.

ℹ️ EnvCloak process files in batch one-by-one.

🚦 Error Handling

  • Clear, friendly error messages for any hiccups.
  • Gracefully handles missing keys or corrupted files.

✅ Compatibility of pipelines and systems

  • k8s / OKD / OCP deployments
  • Jenkins pipelines
  • Azure Pipelines
  • Github Workflows
  • Gitlab CI/CD Pipelines

🎉 Why EnvCloak?

Because you deserve peace of mind. EnvCloak wraps your environment variables in layers of encryption goodness, protecting them from prying eyes and accidental slips. Whether you’re a solo dev or part of a big team, this tool is here to make managing secrets simple, secure, and downright pleasant.

So go ahead—secure your .env like a boss. And remember, EnvCloak isn’t just a tool; it’s your secret-keeping partner in crime. (But the good kind of crime. 😎)

Comparison of EnvCloak with Alternatives

Tool Strengths Weaknesses
EnvCloak Lightweight, Python-native, simple to integrate with CI/CD workflows. Limited ecosystem compared to established tools.
Sops Integrates with cloud providers, supports partial file encryption. More complex to configure for beginners.
BlackBox Simple file-based encryption for Git repos. Limited to GPG, lacks flexibility.
Vault Robust, enterprise-grade with dynamic secrets. High complexity, overkill for small projects.
Confidant AWS IAM integration, designed for secure CI/CD workflows. Requires AWS, limited to its ecosystem.
Doppler Centralized secret management with CI/CD integration. Paid plans for advanced features, cloud-reliant.

Key Differentiator for EnvCloak: Focused specifically on Python developers and lightweight CI/CD needs, making it ideal for small to medium projects.

🔗 Get Started Today!

Don’t let your API keys end up in the wrong hands (or on Twitter). Grab EnvCloak now and start encrypting like a pro.

Happy env Cloaking! 🕵️‍♂️

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

envcloak-0.1.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envcloak-0.1.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file envcloak-0.1.1.tar.gz.

File metadata

  • Download URL: envcloak-0.1.1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for envcloak-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c1b188f985e69d0f4a7748b0df8568e7ec7e0541df35a7aeaec55a68e849934f
MD5 5060f4485770042202df73ba237f843f
BLAKE2b-256 baa7f635659a7a8966e5f8c8b2f0c3e47cb9e37bf61bc62925abf0ef983aff48

See more details on using hashes here.

File details

Details for the file envcloak-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: envcloak-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for envcloak-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6a4901d914828de3324a8a74f5cec400ea5adf76e1939857c4762e163e34d01
MD5 57098913d63e129cb8f3e7d7c9fb41aa
BLAKE2b-256 c730567e955126a006b9df631b2f7f9e2f73a4488db72b7775dab1e95018238e

See more details on using hashes here.

Supported by

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