1 Reply Latest reply on Dec 11, 2017 9:32 AM by jewellgm

    How to Decrypt data source passwords in JBoss EAP 6.x/7.x

    sukeshpeddolla

      Hi,

       

      Is there a way to decrypt the data source passwords in JBoss EAP JBoss EAP 6.x/7.x ..?  Need to know the decryption mechanism in case If I forget and want to retrieve the actual password for data source.

       

      I have used  below script provided by redhat for encrypting the password, it works perfectly.

      ###############################################################

      #!/bin/sh

      OVERLAY_DIRECTORY="$JBOSS_HOME/modules/system/layers/base/.overlays"
      DATASOURCE_PASSWORD="YourDatabasePassword"


      if [ -d "$OVERLAY_DIRECTORY" ]; then
        PATCH_SUBDIRECTORY=$(ls -dt $OVERLAY_DIRECTORY/* | grep "CP" | head -n 1) 
        echo patch subdirectory is: "$PATCH_SUBDIRECTORY"
        SEARCH_DIRECTORY="$PATCH_SUBDIRECTORY/org/picketbox/main"
      else
        SEARCH_DIRECTORY="$JBOSS_HOME/modules/system/layers/base/org/picketbox/main"
      fi

      export CLASSPATH=$(find $(cd "$SEARCH_DIRECTORY"; pwd) -name "*.jar" -print | tr '\n' ':')$CLASSPATH

      #echo classpath is "$CLASSPATH"
      java org.picketbox.datasource.security.SecureIdentityLoginModule "$DATASOURCE_PASSWORD"

      ###############################################################

      Thanks,

      PSR.