Spring / Spring Boot
How do you hide passwords in Spring boot application properties file?
Spring Boot Application properties may contain sensitive information such as database passwords, MQ config details, CERT passwords. The password stored in the application properties is not recommended to be PLAIN-TEXT and needs to be encrypted.
#Plain password not recommended app.mysql.password=My-plain-password
Spring boot doesn't provide inbuilt support for encryption. You may use Jasypt library to encrypt properties, so you could have your property like this:
#Encrypted using Jasypt app.mysql.password=ENC(XcBjfjDDjxeyFBoaEPhG14wEzc6Ja+Xx+hNPrJyQT88=)
Using Jasypt, you will encrypt your DB password using a master password which will be supplied to the application when starting to decrypt on the fly.
More Related questions...