What's better than cleaning up leaked secrets? Blocking them from leaking in the first place, of course!
TruffleHog offers two ways of preventing secrets from leaking in Git:
1graph TD
2A{Is the git server self-hosted?}
3A -->|Yes| B[Prereceive hooks block secrets from being accepted at the git server]
4A -->|No| C{Apply precommit hooks with TruffleHog}
5C --> D[Prevent secrets from being pushed to the git server]
6B --> E[End]
7D --> E[End]