Secure Properties Placeholder
As the name suggest it’s another level of security which can be applied in MuleSoft application code base. Some application related data are confidential and should not be put as plain text in code base. to manage confidential data efficiently we have secure properties placeholder.
First create a secure properties file – add secure properties plugin
After encryption
Please choose your appropriate encryption algorithm and key
Goto Global Element -> Choose Global Type -> filter – Secure
If you cannot see the Secure Configuration Property option then please do following
Click search in exchange
Type – secure
Add the Mule Secure Configuration Property module and Click Finish
Go back to Global properties and search for secure properties config
Provide the correct key and encrypt algorithm (chosen while creating the secure properties file)
This will create a Secure Properties Config
To read secure properties in Mule flow – ${secure::database.username}
To read secure properties in Dataweave – p(‘secure::database.username’)
Dataweave expression
%dw 2.0 output application/java --- log("DB username ", p('secure::database.username') as String) ++ log("DB password ", p('secure::database.password') as String)
Logs
Sample application – secure-properties-application