However it should be pretty easy for them to set up a script to search github for this kind of stuff and automatically invalidate keys
However it should be pretty easy for them to set up a script to search github for this kind of stuff and automatically invalidate keys
If the token is XYZ and the script is searching https://github.com/search?utf8=%E2%9C%93&q=XYZ&type=Commits&...:
1. It's sharing the token with GitHub.
2. It's embedding the token as query-string parameter in a GET request, which is much more likely to be logged (than sending it as data in a POST request), and more likely to be available to less-privileged/less-trusted staff.
3. If the request is sent to a non-HTTPS endpoint, the query can be MITMd, revealing the token.
I'd be very wary of setting up a token-finding script, it feels like it adds more risk than it saves.
Annoyingly there is no way to turn it off even when you explicitly want to share an API key knowingly. But i'm more than fine with needing to "obfuscate" an API key or manage secrets correctly knowing it saves TONS of people.
It probably wasn't the best idea, but it was the only "secret" needed in the whole project and I didn't want to maintain a way of managing secrets in a public project for a pointless key.
In the end I did just that, and looking back it was the better choice, but at the time it was annoying.
I wonder why they'd want to invalidate that. :)
$key = "BAAD" + "F00D" + "CAFE" + "BABE";
2) Search if found keys are actual valid keys
3) Expire key, send explanatory email, issue new key
(I think that's what AWS does)