Logo

dev-resources.site

for different kinds of informations.

Quick guide to secure/encrypt your properties in MuleSoft

Published at
2/12/2024
Categories
security
encryption
mulesoft
mule4
Author
Alex Martinez
Quick guide to secure/encrypt your properties in MuleSoft

NOTE
This post is to generate your encrypted values by manually using the JAR file. You can also use the (unofficial) UI or refer to this article.

Download the Secure Properties Tool Jar file from the Mule docs

You can see in the docs how to encrypt your properties with different scenarios, but the following scripts are the ones I use the most.

Encrypt one value at a time

I normally use the Blowfish algorithm and the CBC mode:

java -cp secure-properties-tool.jar com.mulesoft.tools.SecurePropertiesTool \
string \
encrypt \
Blowfish \
CBC \
your_secure_key \
"value_to_encrypt"

Then, just make sure to add ![] in your properties file.

Encrypt the whole file (per value)

If you don't want to do the previous script for all of the values, you can also run this instead:

java -cp secure-properties-tool.jar com.mulesoft.tools.SecurePropertiesTool \
file \
encrypt \
Blowfish \
CBC \
your_secure_key \
input_file.yaml \
output_file.yaml

This will automatically add the ![] syntax to each value.

Featured ones: