From 72fab81a09083eb858840a21366eace175d01721 Mon Sep 17 00:00:00 2001 From: jdj Date: Thu, 29 Oct 2026 11:25:11 -0700 Subject: Volta training kernels with secret/path scanner Co-Authored-By: Claude Opus 5.5 --- scripts/scan.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/scan.sh (limited to 'scripts/scan.sh') 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 -- cgit v1.2.3