- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
09-04-2025 07:24 AM
Hey everyone,
I was trying to demystify the Conjur policy replace command because all my colleagues have nightmares with it.
For my first test, I tried using replace on the root policy, and as I expected… I lost everything! So, be very careful when running:
conjur load policy -b root -f <file>.yml
For my second test, I created a policy with several sub-policies inside it. I gave one of them the wrong name and tried to use replace to fix it, but… it didn’t work as I expected.
Here’s the first yaml that I used to create the policies:
Then, I created a second yaml, trying to fix the policy name, note that I used the replace command with this yaml:
But instead of replacing all the policie within test-replace, it just added a new one. I thought
replace would delete the old policy and recreate everything, but apparently, that’s not what happens.
I know the easiest way to fix the policy name is to delete it and recreate it with the correct name, but my goal here was to better understand how conjur policy replace actually works.
Could anyone help me clarify this behavior?
Thanks in advance!
09-04-2025 08:40 AM
Hi @l b
I suppose the explanation you are looking for is mentioned in the official documentation here (Example: Replace nested policy objects)
https://docs.cyberark.com/conjur-enterprise/latest/en/content/operations/policy/statement-ref-policy.htm#Examples
Does it clarify this behaviour you've got in your labs?
09-04-2025 08:40 AM
Hi @l b
I suppose the explanation you are looking for is mentioned in the official documentation here (Example: Replace nested policy objects)
https://docs.cyberark.com/conjur-enterprise/latest/en/content/operations/policy/statement-ref-policy.htm#Examples
Does it clarify this behaviour you've got in your labs?
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

