butlergroup/env_encryption_tool_nodejs
GitHub: butlergroup/env_encryption_tool_nodejs
一款基于 Node.js 的 .env 文件加密与运行时解密工具,通过操作系统级环境变量管理解密密钥,实现应用敏感配置的安全存储与按需还原。
Stars: 1 | Forks: 1
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/github-code-scanning/codeql)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/node.js.yml)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/dependabot/dependabot-updates)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/njsscan.yml)
[](https://app.snyk.io/share/784f6fef-6aaf-47ed-81ba-99e05b854665)
[](https://www.bestpractices.dev/projects/10677)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/scorecard.yml)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/actions/workflows/defender-for-devops.yml)
[](https://coveralls.io/github/butlergroup/env_encryption_tool_nodejs?branch=main)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement)
[](https://github.com/butlergroup/env_encryption_tool_nodejs/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Abug)
## env_encryption_tool_nodejs :copyright: 项目目标与信息
**目的**:该项目的目标是为给定的 Node.js 应用程序加密 .env 文件,并将其以加密状态存储,然后在运行时使用基于操作系统的环境变量对其进行解密并传递给应用程序。这要求任何潜在/非法的攻击者必须先攻破操作系统的安全机制并访问其环境变量,才能入侵应用级别的环境变量。
*免责声明*:本项目已稳定并可用于生产环境,但在达到 v1.0 版本和/或获得赞助之前,我们不会提供基于 SLA 的支持。:bowtie:
## 安装说明
1. [安装 Node.js](https://nodejs.org/en) 或使用 nvm (Node version manager) 来 [在 Linux/MacOS 上](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) 或 [在 Windows 上](https://github.com/coreybutler/nvm-windows) 安装 Node.js :earth_americas:
2. 克隆/Fork env_encryption_tool_nodejs 仓库 :zap:
3. 修改 encryptConfig.js 中的加密密钥为您所需的内容 :lock:
4. 在与您的 .env 文件相同的文件夹中运行 "node encryptConfig.js" - 这将输出一个 env.enc 文件 :confetti_ball:
5. 将包含的 decryptConfig.js 文件及其包/导入集成到您的 Node.js 项目中 :star:
6. 设置一个名为 "DECRYPTION_KEY" 的操作系统级环境变量(:earth_americas: [适用于 Linux](https://stackoverflow.com/questions/45502996/how-to-set-environment-variable-in-linux-permanently),:earth_africa: [适用于 Windows](https://phoenixnap.com/kb/windows-set-environment-variable),:earth_asia: [适用于 MacOS](https://stackoverflow.com/questions/65597552/how-exactly-to-set-up-and-use-environment-variables-on-a-mac)),其值需与您在 encryptConfig.js 中设置的值相同。
7. 将 env.enc 文件复制到您的 Node.js 应用程序运行的同一文件夹中,大功告成!您的应用程序在运行时将获得加密的环境变量。:tada:
8. (可选)安装 pm2 来管理并启用 Node.js 应用程序的自启动:npm install pm2@latest -g(这是本项目中文件的配置方式)。然后运行 "pm2 start ecosystem.config.js" 启动应用程序。:sparkles:
## 许可证
env_encryption_tool_nodejs 采用 AGPL-3.0 许可证授权,只要源代码保持开源,即可免费使用、修改和分发。**在未公开源代码的情况下使用本软件的修改版本不符合 AGPL-3.0 许可证的规定。**
## 服务条款
在使用我们的软件之前,请阅读我们的[服务条款](https://github.com/butlergroup/env_encryption_tool_nodejs/blob/main/terms-of-service.md)。违反这些条款的用户将不会获得社区或贡献者的支持。
## 隐私政策
请同时阅读我们的[隐私政策](https://github.com/butlergroup/env_encryption_tool_nodejs/blob/main/privacy-policy.md),以了解我们如何处理您的个人信息。
## 联系方式
有任何问题或建议?请通过 welcome@butlergroup.net 联系我们。感谢您,祝您编程愉快! :)
## Star 历史
[](https://www.star-history.com/#butlergroup/env_encryption_tool_nodejs&Date)
标签:API密钥保护, CI/CD安全, CodeQL, DevSecOps, dotenv加密, .env文件解密, GNU通用公共许可证, Llama, MITM代理, Node.js, Node.js安全, OpenSSF, Snyk, SOC Prime, StruQ, XML 请求, 上游代理, 代码安全扫描, 安全开发, 安全评估工具, 开发工具, 敏感数据保护, 数据加密工具, 数据存储安全, 环境变量加密, 自定义脚本