Configuration supports externalisation of secrets (i.e. passwords) eliminating the need for clear-text secrets in configuration files.
Secrets are available using the standard mechanism of property expansion using the scope secrets:
"${secrets.<impl-specific-name>}"
By default secrets management is not enabled.
Configuration
Since secrets management is a part the configuration subsystem it must be configured separately. To allow maximum flexibility, configuration is done using environment variables which can be set in the application start script, injected by container management systems or configured on the application user account, depending on how the system is set up.
Different implementations requires different configuration. Which implementation to use is specified using the following environment variable:
# Default (noop)
FORTIFIED_SECRETS_IMPL=default
# Use build in 'local' impl
FORTIFIED_SECRETS_IMPL=local
# Use custom impl
FORTIFIED_SECRETS_IMPL=fully.qualified.class.Name
Implementations
Local
The built in local secrets management implementation provides decryption of secrets stored in configuration.
Secrets must be encrypted, base64 encoded and added to configuration manually, no automatic encryption is done since configuration is read-only.
Only AES encryption (key size 128/256) is supported.
An encrypted property has the following format (where "yR3v4....wgkR0=" is the base64 encoded encrypted value):
To enable this implementation, set the following environment variable(s):