2 Replies Latest reply on Apr 17, 2018 5:23 AM by alireza.alallah

    Vault encrypted system-properties from webapp

    giufusacc

      Hi,

       

      do you know (if possible) how to read vault encrypted system-property values (in standalone.xml) from a webapplication deployed in JBoss AS 7?

       

       

      Thank you

        • 1. Re: Vault encrypted system-properties from webapp
          giufusacc

          From your java class:

           

          String pwd = System.getProperty("yourPropName");

           

          try {

              pwd = SecurityVaultUtil.getValueAsString(pwd);

          } catch (SecurityVaultException e) {

               ...           

          }

           

           

          Naturally, before you should:

          1) create a keystore;

          2) encrypt and store pwds with vault script;

          3) configure vault block in jboss configuration file;

          4) set a system-property with name="yourPropName" and value="VAULT::block_value::password::MGU4MzM4...."

          • 2. Re: Vault encrypted system-properties from webapp
            alireza.alallah

            Hello thanks for helpful answer ,

            How I can add a property in jboss-cli with encrypt value? and retrieve value in application with SecurityVaultUtil?

            I want to add custom property in system-properties section with above condition

            best regards