How to secure or encrypt passwords in Tomcat configuration file ?

Solution Verified - Updated -

Issue

  • Is there a supported way to encrypt the database password that is specified on a DataSource definition within context.xml?
  • I know that you can extend the DataSource Factory that Tomcat uses to provide decryption of the password before calling the under lying factory, but is there a more robust way similar to what is provided within EAP?
  • Mask / encrypt passwords Tomcat -7/9?
  • Is it possible to encrypt or mask passwords for Database mentioned in context.xml and keystore password mentioned in server.xml.

Environment

  • JBoss Enterprise Web Server
    • 3.x
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content