Basic database password encryption



アトラシアン コミュニティをご利用ください。


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:

  1. <Bamboo-installation-directory>/tools/atlassian-password に移動します。

  2. 次のコマンドを実行してパスワードを暗号化します。以下に示すオプションの引数を使用することもできます。 

    java -cp "./*"
    • -- silent -s: ロギングを最小限に制限します

    • -- help -h: すべてのパラメータを含むヘルプ メッセージを出力します

    • -- mode -m: パスワード処理方法を暗号化または 復号化として定義します。省略した場合は "encrypt" が使用されます

    • -- password -p: プレーン テキスト パスワード。省略した場合、入力を求められます。パスワードが履歴に保存されないように、このパラメータを省略することをおすすめします。

    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. 
    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 bamboo.cfg.xml:

  1. Go to Bamboo home directory and back up the bamboo.cfg.xml file. Move the backup to a safe place outside of your Bamboo server.

  2. Edit the bamboo.cfg.xml by adding the following tag:

    <property name="jdbc.password.decrypter.classname">com.atlassian.db.config.password.ciphers.base64.Base64Cipher</property>
  3. Replace content of the <property name="hibernate.connection.password">  tag with the password encrypted by CLI. For example:

    <property name="hibernate.connection.password">YmFtYm9v</property>
  4. Bamboo を再起動します。

To decrypt your database password:

To decrypt the password, extend the command with the -m decrypt parameter:

java -cp "./*" -m decrypt


最終更新日 2021 年 7 月 13 日


Powered by Confluence and Scroll Viewport.