You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the "userpass" authentication backend with Identity and Groups it seems that the token renewal breaks when the Equivalence of policy is checked with the following error
failed to renew entry: policies have changed, not renewing
I am sure i did not apply any change to any policy or any Group/Entity policy membership. See below
This works fine when the user is not part of any Group and has policies applied directly to the userpass identity when it gets created
This can be reproduced with the script linked below , the process i am following does
Create a USer
Create an Identity Entity
Create an Identity Entity Alias
Create a Group with associated policy
Login as user
Try to renew token
So i don't think i am actually causing any change in policy that would explain the error.
Additional context
I tried the same workflow using an approle instead of the userpass backend and it works as expected .. even though i could not find any use of policyutil.EquivalentPolicies in the approle token renewal function , is this check performed differently in the approle vs the userpass ?
The text was updated successfully, but these errors were encountered:
1) In backends, ensure they are now using TokenPolicies
2) Don't reassign auth.Policies until after expmgr registration as we
don't need them at that point
Fixes#4829
1) In backends, ensure they are now using TokenPolicies
2) Don't reassign auth.Policies until after expmgr registration as we
don't need them at that point
Fixes#4829
Describe the bug
When using the "userpass" authentication backend with Identity and Groups it seems that the token renewal breaks when the Equivalence of policy is checked with the following error
failed to renew entry: policies have changed, not renewing
I am sure i did not apply any change to any policy or any Group/Entity policy membership. See below
This works fine when the user is not part of any Group and has policies applied directly to the userpass identity when it gets created
This can be reproduced with the script linked below , the process i am following does
So i don't think i am actually causing any change in policy that would explain the error.
Digging a bit deeper , the issue is raised here: https://github.com/hashicorp/vault/blob/master/builtin/credential/userpass/path_login.go#L122 from the function policyutil.EquivalentPolicies
I added a bit of debug to it
And the problem printed to stderr is that the lenght of the user.Policies passed from path_login.go is actually 0
Policy Equivalence Failed: length of sortedA 0 different from sortedB 1
It would seem that user.Policies does not include the IdentiyPolicies while the req.Auth.Policies does ?
To Reproduce
Steps to reproduce the behavior:
vault server -dev
Expected behavior
Token Renew successfully
Environment:
vault status
): 0.10.3 and mastervault version
): 0.10.3 and masterVault server configuration file(s):
https://paste.debian.net/hidden/e6e0f189/
Additional context
I tried the same workflow using an approle instead of the userpass backend and it works as expected .. even though i could not find any use of policyutil.EquivalentPolicies in the approle token renewal function , is this check performed differently in the approle vs the userpass ?
The text was updated successfully, but these errors were encountered: