I am trying to find the smartest way to handle the root password in my product.
For legacy reasons, I need to have a technical account. My services create a token associated with this account directly in the DB to authenticate and access the rest of the platform. I tried to find some documentation online to make sure I was dealing with its password in the most secure way but could not come up with a straight answer.
Here are the two solutions I came up with:
Set the password to a random string at every boot of the server, log it to the console in case we actually need it one day
Pass it as an environment variable
TECHNICAL_PASSWORDand set it at every boot to make sure it is always up to date
Note that the password is never used so I don't technically need to know it.
In terms of good practice, what would you advise?