Skip to content

Vault Token Capabilities #430

Answered by briantist
simon-mags asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @simon-mags , it's true there is no dedicated plugin to access this capability, but it is possible with existing content!

First, getting token capabilities is provided by two different API paths: sys/capabilities for querying any arbitrary token, and sys/capabilities-self for querying the token making the request. It's probably the latter that you want, given your use case.

We can see from the docs that these APIs take a POST verb which makes them writes, and it takes a parameter called paths which is a list of paths you want to check the capabilities against.

We can use the vault_write module or lookup to write to this endpoint.

- name: Check token capabilities
  register: token_caps
  

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by simon-mags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants