Files
automation-based-email-list…/scripts/leak-scan.ps1
T
2026-08-15 15:05:39 -06:00

13 lines
801 B
PowerShell

$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path -Parent $PSScriptRoot
Push-Location $repoRoot
try {
rg -n --hidden -i --glob '!.git/**' --glob '!scripts/leak-scan.ps1' '(password|passwd|secret|token|api[_-]?key|apikey|bearer|authorization|credential|private key|smtp_pass)' .
if ($LASTEXITCODE -gt 1) { exit $LASTEXITCODE }
rg -n --hidden --glob '!.git/**' --glob '!scripts/leak-scan.ps1' '((?:192\.168\.|172\.(?:1[6-9]|2[0-9]|3[01])\.|10\.)[0-9.]+|/mnt/c/Users|C:\\Users|/home/|/srv/data|\.csv|\.jsonl|\.sql|\.pem|id_rsa|id_ed25519)' .
if ($LASTEXITCODE -gt 1) { exit $LASTEXITCODE }
git ls-files | rg '(__pycache__|\.pyc$|\.env$|\.csv$|\.jsonl$|\.sql$|\.tar\.gz$|\.pem$|id_rsa|id_ed25519)'
if ($LASTEXITCODE -gt 1) { exit $LASTEXITCODE }
} finally {
Pop-Location
}