This Python script scans all repositories in a specified GitHub organization for secrets using Trufflehog and saves verified secrets in separate JSON files for each repository. This tool is helpful for ethical security auditing and testing your organization’s repositories for sensitive information leaks.
- Scans all repositories within a specified GitHub organization.
- Uses Trufflehog to detect secrets and filters for verified secrets.
- Saves verified secrets to a JSON file for each repository.
- Trufflehog: This tool must be installed on your system. Install it with:
pip3 install trufflehog
- GitHub Personal Access Token: You’ll need a GitHub token with
reporead permissions for the organization. Generate it from your GitHub settings under Developer Settings > Personal Access Tokens.
- Clone the repository:
git clone https://github.com/kripto-geek/TH-git-j-script.git
python3 trufflehog-scan.py -org <orgname>