4 ms·
I think the best way to deal with secrets is to not live stream them, at all, ever, in any way. If you have secrets anywhere near your live stream, it's not a
by VikingCoder 6y ago
I think the best way to deal with secrets is to not live stream them, at all, ever, in any way.
If you have secrets anywhere near your live stream, it's not a question if "if" you will leak them but "when." Don't put yourself in that situation.
Work _hard_ to keep yourself out of that situation.
- nickjj 6y agoIt's not always possible to do this. Let's say I live streamed implementing Stripe. There's no way to avoid not showing my test API keys if I'm going to show the end to end process of setting everything up. The best I could do is to roll the keys before I start the stream but this degrades the quality of the stream since it's not from scratch. Of course those keys and anything else that's sensitive would be sitting in an .env file, and I'd also have an .env.example file showing how it's set up without anything sensitive being in there (I do this already in my pre-recorded videos). Even going as far as preventing the real .env file coming up when I fuzzy open files so I don't open it by accident and the contents of that file being ignored from multi-file searches.
- mcny 6y agoMaybe the answer is simpler than that. Rotating a key should never be painful. If you accidentally reveal a key, it should be straightforward to change it (I'm sure your audience will understand if you take a one minute break).
- nickjj 6y agoThe reveal wouldn't be by accident typically. It could be a necessary requirement based on the content you're streaming. If you revealed a Stripe key only to change it 1 minute afterwards, you still need a process to change it in secret, which goes back to my original reply of setting up a dedicated "secret" scene so you can modify things in private.
- evv 6y agoYou can switch to a different scene when handling sensitive details, like the camera feed or the "technical difficulties" scene. This is how I've seen folks deal with secrets in the past
- VikingCoder 6y agoI'm sorry, but you claimed "it's not always possible to do this," and then your example started "Let's say I live streamed." You are making the choice to live stream. It is always possible to avoid live streaming. Always.
- corobo 6y agoThat would require no secrets. All it takes is a misclick into a .env file. I’d assume you’re not coding on a production system so your secrets shouldn’t be too hard to revoke, cycle them after your stream and any time you leak them.
- evan_ 6y agoPut a couple hundred line breaks at the top of your .env file so if you open it it’s just white space
- xxpor 6y agoSecrets should really be stored in services, not files outside of maybe a single bootstrap file (unless you're working on the secret storage service itself). I generate my secrets once, send them off to the secrets service, and then my service queries that service. I never see the secrets with my own eyes.
- tnorthcutt 6y agoCan you expand on this? What service do you use to store your secrets?
- dividedbyzero 6y agoWhat are you using for this? This sounds like a neat setup.
- corobo 6y agoIt is a single bootstrap file, it bootstraps your env variables I've not come across what you describe
- this-pony 6y agoThis sounds like a turtles all the way down kind of think... Then is it OK to keep the secret of the secrets service, or something in that sense.
- dfee 6y ago