For Config.groovy, you can always simply encrypt the password somehow, and then put this hash in Config.groovy manually. When you need to use it in your code, you have code to decrypt it. It doesn't seem that hard.
DataSource.groovy is another animal, however, since it is loaded into the Hibernate API for you. I saw some code like this in interwebs and it seems to be moving in the right direction ...
dataSource { pooled = false driverClassName = "org.hsqldb.jdbcDriver" username = "sa" password = someEncryptionApiObject.decrypt(propertyFile.readProperty("MyPassword")) }
... where you will encrypt the properties file containing the data you need, and decrypt when necessary.
Gregg
source share