If I need to:
- run cron jobs with user secrets (no manual user authentication)
- have secrets written on demand (running process that has read access to all user secrets)
how to do you mitigate risks for that? I thought of the following:
- finest granularity, so Vault tokens for individual <user-secret>, not just user
- expire user tokens after each cron job
- audit secret access and lock down if it doesn't match number of cron jobs
Here's what I'm struggling with, the last requirement for writing secrets on demand. I tried creating a token that only had rights for auth/token. Tokens created with that, I tried giving a policy allowing to read secret/<user-secret> . That didn't work, because the child had a policy not available to the parent.
I thought of expiring that user, but that leads me to same situation. I will need another parent token that has access to all user secrets. If I'm wrong, let me know.
No way I'm I storing that on the server anywhere. Not with restricted permissions, not with encryption. My only thought is a prompt when I startup my "on demand" script to enter a root-like Vault password, like you do with the command line and sudo.
If anyone has a better way, please let me know.