Encrypting database password string under ;JBOSS_HOME;/server/;server_name;/deploy/sqlserver-ds.xml (oracle-ds.xml).

Encrypting database password string under ;JBOSS_HOME;/server/;server_name;/deploy/sqlserver-ds.xml (oracle-ds.xml).

book

Article ID: KB0091444

calendar_today

Updated On:

Products Versions
TIBCO Collaborative Information Manager -
Not Applicable -

Description

Resolution:
Description:
=======
Database password provided in this file is in plain text. To encrypt this password, use the following steps.

1). Change directory to <JBOSS_HOME>
2). Execute the following command , where CIM821 is the database password.

++

c:\jboss-5.1.0.GA>java -cp client/jboss-logging-spi.jar;common/lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule <<CIM821>>


output ::Encoded password: -346afac28d4f4cfe
++

3). Make the following changes to sqlserver-ds.xml(oracle-ds.xml) under <JBOSS_HOME>/server/<server_name>/deploy
++
Replace username and password tag with following: 
<!-- commented this
<user-name>cimuser</user-name>
<password>3qHPn692</password>
And add the following:
-->
<security-domain>EncryptDBPassword</security-domain>
++

4). Provide the encoded password retrieved in step 2 above in <JBOSS_HOME>/server/<SERVER_NAME>/conf/login-config.xml, Define new policy as under

++
<!-- added this -->
    <application-policy name="EncryptDBPassword">
       <authentication>
          <login-module code="org.jboss.resource.security.SecureIdentityLoginModule"
             flag = "required">
               <module-option name="username">cimuser</module-option>
               <module-option name="password">-346afac28d4f4cfe</module-option>
               <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=eCMDataSource</module-option>
         </login-module>
      </authentication>
    </application-policy>

    NOTE: Provide the correct datasource name. 
++

References:
===========
https://community.jboss.org/wiki/EncryptingDataSourcePasswords

Issue/Introduction

Encrypting database password string under ;JBOSS_HOME;/server/;server_name;/deploy/sqlserver-ds.xml (oracle-ds.xml).