Posts

Showing posts from April, 2017

How to encrypt plaintext passwords in JBoss

By default, database connections for the JBoss A8 are defined in *-ds.xml, and include clear text passwords. You can, however, replace it with encrypted passwords. There is no need to change your source code. The class org.jboss.resource.security.SecureIdentityLoginModule can be used to both encrypt database passwords and to provide a decrypted version of the password when the data source configuration is required by the server. Step 1: Encrypt a datasource password Open cmd.exe, change directory to the JBoss directory and execute the following command: java -cp client\jboss-logging.jar;lib\jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule MyPLaintextPASSWDRD This command will return an encrypted password like this: Encoded password: ia744dc3700000125ff73cfb98e94f3e3 Step 2: Create an application authentication policy with the encrypted password Open conf/login-config.xm1 file, add a new <app1ication-policy> element to the <policy> element, put the encode