diff options
| author | jdj <jdj@kunix.org> | 2026-10-29 11:25:11 -0700 |
|---|---|---|
| committer | jdj <jdj@kunix.org> | 2026-10-29 11:25:11 -0700 |
| commit | 72fab81a09083eb858840a21366eace175d01721 (patch) | |
| tree | dea97140c924fb0906fbcb4c1f1a9dac7efb615c /scripts/scan.sh | |
| download | volta-train-kernels-72fab81a09083eb858840a21366eace175d01721.tar.gz volta-train-kernels-72fab81a09083eb858840a21366eace175d01721.zip | |
Volta training kernels with secret/path scanner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/scan.sh')
| -rwxr-xr-x | scripts/scan.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/scan.sh b/scripts/scan.sh new file mode 100755 index 0000000..fe9113f --- /dev/null +++ b/scripts/scan.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Fails (exit 1, file:line on stdout) on anything that must not ship publicly: +# API tokens, private keys, local absolute paths, IPv4 literals, private hostnames. +set -u +dir=${1:-.} +pat='hf_[A-Za-z0-9]{30,}|ghp_[A-Za-z0-9]{20,}|github_pat_|sk-[A-Za-z0-9_-]{20,}|AKIA[0-9A-Z]{16}|PRIVATE KEY|/home/[a-z]|/media/[a-z]|/tmp/claude|kunix|\b[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\b' +hits=$(grep -rInE "$pat" "$dir" --exclude-dir=.git --exclude-dir=__pycache__ --exclude=scan.sh) +if [ -n "$hits" ]; then + echo "$hits" + exit 1 +fi +exit 0 |
