initiativesolutions/secrets-manager
Composer 安装命令:
composer require initiativesolutions/secrets-manager
包简介
Encrypt sensitive app data
README 文档
README
The Secrets Manager application is a command-line tool that allows you to encrypt sensitive values for your application's
.envfiles. This ensures that sensitive values are not stored in plain text, enhancing the security of your applications.
This project has two different uses:
- for token encryption (command line use)
- to decrypt the tokens from the application (secrets provider)
Installation
For tokens encryption
To install the command line tool application, follow these steps:
- Clone this repository:
git clone https://github.com/initiativesolutions/secrets-manager.git - Install dependencies:
composer install
For tokens provider
From the application where you want to decrypt the tokens :
composer require initiativesolutions/secrets-manager
Usage
For tokens encryption
Ensure you run the application with a user having necessary rights on the machine or server, as the application performs file read and write operations.
Configuration
The default configuration of the application is set in the config.yaml file. Make sure to adjust these values according to your needs.
Example:
encryption_key: location: /var/keys/secrets-manager/encryption file_name: encrypt.key secrets_files: location: /var/keys/secrets-manager/secrets prefix: secrets_ encrypt: algorithm: aes256
Commands
Here are the available commands in the application:
-
bin/secretctl encrypt [TOKEN_NAME] -app [APPLICATION_NAME] -env [ENVIRONNEMENT_NAME]: Encrypts token one by one. -
bin/secretctl encrypt -file [PATH_TO_JSON_TOKENS] -app [APPLICATION_NAME] -env [ENVIRONNEMENT_NAME] [--remove-file]: Encrypts json file by passing path (you can use --remove-file to delete .json file after encryption) -
bin/secretctl rotate: Re-encrypts tokens and generates a new security key. -
bin/secretctl delete [TOKEN_NAME] -app [APPLICATION_NAME] -env [ENVIRONNEMENT_NAME]: Delete a token. -
bin/secretctl list -app [APPLICATION_NAME] -env [ENVIRONNEMENT_NAME]: List tokens. -
bin/secretctl help: See help for all commands
If you have a problem when running
bin/secretctlthen run :chmod +x bin/secretctl && sed -i -e 's/\r$//' bin/secretctl
For tokens provider
$tokens = (new SecretsProvider()) ->decrypt('path/to/encrypt.key', 'path/to/secrets/tokens'); $_ENV = array_merge($_ENV, $tokens);
Tests
You can run tests with vendor/bin/phpunit tests/.
initiativesolutions/secrets-manager 适用场景与选型建议
initiativesolutions/secrets-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.73k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 initiativesolutions/secrets-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 initiativesolutions/secrets-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2023-08-08