Re:Toyota Accidently Exposed a Secret Key Publicly on GitHub...
by coenhyde on Thursday October 13, 2022 @05:26PM
(#33196701)
That's certainly a good idea. But the secrets shouldn't be in the codebase to begin with, certainly not production secrets. Production secrets should stay in production and no one has access. Whatever intends to use the production secrets should have first been developed in a dev environment and released to prod.
Re:Toyota Accidently Exposed a Secret Key Publicly on GitHub...
by justinpombrio on Thursday October 13, 2022 @05:44PM
(#33196863)
A nice approach, if you have sufficient control over the form of your secrets, is to prefix each secret with "MY_COMPANY_SECRET_DO_NOT_COMMIT:". Then you can add a commit hook that refuses to commit if any committed file contains that substring, etc. etc.
Re:Toyota Accidently Exposed a Secret Key Publicly on GitHub...
by lumberjack24 on Thursday October 13, 2022 @06:20PM
(#33197208)
Great idea, but hard to enforce. Just use a scanning CLI like TruffleHog, Gitleaks, or ggshield from GitGuardian to catch all sorts of hardcoded secrets.
Re:Toyota Accidently Exposed a Secret Key Publicly on GitHub...
by zricethezav on Thursday October 13, 2022 @05:51PM
(#33196923)
Gitleaks also offers a nice pre-commit hook: https://github.com/zricethezav/gitleaks#pre-commit
Re:Toyota Accidently Exposed a Secret Key Publicly on GitHub...
by Too on Saturday October 15, 2022 @08:53AM
(#33214349)
Code-reviews? Should be a ritual you do on your own code before commiting+pushing and should be a ritual that others will do in the PR before merge (arguable here a secret is already compromised).
I have git hooks to lint code syntax, but nothing for scanning for leaked credentials. Looking @ TruffleHog now, mentioned by another poster.