| index c7883bf..5db98bb 100755 | ||
| --- a/release-dist.sh | ||
| +++ b/release-dist.sh | ||
| @@ -86,11 +86,12 @@ say "1/7 secret & LAN scan (full history)" | ||
| 86 | 86 | SCAN_TMP="$STAGE/history.txt" |
| 87 | 87 | # Scan every added/removed line of every commit. Two exclusions, both about the |
| 88 | 88 | # audit rather than the code: the committer identity line, and any line that is |
| 89 | -# itself a scan definition - otherwise this file's own detector patterns read as | |
| 90 | -# findings in every historical revision of it. | |
| 89 | +# itself a scan definition - otherwise this file's own detector patterns (and the | |
| 90 | +# test suite's identical checks) read as findings in every historical revision of | |
| 91 | +# them. A real secret on any other line still hits. | |
| 91 | 92 | git log -p --all 2>/dev/null \ |
| 92 | 93 | | grep -v '^Author: ' \ |
| 93 | - | grep -vE 'scan "|audit "|HITS=|grep -E|P_ROOT=|P_WT=|PK="|\$ALL' \ | |
| 94 | + | grep -vE "scan \"|audit \"|HITS=|grep -E|grep -qE|hits '|P_ROOT=|P_WT=|PK=\"|\$ALL" \ | |
| 94 | 95 | > "$SCAN_TMP" || : > "$SCAN_TMP" |
| 95 | 96 | HITS=0 |
| 96 | 97 | scan() { # scan <label> <regex> |
| index 749021d..5f110f4 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -249,13 +249,13 @@ echo "== secret & private-address audit (full git history)" | ||
| 249 | 249 | SCAN="$TMP/history.txt" |
| 250 | 250 | git -C "$ROOT" log -p --all 2>/dev/null \ |
| 251 | 251 | | grep -v '^Author: ' \ |
| 252 | - | grep -vE 'scan "|audit "|HITS=|grep -E|grep -qE' > "$SCAN" || : > "$SCAN" | |
| 252 | + | grep -vE "scan \"|audit \"|HITS=|grep -E|grep -qE|hits '" > "$SCAN" || : > "$SCAN" | |
| 253 | 253 | hits() { grep -Eo "$1" "$SCAN" 2>/dev/null | sort -u | wc -l | tr -d ' '; } |
| 254 | 254 | check "no GitHub token" "$(hits 'ghp_[A-Za-z0-9]{20,}')" "0" |
| 255 | 255 | check "no HuggingFace token" "$(hits 'hf_[A-Za-z0-9]{20,}')" "0" |
| 256 | 256 | check "no scorpiox-git token" "$(hits '3ef2c00cb68e')" "0" |
| 257 | 257 | check "no password literal" "$(hits 'Xboxone'09'0'9'')" "0" |
| 258 | -check "no runner pass" "$(hits 'RUNNER_'+'PASS=')" "0" | |
| 258 | +check "no runner pass" "$(hits 'RUNNER_'"'"'PASS=')" "0" | |
| 259 | 259 | check "no private 192.168 net" "$(hits '192\.168\.[0-9]{1,3}\.')" "0" |
| 260 | 260 | check "no private 10.0 net" "$(hits '(^|[^0-9])10\.0\.[0-9]{1,3}\.')" "0" |
| 261 | 261 | check "no private 172.16 net" "$(hits '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.')" "0" |
| 262 | 262 |
| index c7883bf..5db98bb 100755 | index c7883bf..5db98bb 100755 | ||
| --- a/release-dist.sh | --- a/release-dist.sh | ||
| +++ b/release-dist.sh | +++ b/release-dist.sh | ||
| @@ -86,11 +86,12 @@ say "1/7 secret & LAN scan (full history)" | @@ -86,11 +86,12 @@ say "1/7 secret & LAN scan (full history)" | ||
| 86 | SCAN_TMP="$STAGE/history.txt" | 86 | SCAN_TMP="$STAGE/history.txt" |
| 87 | # Scan every added/removed line of every commit. Two exclusions, both about the | 87 | # Scan every added/removed line of every commit. Two exclusions, both about the |
| 88 | # audit rather than the code: the committer identity line, and any line that is | 88 | # audit rather than the code: the committer identity line, and any line that is |
| 89 | -# itself a scan definition - otherwise this file's own detector patterns read as | 89 | +# itself a scan definition - otherwise this file's own detector patterns (and the |
| 90 | -# findings in every historical revision of it. | 90 | +# test suite's identical checks) read as findings in every historical revision of |
| 91 | +# them. A real secret on any other line still hits. | ||
| 91 | git log -p --all 2>/dev/null \ | 92 | git log -p --all 2>/dev/null \ |
| 92 | | grep -v '^Author: ' \ | 93 | | grep -v '^Author: ' \ |
| 93 | - | grep -vE 'scan "|audit "|HITS=|grep -E|P_ROOT=|P_WT=|PK="|\$ALL' \ | 94 | + | grep -vE "scan \"|audit \"|HITS=|grep -E|grep -qE|hits '|P_ROOT=|P_WT=|PK=\"|\$ALL" \ |
| 94 | > "$SCAN_TMP" || : > "$SCAN_TMP" | 95 | > "$SCAN_TMP" || : > "$SCAN_TMP" |
| 95 | HITS=0 | 96 | HITS=0 |
| 96 | scan() { # scan <label> <regex> | 97 | scan() { # scan <label> <regex> |
| index 749021d..5f110f4 100755 | index 749021d..5f110f4 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -249,13 +249,13 @@ echo "== secret & private-address audit (full git history)" | @@ -249,13 +249,13 @@ echo "== secret & private-address audit (full git history)" | ||
| 249 | SCAN="$TMP/history.txt" | 249 | SCAN="$TMP/history.txt" |
| 250 | git -C "$ROOT" log -p --all 2>/dev/null \ | 250 | git -C "$ROOT" log -p --all 2>/dev/null \ |
| 251 | | grep -v '^Author: ' \ | 251 | | grep -v '^Author: ' \ |
| 252 | - | grep -vE 'scan "|audit "|HITS=|grep -E|grep -qE' > "$SCAN" || : > "$SCAN" | 252 | + | grep -vE "scan \"|audit \"|HITS=|grep -E|grep -qE|hits '" > "$SCAN" || : > "$SCAN" |
| 253 | hits() { grep -Eo "$1" "$SCAN" 2>/dev/null | sort -u | wc -l | tr -d ' '; } | 253 | hits() { grep -Eo "$1" "$SCAN" 2>/dev/null | sort -u | wc -l | tr -d ' '; } |
| 254 | check "no GitHub token" "$(hits 'ghp_[A-Za-z0-9]{20,}')" "0" | 254 | check "no GitHub token" "$(hits 'ghp_[A-Za-z0-9]{20,}')" "0" |
| 255 | check "no HuggingFace token" "$(hits 'hf_[A-Za-z0-9]{20,}')" "0" | 255 | check "no HuggingFace token" "$(hits 'hf_[A-Za-z0-9]{20,}')" "0" |
| 256 | check "no scorpiox-git token" "$(hits '3ef2c00cb68e')" "0" | 256 | check "no scorpiox-git token" "$(hits '3ef2c00cb68e')" "0" |
| 257 | check "no password literal" "$(hits 'Xboxone'09'0'9'')" "0" | 257 | check "no password literal" "$(hits 'Xboxone'09'0'9'')" "0" |
| 258 | -check "no runner pass" "$(hits 'RUNNER_'+'PASS=')" "0" | 258 | +check "no runner pass" "$(hits 'RUNNER_'"'"'PASS=')" "0" |
| 259 | check "no private 192.168 net" "$(hits '192\.168\.[0-9]{1,3}\.')" "0" | 259 | check "no private 192.168 net" "$(hits '192\.168\.[0-9]{1,3}\.')" "0" |
| 260 | check "no private 10.0 net" "$(hits '(^|[^0-9])10\.0\.[0-9]{1,3}\.')" "0" | 260 | check "no private 10.0 net" "$(hits '(^|[^0-9])10\.0\.[0-9]{1,3}\.')" "0" |
| 261 | check "no private 172.16 net" "$(hits '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.')" "0" | 261 | check "no private 172.16 net" "$(hits '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.')" "0" |
| 262 | 262 |