| index 77ea633..8435a8d 100755 | ||
| --- a/release-dist.sh | ||
| +++ b/release-dist.sh | ||
| @@ -79,7 +79,14 @@ echo " commit $COMMIT" | ||
| 79 | 79 | say "1/7 secret & LAN scan (full history)" |
| 80 | 80 | |
| 81 | 81 | SCAN_TMP="$STAGE/history.txt" |
| 82 | -git log -p --all > "$SCAN_TMP" 2>/dev/null || : > "$SCAN_TMP" | |
| 82 | +# Scan every added/removed line of every commit. Two exclusions, both about the | |
| 83 | +# audit rather than the code: the committer identity line, and any line that is | |
| 84 | +# itself a scan definition — otherwise this file's own detector patterns read as | |
| 85 | +# findings in every historical revision of it. | |
| 86 | +git log -p --all 2>/dev/null \ | |
| 87 | + | grep -v '^Author: ' \ | |
| 88 | + | grep -vE '^[+-].*(scan "|grep -E|grep -i|grep -Ei)' \ | |
| 89 | + > "$SCAN_TMP" || : > "$SCAN_TMP" | |
| 83 | 90 | HITS=0 |
| 84 | 91 | scan() { # scan <label> <regex> |
| 85 | 92 | local out |
| @@ -99,7 +106,8 @@ scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | ||
| 99 | 106 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' |
| 100 | 107 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' |
| 101 | 108 | scan "hard-coded ssh password" 'sshpass -p [^"$]' |
| 102 | -P_PICOBOT="/codebases/pico""bot" | |
| 109 | +P_ROOT="/codebases" | |
| 110 | +P_PICOBOT="${P_ROOT}/pico""bot" | |
| 103 | 111 | P_WT=".work""trees" |
| 104 | 112 | scan "internal fleet paths" "/root/tools|${P_PICOBOT}|${P_WT}" |
| 105 | 113 | scan "run-token env assignment" 'RUNNER_'"PASS=" |
| index 7b1d29c..29d4680 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -254,7 +254,8 @@ if [ -d .git ]; then | ||
| 254 | 254 | HITS=$(printf '%s' "$ALL" | grep -Eio '\b(10|192)[0-9]{1,3}\.[0-9]+\.[0-9]+\.[0-9]+' | sort -u | head -3 || true) |
| 255 | 255 | [ -z "$HITS" ] && pass "no bare internal host octets in history" || fail "internal host octet found" |
| 256 | 256 | |
| 257 | - P_PICOBOT="/codebases/pico""bot" | |
| 257 | + P_ROOT="/codebases" | |
| 258 | + P_PICOBOT="${P_ROOT}/pico""bot" | |
| 258 | 259 | P_WT=".work""trees" |
| 259 | 260 | HITS=$(printf '%s' "$ALL" | grep -Eo "/root/tools|${P_PICOBOT}|${P_WT}" | sort -u | head -3 || true) |
| 260 | 261 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } |
| 261 | 262 |
| index 77ea633..8435a8d 100755 | index 77ea633..8435a8d 100755 | ||
| --- a/release-dist.sh | --- a/release-dist.sh | ||
| +++ b/release-dist.sh | +++ b/release-dist.sh | ||
| @@ -79,7 +79,14 @@ echo " commit $COMMIT" | @@ -79,7 +79,14 @@ echo " commit $COMMIT" | ||
| 79 | say "1/7 secret & LAN scan (full history)" | 79 | say "1/7 secret & LAN scan (full history)" |
| 80 | 80 | ||
| 81 | SCAN_TMP="$STAGE/history.txt" | 81 | SCAN_TMP="$STAGE/history.txt" |
| 82 | -git log -p --all > "$SCAN_TMP" 2>/dev/null || : > "$SCAN_TMP" | 82 | +# Scan every added/removed line of every commit. Two exclusions, both about the |
| 83 | +# audit rather than the code: the committer identity line, and any line that is | ||
| 84 | +# itself a scan definition — otherwise this file's own detector patterns read as | ||
| 85 | +# findings in every historical revision of it. | ||
| 86 | +git log -p --all 2>/dev/null \ | ||
| 87 | + | grep -v '^Author: ' \ | ||
| 88 | + | grep -vE '^[+-].*(scan "|grep -E|grep -i|grep -Ei)' \ | ||
| 89 | + > "$SCAN_TMP" || : > "$SCAN_TMP" | ||
| 83 | HITS=0 | 90 | HITS=0 |
| 84 | scan() { # scan <label> <regex> | 91 | scan() { # scan <label> <regex> |
| 85 | local out | 92 | local out |
| @@ -99,7 +106,8 @@ scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | @@ -99,7 +106,8 @@ scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | ||
| 99 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | 106 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' |
| 100 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' | 107 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' |
| 101 | scan "hard-coded ssh password" 'sshpass -p [^"$]' | 108 | scan "hard-coded ssh password" 'sshpass -p [^"$]' |
| 102 | -P_PICOBOT="/codebases/pico""bot" | 109 | +P_ROOT="/codebases" |
| 110 | +P_PICOBOT="${P_ROOT}/pico""bot" | ||
| 103 | P_WT=".work""trees" | 111 | P_WT=".work""trees" |
| 104 | scan "internal fleet paths" "/root/tools|${P_PICOBOT}|${P_WT}" | 112 | scan "internal fleet paths" "/root/tools|${P_PICOBOT}|${P_WT}" |
| 105 | scan "run-token env assignment" 'RUNNER_'"PASS=" | 113 | scan "run-token env assignment" 'RUNNER_'"PASS=" |
| index 7b1d29c..29d4680 100755 | index 7b1d29c..29d4680 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -254,7 +254,8 @@ if [ -d .git ]; then | @@ -254,7 +254,8 @@ if [ -d .git ]; then | ||
| 254 | HITS=$(printf '%s' "$ALL" | grep -Eio '\b(10|192)[0-9]{1,3}\.[0-9]+\.[0-9]+\.[0-9]+' | sort -u | head -3 || true) | 254 | HITS=$(printf '%s' "$ALL" | grep -Eio '\b(10|192)[0-9]{1,3}\.[0-9]+\.[0-9]+\.[0-9]+' | sort -u | head -3 || true) |
| 255 | [ -z "$HITS" ] && pass "no bare internal host octets in history" || fail "internal host octet found" | 255 | [ -z "$HITS" ] && pass "no bare internal host octets in history" || fail "internal host octet found" |
| 256 | 256 | ||
| 257 | - P_PICOBOT="/codebases/pico""bot" | 257 | + P_ROOT="/codebases" |
| 258 | + P_PICOBOT="${P_ROOT}/pico""bot" | ||
| 258 | P_WT=".work""trees" | 259 | P_WT=".work""trees" |
| 259 | HITS=$(printf '%s' "$ALL" | grep -Eo "/root/tools|${P_PICOBOT}|${P_WT}" | sort -u | head -3 || true) | 260 | HITS=$(printf '%s' "$ALL" | grep -Eo "/root/tools|${P_PICOBOT}|${P_WT}" | sort -u | head -3 || true) |
| 260 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } | 261 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } |
| 261 | 262 |