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
Vault fails to delete Consul tokens that are created by a role that has a namespace set. It appears to use the namespace of the secrets engine, rather than the namespace of the token that it is attempting to delete. This will only affect scenarios where the secrets engine token is not created in the same namespace that the tokens it issues are in.
To Reproduce
Steps to reproduce the behavior:
Create a Consul secrets engine, ensuring it is configured with the "default" Consul namespace but with an ACL policy that grants acl: write in namespace "B".
Create a Consul credentials role, specify a Consul namespace of "B"
vault read consul/creds/the-role-created-in-step-2 -- the token is issued correctly
Observe that once the TTL is reached, Vault fails to delete the token from Consul.
Request error: method=DELETE url=/v1/acl/token/xxx-192f5a from=x.x.x.x:61490 error="rpc error making call: Permission denied: token with AccessorID 'xxx502b5' lacks permission 'acl:write'"
resource"consul_acl_policy""app_deploy" {
# brevity: a policy that allows service write and KV permissions for an app
}
resource"vault_consul_secret_backend_role""app_deploy" {
for_each=local.namespace_environmentsconsul_namespace="${var.namespace}-${each.key}"name="app-deploy-${var.namespace}-${each.key}-${local.safe_app_name}"backend="consul"policies=[consul_acl_policy.app_deploy[each.key].name]
ttl=300max_ttl=300
}
The text was updated successfully, but these errors were encountered:
Describe the bug
Vault fails to delete Consul tokens that are created by a role that has a namespace set. It appears to use the namespace of the secrets engine, rather than the namespace of the token that it is attempting to delete. This will only affect scenarios where the secrets engine token is not created in the same namespace that the tokens it issues are in.
To Reproduce
Steps to reproduce the behavior:
acl: write
in namespace "B".Expected behavior
Vault should successfully delete the token from Consul. My guess is that it is not specifying the correct Consul namespace when attempting the delete.
Environment:
vault status
): 1.13.0+entvault version
): 1.13.0Additional context
Consul version: v1.16.1+ent
The secrets engine and role are provisioned with Terraform, see:
Secrets engine
Secret backend role
The text was updated successfully, but these errors were encountered: