【发布时间】:2020-12-06 08:07:12
【问题描述】:
我已在 AWS EC2 服务器中安装了 Hashicorp Vault,并尝试使用“AWS 身份验证”使用 AWS Lambda 函数访问存储在保险库中的密钥。但我收到以下错误。
{u'errors': [u'error performing token check: failed to look up namespace from the token: no namespace']}
我基本上是在做以下事情
-
在 EC2 服务器中安装 Hashicorp Vault,启用 AWS 身份验证
-
使用 AWS 角色在 Vault 中设置策略和角色
-
创建了一个基于 Python 的 AWS Lambda 函数来生成签名的 AWS STS 请求
-
使用签名请求,成功登录到保管库服务器。响应如下。
{ u'lease_id': u'', u'warnings': [ u'TTL of "768h" exceeded the effective max_ttl of "500h"; TTL value is capped accordingly' ], u'wrap_info': None, u'auth': { u'token_policies': [ u'default', u'examplepolicy' ], u'orphan': True, u'entity_id': u'xxxxxxxxxxxxxx', u'token_type': u'service', u'lease_duration': 1800000, u'policies': [ u'default', u'examplepolicy' ], u'client_token': u'xxxxxxxxxxxxxx', u'accessor': u'xxxxxxxxxxxxxx', u'renewable': True, u'metadata': { u'auth_type': u'iam', u'account_id': u'xxxxxxxxxxxxxx', u'role_id': u'xxxxxxxxxxxxxx' } }, u'lease_duration': 0, u'request_id': u'xxxxxxxxxxxxxx', u'data': None, u'renewable': False}
-
现在使用上面响应中的客户端令牌尝试获取密钥,如下所示
secretKey = requests.get(url1,headers = {"X-Vault-Token": clienttoken})
-
执行上述行后我立即收到以下错误。
{u'errors': [u'error execution token check: failed to look up namespace from the token: no namespace']}
【问题讨论】:
-
你试过不带引号的 X-Vault-Token 吗?那是我在 R 编程环境中遇到的问题。
标签: python amazon-web-services aws-lambda hashicorp-vault