mulesoftmule-studioanypoint-studio

Where to store key for Secure Configuration Properties?


I encrypted my properties and wanted to use Secure Configuration Properties, but I don't understand where to store the key. I tried setting it in Run configuration Environment, Argumets, and also as my System environment variables, but my project would fail to run.


Solution

  • You need to define a configuration property to use it to configure the password. Use one of these options:

    Command line:

    mule -M-Dsecret=123456
    

    wrapper.conf:

    wrapper.java.additional.999=-Dsecret=123456
    
    1. Right-click your project in Package Explorer.
    2. Click Run As > Run Configurations.
    3. Pick the Arguments tab.
    4. Add your arguments to the VM arguments field, preceding property names with -D
    1. Log in to your Anypoint Platform account.
    2. Click Runtime Manager.
    3. Either click Deploy Application to deploy a new application, or select a running application and click Manage Application.
    4. Select the Properties tab in the Settings section.

    After you set the property with whichever method you can use it directly in the configuration:

    <secure-properties:config key="${secret}" file="config.yaml" name="config">
        <secure-properties:encrypt/>
    </secure-properties:config>