How To Store Conjur Master Key In Vault
Objective
In some specific cases, while encrypting server keys using a "master.key" file there is a requirement to store the Conjur Master Key in the Vault
Due to the difference between the UNIX characters created by the command "openssl rand 32 > /secrets/master.key" and the Windows ones used in the Vault perspective, they can't be copied and pasted correctly
Environment
Conjur
Procedure
To workaround this case, the "master.key" can be encrypted in 'base64' format after its generating:
openssl rand 32 > /secrets/master.key
cat /secrets/master.key | base64
After that, the 'base64' output based on the applicable characters can be added to the Vault as a new Account (for instance, in the Platform cloned from <Application/CyberArk Vault>)
Note, when the "master.key" is needed to be fetched from the Vault and to be used on the Conjur hosts, it's necessary to decode it in the same 'base64' format
cat /secrets/master_base64.key | base64 -d > /secrets/master.key
Below there is an example of this process on the conjur host with generating "master.key", encoding in 'base64' and storing it into "master_base64.key", decoding the "master_base64.key" in 'base64' and storing the output into "master2.key", and then comparing the data between the initial "master.key" and newly generated "master2.key"