#vault #client #secret #hashi-corp #key #initialization #api-client

passivized_vault_client

Vault客户端 - 初始化和监控Hashicorp Vault节点

11个版本

0.0.10 2023年8月31日
0.0.9 2023年3月23日
0.0.8 2023年1月17日
0.0.7 2022年11月18日
0.0.3 2022年10月20日

#281 in 异步

每月 29 次下载

MPL-2.0 许可证

56KB
1.5K SLoC

通过Vault的REST api与其交互的客户端库。

功能

初始化和设置

  • 生成清晰或加密的解密密钥
  • 生成root令牌
  • 生成清晰或加密的恢复密钥
  • 配置transit密钥和transit解密

策略

  • 创建、更新和列出策略
  • 将策略附加到用户pass用户

监控

  • 获取状态

用户名/密码认证

  • 创建用户和获取详细信息
  • 更新密码
  • 列出用户
  • 登录(验证密码并获取Vault令牌)
  • 删除

限制

查看REST api上的警告

Backwards compatibility: At the current version, Vault does not yet promise backwards compatibility even with the v1
prefix. We'll remove this warning when this policy changes. At this point in time the core API
(that is, sys/ routes) change very infrequently, but various secrets engines/auth methods/etc. sometimes have minor
changes to accommodate new features as they're developed.

上述警告意味着此库可能与Vault的新版本不兼容。

此库是实验性的,已与Vault 1.11至1.13版本进行测试。

GPG密钥生成

为了演示使用PGP(GPG)加密Vault生成的解密密钥和root令牌,您可以创建几个假用户,每个用户都有自己的密钥对。

$ gpg --quick-generate-key [email protected]
$ gpg --quick-generate-key [email protected]
$ gpg --quick-generate-key [email protected]
$ gpg --quick-generate-key [email protected]

列出有私钥的密钥对

$ gpg -K

导出每个密钥对中的公钥

$ gpg --output operator1.pgp --export [email protected]
$ gpg --output operator2.pgp --export [email protected]
$ gpg --output operator3.pgp --export [email protected]
$ gpg --output root-user.pgp --export [email protected]

Note: DO NOT use the "--armor" flag - Vault requires binary public keys.

平台

Linux

所有库功能都在Linux上可用。

Mac

所有库功能都在Mac上可用,但由于Mac上Docker网络限制,所有需要实时Vault服务器的自动测试都已禁用。

Windows

所有库功能都在Windows上可用,但由于Hashicorp没有提供Windows版本的Vault服务器,所有需要实时Vault服务器的自动测试都已禁用。

依赖

~4–16MB
~248K SLoC