Hashicorp Vault: 无法从令牌中查找命名空间

4

我已在AWS EC2服务器上安装了Hashicorp Vault,并尝试使用“AWS身份验证”在AWS Lambda函数中访问存储在Vault中的秘密密钥,但是我遇到了以下错误。

{u'errors': [u'error performing token check: failed to look up namespace from the token: no namespace']}

我基本上正在执行以下操作。
  1. Installed Hashicorp Vault in EC2 server, enabled AWS authentication

  2. Set up policy & role in the Vault using an AWS role

  3. Created a Python-based AWS Lambda function that is generating signed AWS STS request

  4. Using the signed request, successfully login to the vault server. The response is as follows.

    {
    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
    

    }

  5. Now using the client-token from above response trying to fetch a secret key as shown below

    secretKey = requests.get(url1,headers = {"X-Vault-Token": clienttoken})

  6. I am getting following error immediately after executing the above line.

    {u'errors': [u'error performing token check: failed to look up namespace from the token: no namespace']}


你尝试过在R编程环境中不带引号使用X-Vault-Token吗?那是我的问题所在。 - TJ87
3个回答

0

当我在CLI hashicorp中尝试使用get/put命令时,出现了这个错误:

    Error making API request.

URL: GET http://127.0.0.1:8200/v1/sys/internal/ui/mounts/secret
Code: 500. Errors:

* error performing token check: failed to look up namespace from the token: no namespace

错误在于我在环境变量中设置 VAULT_TOKEN 时使用了双引号。

这并没有真正回答问题。如果您有不同的问题,可以通过点击提问来提出。如果您想在此问题获得新的答案时得到通知,您可以关注此问题。一旦您拥有足够的声望,您还可以添加悬赏以吸引更多关注。- 来自审核 - Alexander L. Hayes

0

使用"Authorization: Bearer token"头部代替"X-Vault-Token: token"头部


0

命名空间功能需要Vault Enterprise平台。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接