Passwords

Why are plain text passwords in the config files?

Because there is no good way to "secure" them. When Tomcat needs to connect to a database, it needs the original password. While the password could be encoded, there still needs to be a mechanism to decode it. And since the source to Tomcat is freely available, the attacker would know the decoding method. So at best, the password is obscured - but not really protected. Please see the user and dev list archives for flame wars about this topic.

That said, any configuration file that does contain a password needs to be appropriately secured. That means limiting access to the file so that it could be read only by the user that Tomcat process runs as and root (or the administrator on Windows).

In The Cathedral and the Bazaar, Eric S. Raymond recounts a story where his fetchmail users asked for encrypted passwords in the .fetchmailrc file (which is almost identical to the situation posed here with server.xml). He refused using the same arguments posed here: encrypting or otherwise obfuscating the password in server.xml does not provide any real security: only "security by obscurity" which isn't actually secure.

Auditors do not like this answer. In order to please auditors, feel free to do any of the following. Please be aware, that all of the following are "security by obscurity" and are not making the Tomcat more secure. But it may allow you to pass an auditors checklist ....

<!DOCTYPE server-xml [
  <!ENTITY resources SYSTEM "resources.txt">
]>

A cultural reference:


CategoryFAQ

FAQ/Password (last edited 2014-07-10 18:40:10 by KonstantinKolinko)