Say you have a script or something that gets run in cron/task scheduler and it needs a password… say to ssh to a raspberry pi elsewhere in your house.
How do you save that password in a way that automation can access it?
Some ideas:
- Plaintext file. Not a fan because its sitting unencrypted on the box somewhere.
- Environment variable. Not a fan because its still unencrypted somewhere to someone on the box (albeit likely the same user or an admin).
- A secrets manager. If I use something locally like hashicorp vault or infisical, I can get to a point where a cli/api call gets the password. Though in this case I still need a vault password/secret to get my password. So I fall back to needing one of the above to get this to work.
If the secrets manager is easily available, the secret to get into the secrets manager is available as well leading to a feeling of security by obscurity.
If someone breaks into my system via SSH/etc. then they can get the passwords either way.
… How do people normally do this? I’m not sure I actually get anything out of a secrets manager if its local and I have the disk itself encrypted before login.
What actually makes sense at a personal/home scale?
(Edit: I know using SSH key probably is better for getting to the raspberry pi, but still the question is the same idea).
This is something I’ve always pondered on myself when it comes to automation as it really does seem that once someone gains access, it really is just a matter of time for the to figure out where credentials are stored.
However, this is possibly already a thing or it’s not because maybe it doesn’t sound like a good idea?? But I was just reminded of how we use MFA, and it dawned on me how these ideas behind automation and how to pull credentials we are always thinking about how we get the credential for the script so it can use it, but what if we had a way for the automation to prompt and ask us for the credential? Because surely your automation should be running on a regular schedule, where you expect these prompts. In turn the idea of an MFA prompt could also be automated?
Not sure if that’s a good idea or I’m just over complicating things.
The problem is that would be so annoying/impractical. In an optimal world, yeah a person checking a prompt and approving could make sense, but in practice that would also mean that the MFA prompt would have to ask for the password anyways. (Or the password would be on the phone with the same problem as on the computer).
Can you imagine having to type a password on an hourly schedule or something? If the password was cached, we have the same problem again.