Gitleaks and other tools for finding secrets, credentials, and sensitive data in source code and git history.
gitleaks detect --source=. -v
gitleaks detect --source=/path/to/repo -v
gitleaks detect --source=. --report-path=report.json
gitleaks detect --source=. --no-git
gitleaks git --repo-path=. -v
gitleaks detect -c .gitleaks.toml --source=.
git log --all --oneline
git log --all -p | grep -i password
git log --all -p | grep -iE "(api_key|secret|token|password|pwd|passwd)"
git show COMMIT_HASH:path/to/file
git stash list && git stash show -p stash@{0}
git log --all --full-history -- "*.env" "*.key" "*.pem"
git log --diff-filter=D --summary | grep delete
trufflehog git file://path/to/repo
trufflehog github --repo=https://github.com/org/repo
trufflehog filesystem /path/to/dir
grep -rn "BEGIN RSA PRIVATE KEY" .
grep -rn "AWS_ACCESS_KEY_ID\|AKIA" .
find . -name "*.env" -o -name ".env*" -o -name "*.pem" -o -name "id_rsa"
find . -name "config.php" -o -name "config.yml" -o -name "settings.py" | xargs grep -l "password\|secret\|key"
org:target_org "password" OR "api_key" OR "secret" language:python
org:target_org filename:.env
org:target_org extension:pem
org:target_org "BEGIN RSA PRIVATE KEY"
"AKIA" site:github.com target_org