I’m trying to create a new token with a specific policy assigned to it.
vault token lookup
shows these policies for my current token (actual names have been changed):
identity_policies [foo bar foobar]
policies [default]
I want to create a new token with the foobar policy only. I’m running this command:
vault token create -policy=foobar
This command fails with this error:
Error creating token: Error making API request.
URL: POST https://vault:8200/v1/auth/token/create
Code: 400. Errors:
* child policies must be subset of parent
Why is this happening? My current token has the policy I’m trying to assign to the new token. Isn’t this what “subset of parent” means?
Many thanks,
Max