Background
I am implementing set of Micro services using Java spring MVC and hosted in Undertow containers using Gradle. I am using a Java keystore to secure my keys which are using by the service to perform encryption and signing.
When a user spawning a Micro service, user injects the password into Gradle as follows.
gradlew bootRun -Dpassword=thePassword
This is ok for a normal usage because user is the one who enters the password.
Problem
There is a requirement that we need to spin up Micro services based on the demand automatically (for peak hours) and shut down when the load decreases. I can automate this but I need to hard code my password(s) in to my shell script(s) which is/are responsible for spin up services automatically.
Question
How can I secure my password(s) and do this automation ?