Skip to content

butlergroup/env_encryption_tool_nodejs

CodeQL Node.js CI Dependabot Updates njsscan sarif Snyk Security-Monitored OpenSSF Best Practices Scorecard supply-chain security Microsoft Defender For Devops Coverage Status Feature Requests Bugs

env_encryption_tool_nodejs ©️ Project Goals & Info

Purpose: the goal for this project is to encrypt .env files for a given Node.js application and store them in an encrypted state, then decrypt them at runtime using an OS-based environment variable and pass them to the application. This requires any potential/illicit attacker to breach the operating system's security and access its environment variables before any application-level environment variables can be compromised.

Disclaimer: this project is stable and can be used in production environments, but SLA-based support won't be offered until we're at v1.0 and/or sponsored. :bowtie:

Installation Instructions

  1. Install Node.js or use nvm (Node version manager) to install Node.js on Linux/MacOS or on Windows 🌎
  2. Clone/fork the env_encryption_tool_nodejs repo ⚡
  3. Modify the encryption key in encryptConfig.js to your desired content 🔒
  4. Run "node encryptConfig.js" in the same folder as your .env file - this outputs a env.enc file 🎊
  5. Integrate the included decryptConfig.js file and its packages/imports into your Node.js project ⭐
  6. Set an OS-level environment variable named "DECRYPTION_KEY" ( 🌎 for Linux, 🌍 for Windows, 🌏 for MacOS) to the same value you placed in encryptConfig.js.
  7. Copy the env.enc file to the same folder your Node.js application runs in and voila! You have encrypted environment variables provided to your application at runtime. 🎉
  8. (optional) Install pm2 to manage and enable auto-start of your Node.js app: npm install pm2@latest -g (this is how the files in this project are configured). Then run "pm2 start ecosystem.config.js" to start the application. ✨

Contributing

We welcome contributions from the community! A simple guide to get started:

  1. Fork the repository to your Github account (a.k.a create a branch).
  2. Clone your forked repo/branch to your favorite IDE (VS Code is our editor of choice) and make changes (or use the command-line: git checkout -b feature/your-feature).
  3. Thoroughly test and debug your changes, then commit and push them to your forked repo/branch.
  4. Open a pull request to have your changes reviewed and reintegrated into the main branch.

Contributors are strongly encouraged to read our CONTRIBUTING.md file before opening a pull request.

License

env_encryption_tool_nodejs is licensed under the AGPL-3.0 license, making it free to use, modify, and distribute as long as the source code remains open-source. Using a modified version of this software without disclosing its source code is not in compliance with the AGPL-3.0 license.

Acknowledgments

Special thanks to contributors, open-source enthusiasts, and supporters of env_encryption_tool_nodejs's vision.

Terms of Service

Please read our Terms of Service before using our software. Violators of these Terms are not supported by the community or contributors.

Privacy Policy

Please also read our Privacy Policy to understand how we handle your personal information.

Contact

Have questions or suggestions? Reach out to us at welcome@butlergroup.net. Thank you and happy coding! :)

Star History

Star History Chart

About

Node.js-based .env (dotenv) file encryption & decryption tool - store & retrieve your app environment variables safely 😎

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages