You can't prevent hard drive failure, but you can be prepared for it ...
A new open-source tool called Betterleaks can scan directories, files, and git repositories and identify valid secrets using default or customized rules.