The script is used for encrypting the datasource passwords on jboss servers ref.
The flow is as follows:
- Encrypt the plain texts of passwords
- Change the
*-ds.xml
files, like
<!-- REPLACED WITH security-domain BELOW
<user-name>admin</user-name>
<password>password</password>
-->
<security-domain>EncryptDBPassword</security-domain>
- Change the login-config.xml
a. if local-tx-datasource
, then add policy entry
<policy>
<!-- Example usage of the SecureIdentityLoginModule -->
<application-policy name="EncryptDBPassword">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username">admin</module-option>
<module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:name=PostgresDS,service=LocalTxCM</module-option>
</login-module>
</authentication>
</application-policy>
</policy>
b. if xa-datasource
, then the module-option name="managedConnectionFactoryName"
should be:
<module-option name="managedConnectionFactoryName">jboss.jca:name=PostgresDS,service=XATxCM</module-option>
reference