Secure a database password

To add extra security to your Confluence Data Center and Server instance, you can encrypt the database password that is stored in the confluence.cfg.xml file. You can choose to use a Base64 cipher, Algorithm cipher, or create your own cipher.   

Your Confluence instance needs a plain-text password to connect to the database. The configuration file will contain all the information needed to decrypt the password, so it's necessary to protect access to Confluence and database servers.

You can only encrypt your password if you're using a JDBC connection (not a JNDI datasource).

The solutions outlined below provide a level of protection for encrypting database values, but do not offer complete security. The configuration files will still contain the necessary data to decrypt the values, which means that an attacker with access to these files could potentially decrypt the property values.

These approaches are intended to provide an additional layer of protection against accidental exposure of sensitive data but should not be relied upon as a comprehensive security solution.

We recommend that you secure the server where Confluence and the database reside.

On this page:

Base64 encoding

We don't recommend Base64 encoding in production for securing secrets because it doesn't provide encryption, and therefore cannot guarantee sufficient data protection.

Base64 encoding

AES encryption

This method allows you to choose an algorithm to encrypt a database password. It provides more security as you don't have to store the encrypted password anywhere in the configuration file, which makes it difficult for unauthorized parties to find and decrypt it.

AES encryption

Custom encryption

If you have special requirements for database password encryption, you can create your own encryption mechanism based on our examples.

Custom encryption

{
Last modified on May 10, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.