Translate

Thursday 2 November 2023

How to mask the properties in runtime manager

 

How to mask the properties in runtime manager ?

To mask the properties in Runtime Manager, you can use the Secure Properties feature. Secure Properties allows you to encrypt and decrypt sensitive properties, such as passwords and database credentials.

https://youtu.be/ia_tMstYSfM

To mask a property using Secure Properties, follow these steps:

1.    In the Runtime Manager console, go to the Applications page.

2.    Click the name of the application that contains the property you want to mask.

3.    In the Settings tab, click Properties.

4.    Under Secure Properties, click Add.

5.    Enter the name of the property you want to mask.

6.    Enter the value of the property you want to mask.

7.    Click Save.

The property will now be masked in the Runtime Manager console. To view the value of the property, you will need to decrypt it.

To decrypt a property, follow these steps:

1.    In the Runtime Manager console, go to the Applications page.

2.    Click the name of the application that contains the property you want to decrypt.

3.    In the Settings tab, click Properties.

4.    Under Secure Properties, click the name of the property you want to decrypt.

5.    Click Decrypt.

6.    The value of the property will be displayed in the Value field.

You can also use the Mule Runtime API to mask and decrypt properties. For more information, please see the Mule Runtime API documentation.

Here is an example of how to mask a property using the Mule Runtime API:

 

import org.mule.runtime.api.util.EncryptionUtils;

public class MaskPropertyExample {

    public static void main(String[] args) {

        String propertyName = "password";
        String propertyValue = "mypassword";

        // Encrypt the property value.
        String encryptedPropertyValue = EncryptionUtils.encrypt(propertyValue);

        // Mask the property value.
        String maskedPropertyValue = EncryptionUtils.mask(propertyValue);

        // Print the encrypted and masked property values.
        System.out.println("Encrypted property value: " + encryptedPropertyValue);
        System.out.println("Masked property value: " + maskedPropertyValue);
    }
}


This example will print the following output:

 

Encrypted property value: c0364b84689305826e7f0803a0f13f02
Masked property value: ******


I hope this helps!

 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.