如何使用IAM身份验证的Nodejs中的AWS lambda调用Hashicorp库
有人知道是否有一个很好的Nodejs库可以使用IAM身份验证从AWS Lambda连接到Hashicorp Vault。
类似于 hvac 因为python会很好。
我尝试使用 node-vault-client IAM身份验证,自2019年以来似乎没有进行更新,因此我不确定它是否积极维护。
Does anyone know if there is a good NodeJS library to connect to hashicorp vault from an AWS Lambda using IAM Authentication.
Something similar to HVAC for Python would be good.
I have tried using node-vault-client but there aren't any good examples of IAM Authentication and it doesn't seem to have had an update since 2019 so I am not sure if its actively being maintained.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法使用 node-vault-client 到图书馆,因为它不允许您通过命名空间标题。我已经提高了 pr 添加了一个新领域来解决问题。
这是我的代码的示例:
************更新************
我自那以后决定编写代码以从金库中检索秘密并删除对节点库的依赖性-客户。
首先,我需要致电AWS Secrets Manager以获取Vault CA证书
然后,我使用Vault进行身份验证以获取auth Token:
然后,我打电话给Vault获取秘密:
I managed to get it working using node-vault-client but I had to make changes to the library because it doesnt allow you to pass a namespace header. I have raised a PR that adds a new field to resolve the issue.
Here is a sample of my code:
************ UPDATE **************
I have since decided to write the code to retrieve the secrets from vault myself and remove the dependency on node-vault-client.
First, I need to call AWS Secrets Manager to get the Vault CA Certificate
Then I authenticate with Vault to get an auth token:
Then I call vault to get the Secret: