How to Configure and Use Secure Properties In Mule 4

How to Configure and Use Secure Properties In Mule 4

Properties in Mule 4 can be encrypted to keep our sensitive data like ClientID and Client Password. Take a look at how to create and configure secure properties in Mule 4. Let’s discuss how to achieve this using MuleSoft's Secure Property.

Properties in Mule 4 can be encrypted to keep our sensitive data like ClientID and Client Password. Secure property module provided by mulesoftWe can be used to encrypt a .yaml or .properties file. Generally, in properties files, we store information like Client ID, Secret, UserId, UserPassword, Splunk Tokens, Oauth Token, AWS Keys, etc. 

We need to encrypt the data inside any property files to restrict unauthorized access and to protect the data. 

Let’s discuss how to achieve this using MuleSoft's Secure Property.

Creating Secure Properties Is Done in Three Steps

Step 1: Create a configuration properties file.

Step 2: We can encrypt the whole file or encrypt individual property. For individual property, we can define secure properties in the file by enclosing the encrypted values between the sequence![value].

Step 3: Configure the file in the project with the Mule Secure Configuration Properties Extension module dependency. The file must point to or include the decryption key.

Create a Configuration Properties File

The first task in securing configuration properties is to create a YAML configuration file (.yaml) or a Spring-formatted Properties file (.properties), where you define the properties in src/main/resources in your Mule project. The Mule Secure Configuration Properties extension module enables you to configure YAML or Properties file types.

Refer to the below artifacts for more information.

Open Anypoint Studio -> Go to Project Folder -> src/main/resources ->Select Create New file(File extension can be either .yaml or .properties)

 test.yaml

dev.properties

The following test.yaml, dev.properties files contains non encrypted configuration properties values:

test.yaml (sample yaml file)

http:

  port: "8081"

username: "[email protected]"

password: "1254343654pp"

dev.properties (sample properties file)

encrypted.value1= sfdsgfdgfj1234566

encrypted.value2= xyz123568abc

testPropertyA=testValueA

testPropertyB=testValueB

mule 4 mulesoft 4 mule api anypoint mulesoft mule security api

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

API Security Weekly: Issue #101

After the special 100th edition last week, which was all about API security advice from the industry’s thought leaders, this week we are back to our regular API security news, and we have twice the number of them, from the past two weeks.

Custom Maven Plugin in Mule 4

raml-sync-checker custom Maven plugin is used to check if the RAML in mule 4 app - API implementation is in sync with the RAML published in Anypoint Exchange.

How to Properly Leverage Elasticsearch and User Behavior Analytics for API Security

How to set up Elasticsearch and Kibana for User Behavior Analytics (UBA) in API Security Monitoring — Accurately identify API security vulnerabilities. Let's learn How to Properly Leverage Elasticsearch and User Behavior Analytics for API Security

API Security Weekly: Issue #104

This week, see recent API-related vulnerabilities at Twitter and Grandstream Networks, the newly added support for mutual TLS (mTLS) in AWS API Gateway, and more.