Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-6260

Jasypt not using its master password until component restarts

    XMLWordPrintable

Details

    • % %
    • Hide

      The following sequence works in Fuse 6.2.1 Rollup 3 and fails in Fuse 6.2.1 Rollup 4:

      1. Install Fuse from jboss-fuse-full-6.2.1.redhat-159.zip

      2. Start Fuse

      3. Create a single-node Fabric:

      > fabric:create --wait-for-provisioning --zookeeper-password admin --clean
      

      4. Install the jasypt-encryption feature:

      >  profile-edit --feature jasypt-encryption default 1.0
      

      5. Set an encryption password:

      > crypt-password-set gingerbreadman
      

      6. Encrypt a test password containing special characters

      > encrypt-message doctor\'123\"death
      

      7. Create a properties file to hold the encrypted password:

      > profile-edit --resource test.passwords.properties default 1.0
      test.password=${crypt:Ck1dO1+nejZeNV1Labxe4IQVvVVsPBWx+ZvsWeGjY0U=}
      

      (save and exit)

      Under earlier versions, the password is successfully decrypted and can be viewed in ConfigAdmin:

      2016-11-09 18:50:04,199 | INFO  | admin-1-thread-1 | FabricConfigAdminBridge          | 145 - io.fabric8.fabric-configadmin - 1.2.0.redhat-621117 | Updating configuration test.passwords
      
      > config:list | grep death
         test.password = doctor'123"death
      

      Under Fuse 6.2.1 Rollup 4 an exception is thrown and the property is unavailable in ConfigAdmin:

      org.jasypt.exceptions.EncryptionOperationNotPossibleException
      	at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1075)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at io.fabric8.service.EncryptedPropertyResolver.resolve(EncryptedPropertyResolver.java:151)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl$2.getValue(FabricServiceImpl.java:1344)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:187)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:257)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl.substituteConfigurations(FabricServiceImpl.java:1340)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.api.Profiles.getEffectiveProfile(Profiles.java:169)[141:io.fabric8.fabric-api:1.2.0.redhat-621159]
      	at io.fabric8.features.FabricFeaturesServiceImpl.listInstalledRepositories(FabricFeaturesServiceImpl.java:370)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159]
      	at io.fabric8.features.FabricFeaturesServiceImpl.run(FabricFeaturesServiceImpl.java:108)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl.doRunCallbacks(ZkDataStoreImpl.java:211)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl.access$000(ZkDataStoreImpl.java:86)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl$1.run(ZkDataStoreImpl.java:199)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_91]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91]
      	at java.lang.Thread.run(Thread.java:745)[:1.7.0_91]
      
      Show
      The following sequence works in Fuse 6.2.1 Rollup 3 and fails in Fuse 6.2.1 Rollup 4: 1. Install Fuse from jboss-fuse-full-6.2.1.redhat-159.zip 2. Start Fuse 3. Create a single-node Fabric: > fabric:create --wait- for -provisioning --zookeeper-password admin --clean 4. Install the jasypt-encryption feature: > profile-edit --feature jasypt-encryption default 1.0 5. Set an encryption password: > crypt-password-set gingerbreadman 6. Encrypt a test password containing special characters > encrypt-message doctor\'123\"death 7. Create a properties file to hold the encrypted password: > profile-edit --resource test.passwords.properties default 1.0 test.password=${crypt:Ck1dO1+nejZeNV1Labxe4IQVvVVsPBWx+ZvsWeGjY0U=} (save and exit) Under earlier versions, the password is successfully decrypted and can be viewed in ConfigAdmin: 2016-11-09 18:50:04,199 | INFO | admin-1-thread-1 | FabricConfigAdminBridge | 145 - io.fabric8.fabric-configadmin - 1.2.0.redhat-621117 | Updating configuration test.passwords > config:list | grep death test.password = doctor'123"death Under Fuse 6.2.1 Rollup 4 an exception is thrown and the property is unavailable in ConfigAdmin: org.jasypt.exceptions.EncryptionOperationNotPossibleException at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1075)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3] at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3] at io.fabric8.service.EncryptedPropertyResolver.resolve(EncryptedPropertyResolver.java:151)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at io.fabric8.service.FabricServiceImpl$2.getValue(FabricServiceImpl.java:1344)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:187)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159] at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:257)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159] at io.fabric8.service.FabricServiceImpl.substituteConfigurations(FabricServiceImpl.java:1340)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at io.fabric8.api.Profiles.getEffectiveProfile(Profiles.java:169)[141:io.fabric8.fabric-api:1.2.0.redhat-621159] at io.fabric8.features.FabricFeaturesServiceImpl.listInstalledRepositories(FabricFeaturesServiceImpl.java:370)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159] at io.fabric8.features.FabricFeaturesServiceImpl.run(FabricFeaturesServiceImpl.java:108)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159] at io.fabric8.service.ZkDataStoreImpl.doRunCallbacks(ZkDataStoreImpl.java:211)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at io.fabric8.service.ZkDataStoreImpl.access$000(ZkDataStoreImpl.java:86)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at io.fabric8.service.ZkDataStoreImpl$1.run(ZkDataStoreImpl.java:199)[142:io.fabric8.fabric-core:1.2.0.redhat-621159] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_91] at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91] at java.lang. Thread .run( Thread .java:745)[:1.7.0_91]

    Description

      The jasypt-encryption feature under Fuse Rollup 4 is not handling escaped special characters, like single and double quotes as it did in Rollup 3 and earlier. When decrypting properties containing these characters under Rollup 4, jasypt throws the following exception:

      2016-11-09 18:44:57,689 | WARN  | admin-1-thread-1 | FabricConfigAdminBridge          | 145 - io.fabric8.fabric-configadmin - 1.2.0.redhat-621159 | Exception when tracking configurations. This exception will be ignored.
      org.jasypt.exceptions.EncryptionOperationNotPossibleException
      	at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1075)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at io.fabric8.service.EncryptedPropertyResolver.resolve(EncryptedPropertyResolver.java:151)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl$2.getValue(FabricServiceImpl.java:1344)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:187)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:257)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl.substituteConfigurations(FabricServiceImpl.java:1340)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.api.Profiles.getEffectiveProfile(Profiles.java:169)[141:io.fabric8.fabric-api:1.2.0.redhat-621159]
      	at io.fabric8.configadmin.FabricConfigAdminBridge.updateInternal(FabricConfigAdminBridge.java:134)[145:io.fabric8.fabric-configadmin:1.2.0.redhat-621159]
      	at io.fabric8.configadmin.FabricConfigAdminBridge.access$000(FabricConfigAdminBridge.java:51)[145:io.fabric8.fabric-configadmin:1.2.0.redhat-621159]
      	at io.fabric8.configadmin.FabricConfigAdminBridge$1.run(FabricConfigAdminBridge.java:105)[145:io.fabric8.fabric-configadmin:1.2.0.redhat-621159]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_91]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91]
      	at java.lang.Thread.run(Thread.java:745)[:1.7.0_91]
      2016-11-09 18:44:57,698 | WARN  | store-2-thread-1 | ZkDataStoreImpl                  | 142 - io.fabric8.fabric-core - 1.2.0.redhat-621159 | Caught: org.jasypt.exceptions.EncryptionOperationNotPossibleException
      org.jasypt.exceptions.EncryptionOperationNotPossibleException
      	at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1075)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)[28:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
      	at io.fabric8.service.EncryptedPropertyResolver.resolve(EncryptedPropertyResolver.java:151)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl$2.getValue(FabricServiceImpl.java:1344)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:187)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.zookeeper.utils.InterpolationHelper.substVars(InterpolationHelper.java:257)[149:io.fabric8.fabric-zookeeper:1.2.0.redhat-621159]
      	at io.fabric8.service.FabricServiceImpl.substituteConfigurations(FabricServiceImpl.java:1340)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.api.Profiles.getEffectiveProfile(Profiles.java:169)[141:io.fabric8.fabric-api:1.2.0.redhat-621159]
      	at io.fabric8.features.FabricFeaturesServiceImpl.listInstalledRepositories(FabricFeaturesServiceImpl.java:370)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159]
      	at io.fabric8.features.FabricFeaturesServiceImpl.run(FabricFeaturesServiceImpl.java:108)[150:io.fabric8.fabric-features-service:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl.doRunCallbacks(ZkDataStoreImpl.java:211)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl.access$000(ZkDataStoreImpl.java:86)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at io.fabric8.service.ZkDataStoreImpl$1.run(ZkDataStoreImpl.java:199)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_91]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91]
      	at java.lang.Thread.run(Thread.java:745)[:1.7.0_91]
      

      Attachments

        Issue Links

          Activity

            People

              pantinor@redhat.com Paolo Antinori
              rhn-support-dhawkins Duane Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: