What are the best practices for a scheduled program to store credentials to access a secure resource?

If I have a program that runs on a regular basis, such as a cron job or systemd timer and it needs to access a secure resource like a hsm or encrypted database, what are the best practices to store/access the credentials to it?

Continue reading What are the best practices for a scheduled program to store credentials to access a secure resource?