I got spring boot app. I'm passing to it variables like this:
...
datasource:
url: jdbc:postgresql://${DB_SERVER_AND_PORT}/my_db
username: ${DB_USER}
password: ${DB_USER_PASSWORD}
This env variables can be easily read because they are in plain text. I want to increase security with symmetric encryption.
I looking for something that I can use in my yaml file.
# example how I want to use it:
...
datasource:
url: jdbc:postgresql://#{decrypt(${DB_SERVER_AND_PORT}}/my_db
The only requirement for encryption is ease of doing it from shell (gitlab pipeline)
If this is possible, how to do this spring boot or spring?
Check out jasypt which provides encryption support for property sources in Spring Boot Applications: