π Custom Mulesoft Properties Provider Connector for Exchange-Managed Keystores & Truststores! π
Managing keystores and truststores in Mulesoft applications can be a challenge, especially when they need frequent updates. Traditionally, these sensitive files are bundled inside application resources, requiring a redeployment every time they change.
Weβve developed a custom Mulesoft Properties Provider Connector that dynamically loads files from a custom Exchange asset, eliminating the need for manual updates within the application!
π How It Works
β
Instead of storing keystores (.p12) or truststores inside Mulesoft application resources, our connector fetches them dynamically from Anypoint Exchange.
β
At startup, the connector downloads and unpacks the latest stable version of an Exchange asset into the CloudHub workerβs temp directory.
β
Files can be referenced locally, allowing Mule to load keystores and truststores dynamically.
βοΈ Key Features
πΉ Exchange-Managed Security Artifacts β No need to store keystores/truststores inside Mule apps. Manage them centrally in Exchange.
πΉ Dynamic Asset Loading β Fetches and extracts the latest version of a specified Exchange asset at runtime.
πΉ Secure & Configurable β Requires authentication using Connected App credentials with Exchange read permissions.
πΉ Flexible Deployment β Supports different Anypoint Platform hosts (default: US Commercial, but can be customized for GovCloud or other instances).
π Required Configuration Parameters
To access Exchange assets, the connector requires:
β Connected App Client ID
β Connected App Client Secret
β Group ID (Organization ID where the asset is stored)
β (Optional) Anypoint Host (Default: anypoint.mulesoft.com
)
π Example Use Case: Loading a TLS Asset
In this example, we dynamically load “myapp-asset-tls” from Exchange. The asset is a .zip
archive containing a tls
folder with environment-specific keystores:
π tls/
βββ dev.p12
βββ uat.p12
βββ prod.p12
During application startup, the asset is downloaded, extracted, and stored in the CloudHub temp directory, making it accessible as a local file.
Hereβs how itβs configured in MuleSoft:
<dynamic-asset-loader-properties-provider:config name="Dynamic_Asset_Loader_Properties_Provider_Config"
doc:name="Dynamic Asset Loader Properties Provider Config" />
<tls:context name="https-tls-context" doc:name="TLS Context">
<tls:trust-store />
<tls:key-store type="pkcs12" path="${dynamic-asset::myapp-asset-tls/ssl/@(env).p12}"
alias="${tls.keystore.alias}"
keyPassword="${secure::tls.keystore.keyPassword}"
password="${secure::tls.keystore.password}"/>
</tls:context>
π The keystore path is dynamically resolved as:
β‘ ${dynamic-asset::myapp-asset-tls/ssl/@(env).p12}
(For example, dev.p12
for dev, uat.p12
for uat environments)
π Why This Matters
πΉ No More Manual File Management β Security artifacts are centrally managed in Exchange.
πΉ Zero-Downtime Keystore Updates β Change keystores/truststores without redeploying the application.
πΉ Enhanced Security β Removes sensitive files from the codebase and application resources.
This is a game-changer for teams looking to streamline TLS/SSL certificate management in Mulesoft applications. π
π¬ What do you think about this approach? Would you like to see more dynamic asset management solutions for Mulesoft?