SumanKumar
SumanKumar

Reputation: 364

Hashicorp Vault: failed to look up namespace from the token

I have installed Hashicorp Vault in the AWS EC2 server and trying to access the secret keys stored in the vault using AWS Lambda function using "AWS Authentication". But I am getting the following error.

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

I am basically doing the following

  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']}

Upvotes: 4

Views: 6078

Answers (3)

Kimiya Sharifk
Kimiya Sharifk

Reputation: 41

The namespaces feature requires Vault Enterprise Platform.

Upvotes: 0

JavaSash
JavaSash

Reputation: 37

I have this error when try get/put commands in CLI hashicorp:

    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

Error was that I'm used "" when set VAULT_TOKEN in env variable

Upvotes: 0

mistakeNot
mistakeNot

Reputation: 783

instead of "X-Vault-Token: token" header use "Authorization: Bearer token"

Upvotes: 0

Related Questions