Quickly find sensitive files in your GitHub repo
about.sourcegraph.com
about.sourcegraph.com
I learned this the hard way due to a script bouncing around an internal gitlab repo for ages with hardcoded AWS keys, and the second someone accidently published it to a public gist, we learned very quickly people that will abuse public AWS keys actually use AWS's recommended regexp ( https://aws.amazon.com/blogs/security/a-safer-way-to-distrib... ) to find AWS keys, even old ones, though it does result in more noise, which is no doubt why tools like this try to be more specific.
I know (personal) Github API tokens use a prefix of ghp_ and the Github-app JWT-issued tokens have another prefix (maybe gha_? Can't remember)
As mentioned recently here on HN, a generalized version of this technique is what RFC8959[1] proposes via "secret-token" prefix.
Do add these to all your pre-commit hooks and other password detectors/log analysers!
https://github.blog/2021-04-05-behind-githubs-new-authentica...
https://github.com/search?q=org%3Asourcegraph+master.key&typ...
https://medium.com/@thorntonbrenden/rails-and-the-legendary-...
https://github.com/pre-commit/pre-commit-hooks#detect-aws-cr...
Although a pre-commit hook exists for detecting AWS credentials, I can imagine other checks (e.g ssh credentials, passwords, etc)
But, even if you're on their enterprise plan it's still an additional addon (and expensive):
https://docs.github.com/en/enterprise-cloud@latest/code-secu...
What exactly is the path that leads to committing secrets, apart from utter incompetence or disregard? Do people not review what they're committing at all?
That last part is what makes it okay. I can only assume the kind of person who puts their dotfiles in a public github repository - or, more generally, puts things on github by default - does not have as strong a public/private distinction as I do.
You've never accidentally committed secrets into a public repository, right?