Password from environment - liquibase command line

Hello,

For most of our scripts, we use environment variables to pass secrets to programs. We would rather this than having them in command line parameters or in files on disk.

However, with liquibase command line, it doesn’t seem to be possible to pass the “password” parameter as an environment variable (either directly, or using the JAVA_OPTS=-D approach).

Am I completely missing something here, or should I raise a bug?

Chris

For my Liquibase implementation, I dynamically write the liquibase properties file, containing the username and password via environment variables, that way they do not show if someone runs a ps command. Then I use the “–defaultsFile” when I run the Liquibase CLI.

1 Like

Thanks - I guess this could be an enhancement request, then…?

If you do submit an enhancement request, please describe what you want in more detail. It isn’t clear from the question how you are passing environment variables in or what problem you are getting. Is this on Windows or a Unix-like platform? Are you expecting Liquibase to expand the environment variable or the shell?

Hi @nodule ,

I agree and support @daryldoak 's answer here. Even in my Liquibase implementation, I’m writing the username and password dynamically to the properties file. So it completely depends on the approach you follow. I don’t think it as any bug or enhancement to be done.

Please let us know if any doubts or queries.

Thanks!
Rakhi Agrawal