Replies: 1 comment 3 replies
-
@itman53 Hmm, I think this error message is confusing and I'd definitely welcome a PR to clarify it. I believe it is saying that, the list of policy names on the child token should be a subset of the list of policy names on the parent. So you'd have to add the (That is, there is no logic which says whether a given policy is a direct subset of another policy, we merely compare names as you found, and this is expected.) That said, I rarely find this type of direct token creation to quite be the right solution. What was your end to end use case here and auth flow here? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro:
I am new to using OpenBao and I have never posted anything on github or on OpenBao. So please forgive me if I make mistakes or if I'm using this Q&A section in an incorrect manner.
I'm trying to use OpenBao in a python project I'm developing to keep and access secrets in a secure way.
Problem:
I am trying to create a token with a policy that is meant to be a subset of another policy. I'm attempting to do this via the API which I'm accessing using
curl
. Here is thecurl
command I'm using:Here is the error response I am getting:
Policies I'm using:
techrel-machine-manager.hcl
techrel-reader.hcl
Reproduce the problem:
techrel-machine-manager
policy on your system.techrel-reader
policy on your system.techrel-machine-manager
policy. This token is created withroot
as the parent. I'm using a API call viacurl
that looks like this to do this.This command should produce the "child policies must be subset of parent" error.
My temporary workaround this problem:
I order to continue moving forward on my project, I have define a token that has the
root
policy. Then I'm using that token to define a child token that uses thetechrel-reader
policy. I think this will open my system to security issues since I'll have a token being used in my python code that uses thismachine_mgr_token
token.Possible bug:
I am a programmer by profession and training but I do not know the go language.
I did look up the string "child policies must be subset of parent" in the source code for OpenBao. I found 2 locations where it is used:
In this case, it is in a block of code that looks like this:
In this case, it is in a block of code that looks like this:
Since I don't know go, I couldn't follow the logic any further. But applying the principles from other programming languages that I do know, it appears as if logic in
vault/token_store.go
is looking a thecapabilities
collection/array and comparing the subset (the child policy) with the parent policy. Give the way I wrote the policies, I don't see why I should be getting an error. That's why I suggest it could be a bug.My use case:
What I'm trying to accomplish with the
techrel-machine-manager
policy is to create authority to provide a full range of functionality to forpostgres
andauth/token
paths. A token with this policy would fulfill an administrative role by creating tokens for users that have thetechrel-reader
policy. Users with a token with thetechrel-reader
policy would be database users and they would use the secrets in the postgre path to connect to the DB & to get their DBrole
name.Improved error message
From my point of view, the error message is extremely unhelpful. I would like to see a change in the code to provide the context of the error to help the user figure out how to fix the failing policy.
Other possible causes
Since I'm so new to OpenBao, it could by my own ignorance of how policies work. I've tried my best to figure out how they work but I found the documentation hard to understand.
Please help
I would appreciate any help that anyone can offer in helping me resolve this issue. it-man at mailfwdr.com
Beta Was this translation helpful? Give feedback.
All reactions