Security – Efficient way to secure tomcat database connections

databasejavaSecuritytomcat

Our customer has a problem with database information in plaintext within a server.xml or context.xml file on the Tomcat server. I've looked at several sites like OWASP and it seems like there's no obvious solution. I've also seen things like this wordpress blog which describe implementing a custom Tomcat extension to do this. There must exist some standard implementation(s) already without having to roll your own. Does anyone have experience with such a solution?

Best Answer

The password is currently stored in plaintext in the config file. The alternative, which is often used in, say, DES-encrypted SSL private keys, is to use a symmetric algorithm to encrypt the sensitive data.

This would be no more secure than just storing the password in plaintext in the .xml file. The service would be configured with the encryption key of the encrypted secret (unless you require someone to be at the keyboard to enter the password every time the service starts), which can be used by an attacker to get at the encrypted data. This provides a layer of obscurity, but not a layer of security.

Related Topic