Open kdefives opened 4 years ago
Hello @raskchanky please can you confirm or not if this is a confirmed bug?
Thx in advance. Regards
@kdefives Thank you for your patience! I've been able to verify that vault policy write
doesn't check if the policy path exists or not before writing the policy, so that part is not a bug.
It's not immediately obvious to me why an incorrect path in the policy for group 1 should affect group 2. I do notice in your example, however that MyRoleName
is used by both group 1 and group 2 as well as the terraform, so maybe that's related? I'll have to dig a little further on this one.
Describe the bug
Context: We are using HCL file to manage our Vault policies for each of our groups. We added a policy to the group 1 with this command line:
The content of group-1.hcl is:
We added policy to the group 2 with this command line:
The content of group-2.hcl is:
With this config, everything is good and everythings works fine until we did the mistakes explained below.
Today, we had to change the policies of group 1 and we updated the HCL policy file with a mistakes:
And we did this in CLI to apply new policy:
As you can see, in the HCL file the new path added contains a non-existing path. (Obviously, in reality it was added by mistakes...). But when i did the "vault policy write" above, vault displayed that the update was done succesfully. Even if the path didn't exists in reality.
The problem is, in my case, after we applied the config below with the error, when i tried to get the secret engine with of group 2 with Terraform, i got this error message:
The terraform code to get datasource is this:
To fix this problem, we had to find and fix the wrong value in the path for the other group and when we fix it, we did a new "vault policy write" for both groups and after that, the Terraform stack for group 2 was working.
To Reproduce Steps to reproduce the behavior:
Expected behavior
Environment:
vault status
): 1.4.1vault version
): Vault v1.1.1 (cgo)Vault server configuration file(s):
Feel free to let me know if you need for info and/or if it is not clear enough.
Regards,