Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vault secrets list permission denied

I can't understand how secrets list works. I have policy with path permission.

path "sys/mounts/*" {
capabilities = ["create", "read", "update", "delete", "list","sudo"]
}

I can run enable and disable flags

$ vault secrets enable -path=Test kv
Success! Enabled the kv secrets engine at: Test/
$ vault secrets disable Test
Success! Disabled the secrets engine (if it existed) at: Test/

But I can't run list or move

vault secrets list
Error listing secrets engines: Error making API request.

URL: GET http://localhost:8200/v1/sys/mounts
Code: 403. Errors:

* permission denied

vault secrets move Test Test2
Error moving secrets engine Test/ to Test2/: Error making API request.

URL: POST http://localhost/v1/sys/remount
Code: 403. Errors:

* permission denied

Its not a file system permission issue, after change admin-token to root-token everything work fine. So anyone can explain me this behavior ?

like image 921
3sky Avatar asked Jul 12 '18 12:07

3sky


People also ask

What is the proper command to enable the AWS secrets engine at the default path?

The secrets enable command enables an secrets engine at a given path.

What is cubbyhole vault?

The term cubbyhole comes from an Americanism where you get a "locker" or "safe place" to store your belongings or valuables. In Vault, the cubbyhole is your "locker". All secrets are namespaced under your token. If that token expires or is revoked, all the secrets in its cubbyhole are revoked as well.

How do I get my token from Hashicorp vault?

Users can generate a personal access token from the settings page on their GitHub account. Authenticate using a GitHub token: $ vault login -method=github token=abcd1234 ## ... The output displays an example of login with the github method.

What is vault namespace?

Namespaces are isolated environments that functionally exist as "Vaults within a Vault." They have separate login paths and support creating and managing data isolated to their namespace.


1 Answers

Try:

path "sys/mounts" {
capabilities = ["read"]
}

The command are performed on sys/mounts, not sys/mounts/*

like image 96
gic186 Avatar answered Oct 04 '22 02:10

gic186