Skip to content

A Step-by-Step Guide to Mulesoft Encryption

  • September 21, 2022

Mulesoft can be a fickle friend and I personally struggled to find very direct and straightforward content around general practices in it. This is compiled with the intention of being a step-by-step guide in an easy-to-read and easy-to-execute manner. I’m technical but I wouldn’t say I know how to code everything and every term that is utilized in Mulesoft so I write with the intention that any level will understand.

Get the secure .jar file from Mulesoft (can be found from this link https://docs.mulesoft.com/mule-runtime/4.4/secure-configuration-properties, if you click the following link it kicks off the download immediately): https://docs.mulesoft.com/downloads/mule-runtime/4.2/secure-properties-tool.jar

Place in a folder - picture below is for reference: 

A Step-by-Step Guide to Mulesoft Encryption_1_220920

 

Command line activities: 

cd to the location you put the .jar file. 

Run the following to encrypt the passwords you'd like: 

C:\Users\ckingstad\OneDrive - Continuus Technologies\Documents\Clients\Muley\Encryption>java -cp secure-properties-tool.jar com.mulesoft.tools.SecurePropertiesTool string encrypt Blowfish CBC mulesoft examplePassword

A Step-by-Step Guide to Mulesoft Encryption_1b_220920
 

 

In the above the last few are interchangeable! So I use Blowfish algorithm encryption, CBC method, and I use the key of Mulesoft. You could use any key here as you will just specify in the secure configuration. Last item "examplePassword" would be an example of the password so this will change each time you encrypt a password. 

The output of the ran command is your encrypted password that will be placed in the yaml. 

A Step-by-Step Guide to Mulesoft Encryption_2_220920

 

In Mulesoft you will do a few steps: 

  1. Update yaml password with the encrypted: '![encrypted_password]'
  2. Update your config tools in global to be ${secure::yaml_details.element}
  3. Go into exchange in your palette and search for secure and add Mulesoft Secure Configuration.
  4. Global elements and add in the Secure configuration details: this will only be available after completing step 3!
  5. The file will be your yaml file - this can be found in your global configuration element - or typically ${mule.env}-config.yaml. Basically, whatever your yaml file is named with your properties information. This is just pointing you to where you want to decrypt. Your key is what you encrypted with in the cmd steps noted above - in our example it is MuleSoft. And then be sure to set your encryption algorithm and methods to be proper to the cmd line steps.

image ref 1

A Step-by-Step Guide to Mulesoft Encryption_3_220920

 

image ref 2

A Step-by-Step Guide to Mulesoft Encryption_4_220920

 

image ref 3

A Step-by-Step Guide to Mulesoft Encryption_5_220920

 

image ref 4

A Step-by-Step Guide to Mulesoft Encryption_6_220920

 

image ref 5

A Step-by-Step Guide to Mulesoft Encryption_7_220920

 

I hope this is helpful to anyone else who finds the current material a little confusing. This is purely for encrypting a string out of a yaml file though. Some different steps must be taken when encrypting an entire yaml file.

 

Links

 

RELATED NEWS

Contribute on my charity work by your donation.

Easy Button: Alteryx Server Log Collection

Collecting Logs for Alteryx Support 

Background

Occasionally you may encounter an issue with your Alteryx server that...

by Conrad Kite

The Power of Snowflake and FactSet

The days of hosting big technology and staff or spending thousands to access fast information are over. The Data Cloud...

by Andy Leichtle