Software Development

How to Hide CloudHub Properties?

Main points:

  • property values can be hidden in Runtime Manager
  • property names must be listed in the mule-artifact.xml file
  • property values can be edited manually and will remain masked
  • values remain masked even if removed from mule-artifact.xml file

CloudHub Properties

CloudHub supports the hiding of application properties in Anypoint Runtime Manager. The property name is displayed but the value is masked with asterisks, although it can be edited manually via the Properties tab.

Configure properties the to hide

Add the name of the properties you want to be obscured in Runtime Manager to the mule-artifact.json file to the secureProperties array. You will find it located at the root of the Mule application project.

1
2
3
4
5
6
{
  "secureProperties": [
   "database.mysql-password",
  "certificate.encypt-code" ],
   "minMuleVersion": "4.3.0"
}

Fig 1: the mule-artifact.json for the my-mule-application

In the above mule-artifact.json file, the values assigned to the properties mysql-password and encrypt-code will be hidden from view in the application’s settings as can be seen in the screenshot below.

Deploy the Mule application to CloudHub

Fig 2: The properties tab in Anypoint Runtime Manager show masked property values

Once your application has been deployed, the hidden properties (name and value) will not be listed in the Properties tab. It won’t be until the name and value of a property are overridden, by adding them manually to the property tab, that the property’s value will be displayed and masked.

1
2
3
4
5
database:
  mysql-username: "admin"
  mysql-password: "password123"
certificate:
  encypt-code: "qwerty123"

Fig 3: the properties.yaml file

Hidden properties

The hidden properties are not output in the console or sent/received between the CloudHub server and the console.

After you set the property, it cannot be retrieve it; however, you can overwrite the property with a new value. To update a value, enter a new value into the field.

If you remove the property name from the secureProperties definitions in your mule-artifact.json file and then redeploy to CloudHub, the secure properties remain masked.

Published on Java Code Geeks with permission by Alex Theedom, partner at our JCG program. See the original article here: How to Hide CloudHub Properties?

Opinions expressed by Java Code Geeks contributors are their own.

Alex Theedom

Alex Theedom is a Senior Java Developer and has recently played a pivotal role in the architectural design and development of a microservice based, custom built lottery and instant win game platform. Alex has experience of Java web application development in a diverse range of fields including finance, e-learning, lottery and software development. He is the co-author of Professional Java EE Design Patterns and many articles.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button