Basic database password encryption 1
To add extra security to your Bamboo instance, you can encrypt the database password that is stored in the configuration file used by Bamboo to access your database. This method uses a Base64 cipher, which is a simple obfuscation. It’s recommended for users who don’t want to store passwords in plain text, or have to meet specific requirements to encode them.
This solution is an obfuscation, which doesn’t assure real security. Bamboo still needs to use the plain text password to connect to your database, so the configuration will contain all the information needed to decrypt the password. An attacker could act like Bamboo to obtain the password. We recommend that you secure the server where Bamboo and the database reside.
To encrypt your database password:
Step 1: Encrypt your password:
Run the following command to encrypt your password. Additionally, you can use optional arguments described below.
java -cp "./*" com.atlassian.db.config.password.tools.CipherToolOptional arguments...
-- silent -s: limits logging to minimum
-- help -h: prints a help message with all parameters
-- mode -m: defines what to do with the password, either encrypt or decrypt. If omitted, 'encrypt' will be used.
-- password -p: plain text password. If omitted, you'll be asked to enter it. We recommend that you omit this parameter so your password is not stored in the history.
main DEBUG [db.config.password.DefaultCipherProvider] Initiate cipher provider class: com.atlassian.db.config.password.ciphers.base64.Base64Cipher main DEBUG [password.ciphers.base64.Base64Cipher] Initiate Base64Cipher main DEBUG [password.ciphers.base64.Base64Cipher] Encrypting data... main DEBUG [password.ciphers.base64.Base64Cipher] Encryption done. Success! For Jira (...) For Bamboo, set the following properties in bamboo.cfg.xml: <property name="jdbc.password.decrypter.classname">com.atlassian.db.config.password.ciphers.base64.Base64Cipher</property> <property name="hibernate.connection.password">YmFtYm9v</property> and restart then instance.
Step 2: Add the encrypted password to
Go to Bamboo home directory and back up the
bamboo.cfg.xmlfile. Move the backup to a safe place outside of your Bamboo server.
bamboo.cfg.xmlby adding the following tag:
Replace content of the
<property name="hibernate.connection.password">tag with the password encrypted by CLI. For example:
- Restart Bamboo.
To decrypt your database password:
To decrypt the password, extend the command with the -m decrypt parameter:
java -cp "./*" com.atlassian.db.config.password.tools.CipherTool -m decrypt
When asked for a password, provide the encrypted one from your