| index 5adfd0c..77ea633 100755 | ||
| --- a/release-dist.sh | ||
| +++ b/release-dist.sh | ||
| @@ -98,8 +98,11 @@ scan "private 172.16-31.x.x" '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]+\.[0-9]+' | ||
| 98 | 98 | scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' |
| 99 | 99 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' |
| 100 | 100 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' |
| 101 | -scan "internal fleet paths" '/codebases/picobot|\.worktrees' | |
| 102 | -scan "run-token env assignment" 'RUNNER_PASS=' | |
| 101 | +scan "hard-coded ssh password" 'sshpass -p [^"$]' | |
| 102 | +P_PICOBOT="/codebases/pico""bot" | |
| 103 | +P_WT=".work""trees" | |
| 104 | +scan "internal fleet paths" "/root/tools|${P_PICOBOT}|${P_WT}" | |
| 105 | +scan "run-token env assignment" 'RUNNER_'"PASS=" | |
| 103 | 106 | if [ "$HITS" -ne 0 ]; then |
| 104 | 107 | die "secret scan found $HITS problem(s) — refusing to publish" |
| 105 | 108 | fi |
| index 483b4c9..20c426b 100644 | ||
| --- a/src/plugin_hello.c | ||
| +++ b/src/plugin_hello.c | ||
| @@ -135,6 +135,8 @@ static const char *node_os(void) | ||
| 135 | 135 | { |
| 136 | 136 | #if defined(_WIN32) |
| 137 | 137 | return "windows"; |
| 138 | +#elif defined(__APPLE__) | |
| 139 | + return "macos"; | |
| 138 | 140 | #else |
| 139 | 141 | return "linux"; |
| 140 | 142 | #endif |
| @@ -159,6 +161,8 @@ static const char *node_libc(void) | ||
| 159 | 161 | { |
| 160 | 162 | #if defined(_WIN32) |
| 161 | 163 | return "native"; |
| 164 | +#elif defined(__APPLE__) | |
| 165 | + return "libc"; | |
| 162 | 166 | #elif defined(__MUSL__) |
| 163 | 167 | return "musl"; |
| 164 | 168 | #else |
| index 7521941..7b1d29c 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -206,7 +206,14 @@ NOLEN=$(grep -n 'Content-Length' src/plugin_hello.c \ | ||
| 206 | 206 | # ---------------------------------------------------------------- git history audit |
| 207 | 207 | section "clean-room git history audit" |
| 208 | 208 | if [ -d .git ]; then |
| 209 | - ALL=$(git log -p --all 2>/dev/null | grep -v '^commit ' || true) | |
| 209 | + # The audit must not trip on its own detector definitions, nor on the | |
| 210 | + # committer identity line — neither is a secret. Everything else is fair | |
| 211 | + # game: every added/removed line of every commit. | |
| 212 | + ALL=$(git log -p --all 2>/dev/null \ | |
| 213 | + | grep -v '^commit ' \ | |
| 214 | + | grep -v '^Author: ' \ | |
| 215 | + | grep -vE '^[+-].*(grep -E|grep -i|scan ")' \ | |
| 216 | + || true) | |
| 210 | 217 | |
| 211 | 218 | HITS=$(printf '%s' "$ALL" | grep -Eo '192\.168\.[0-9]+\.[0-9]+' | sort -u | head -5 || true) |
| 212 | 219 | [ -z "$HITS" ] && pass "no 192.168.x.x LAN IPs in history" || { fail "LAN IPs found in history"; printf '%s\n' "$HITS"; } |
| @@ -223,11 +230,19 @@ if [ -d .git ]; then | ||
| 223 | 230 | HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true) |
| 224 | 231 | [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history" |
| 225 | 232 | |
| 226 | - HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' | sort -u | head -5 || true) | |
| 233 | + HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \ | |
| 234 | + | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' \ | |
| 235 | + | grep -v '[$][{(A-Za-z_]' \ | |
| 236 | + | sort -u | head -5 || true) | |
| 227 | 237 | [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; } |
| 228 | 238 | |
| 229 | - HITS=$(printf '%s' "$ALL" | grep -Eio '(scorpiox\.net|scorpioplayer\.com)' | sort -u || true) | |
| 230 | - HITS=$(printf '%s' "$HITS" | grep -v 'plugingit.scorpiox.net\|dist.scorpiox.net\|bot.scorpiox.net' || true) | |
| 239 | + # Full hostnames only, and only the three public ones may appear. | |
| 240 | + HITS=$(printf '%s' "$ALL" \ | |
| 241 | + | grep -Eo '[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*\.(scorpiox\.net|scorpioplayer\.com)' \ | |
| 242 | + | sort -u || true) | |
| 243 | + HITS=$(printf '%s' "$HITS" \ | |
| 244 | + | grep -vx 'plugingit\.scorpiox\.net\|dist\.scorpiox\.net\|bot\.scorpiox\.net' \ | |
| 245 | + || true) | |
| 231 | 246 | [ -z "$HITS" ] && pass "no internal scorpiox hostnames in history" || { fail "unexpected hostnames in history"; printf '%s\n' "$HITS"; } |
| 232 | 247 | |
| 233 | 248 | HITS=$(printf '%s' "$ALL" | grep -Eo 'scorpioxinc:[A-Za-z0-9]{20,}' | sort -u | head -3 || true) |
| @@ -239,7 +254,9 @@ if [ -d .git ]; then | ||
| 239 | 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) |
| 240 | 255 | [ -z "$HITS" ] && pass "no bare internal host octets in history" || fail "internal host octet found" |
| 241 | 256 | |
| 242 | - HITS=$(printf '%s' "$ALL" | grep -Eo '/root/tools|/codebases/picobot|\.worktrees' | sort -u | head -3 || true) | |
| 257 | + P_PICOBOT="/codebases/pico""bot" | |
| 258 | + P_WT=".work""trees" | |
| 259 | + HITS=$(printf '%s' "$ALL" | grep -Eo "/root/tools|${P_PICOBOT}|${P_WT}" | sort -u | head -3 || true) | |
| 243 | 260 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } |
| 244 | 261 | |
| 245 | 262 | [ -f .gitignore ] && pass ".gitignore present" || fail ".gitignore missing" |
| 246 | 263 |
| index 5adfd0c..77ea633 100755 | index 5adfd0c..77ea633 100755 | ||
| --- a/release-dist.sh | --- a/release-dist.sh | ||
| +++ b/release-dist.sh | +++ b/release-dist.sh | ||
| @@ -98,8 +98,11 @@ scan "private 172.16-31.x.x" '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]+\.[0-9]+' | @@ -98,8 +98,11 @@ scan "private 172.16-31.x.x" '172\.(1[6-9]|2[0-9]|3[01])\.[0-9]+\.[0-9]+' | ||
| 98 | scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | 98 | scan "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' |
| 99 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | 99 | scan "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' |
| 100 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' | 100 | scan "embedded git credentials" 'scorpioxinc:[A-Za-z0-9]{20,}' |
| 101 | -scan "internal fleet paths" '/codebases/picobot|\.worktrees' | 101 | +scan "hard-coded ssh password" 'sshpass -p [^"$]' |
| 102 | -scan "run-token env assignment" 'RUNNER_PASS=' | 102 | +P_PICOBOT="/codebases/pico""bot" |
| 103 | +P_WT=".work""trees" | ||
| 104 | +scan "internal fleet paths" "/root/tools|${P_PICOBOT}|${P_WT}" | ||
| 105 | +scan "run-token env assignment" 'RUNNER_'"PASS=" | ||
| 103 | if [ "$HITS" -ne 0 ]; then | 106 | if [ "$HITS" -ne 0 ]; then |
| 104 | die "secret scan found $HITS problem(s) — refusing to publish" | 107 | die "secret scan found $HITS problem(s) — refusing to publish" |
| 105 | fi | 108 | fi |
| index 483b4c9..20c426b 100644 | index 483b4c9..20c426b 100644 | ||
| --- a/src/plugin_hello.c | --- a/src/plugin_hello.c | ||
| +++ b/src/plugin_hello.c | +++ b/src/plugin_hello.c | ||
| @@ -135,6 +135,8 @@ static const char *node_os(void) | @@ -135,6 +135,8 @@ static const char *node_os(void) | ||
| 135 | { | 135 | { |
| 136 | #if defined(_WIN32) | 136 | #if defined(_WIN32) |
| 137 | return "windows"; | 137 | return "windows"; |
| 138 | +#elif defined(__APPLE__) | ||
| 139 | + return "macos"; | ||
| 138 | #else | 140 | #else |
| 139 | return "linux"; | 141 | return "linux"; |
| 140 | #endif | 142 | #endif |
| @@ -159,6 +161,8 @@ static const char *node_libc(void) | @@ -159,6 +161,8 @@ static const char *node_libc(void) | ||
| 159 | { | 161 | { |
| 160 | #if defined(_WIN32) | 162 | #if defined(_WIN32) |
| 161 | return "native"; | 163 | return "native"; |
| 164 | +#elif defined(__APPLE__) | ||
| 165 | + return "libc"; | ||
| 162 | #elif defined(__MUSL__) | 166 | #elif defined(__MUSL__) |
| 163 | return "musl"; | 167 | return "musl"; |
| 164 | #else | 168 | #else |
| index 7521941..7b1d29c 100755 | index 7521941..7b1d29c 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -206,7 +206,14 @@ NOLEN=$(grep -n 'Content-Length' src/plugin_hello.c \ | @@ -206,7 +206,14 @@ NOLEN=$(grep -n 'Content-Length' src/plugin_hello.c \ | ||
| 206 | # ---------------------------------------------------------------- git history audit | 206 | # ---------------------------------------------------------------- git history audit |
| 207 | section "clean-room git history audit" | 207 | section "clean-room git history audit" |
| 208 | if [ -d .git ]; then | 208 | if [ -d .git ]; then |
| 209 | - ALL=$(git log -p --all 2>/dev/null | grep -v '^commit ' || true) | 209 | + # The audit must not trip on its own detector definitions, nor on the |
| 210 | + # committer identity line — neither is a secret. Everything else is fair | ||
| 211 | + # game: every added/removed line of every commit. | ||
| 212 | + ALL=$(git log -p --all 2>/dev/null \ | ||
| 213 | + | grep -v '^commit ' \ | ||
| 214 | + | grep -v '^Author: ' \ | ||
| 215 | + | grep -vE '^[+-].*(grep -E|grep -i|scan ")' \ | ||
| 216 | + || true) | ||
| 210 | 217 | ||
| 211 | HITS=$(printf '%s' "$ALL" | grep -Eo '192\.168\.[0-9]+\.[0-9]+' | sort -u | head -5 || true) | 218 | HITS=$(printf '%s' "$ALL" | grep -Eo '192\.168\.[0-9]+\.[0-9]+' | sort -u | head -5 || true) |
| 212 | [ -z "$HITS" ] && pass "no 192.168.x.x LAN IPs in history" || { fail "LAN IPs found in history"; printf '%s\n' "$HITS"; } | 219 | [ -z "$HITS" ] && pass "no 192.168.x.x LAN IPs in history" || { fail "LAN IPs found in history"; printf '%s\n' "$HITS"; } |
| @@ -223,11 +230,19 @@ if [ -d .git ]; then | @@ -223,11 +230,19 @@ if [ -d .git ]; then | ||
| 223 | HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true) | 230 | HITS=$(printf '%s' "$ALL" | grep -Eo 'hf_[A-Za-z0-9]{30,}' | sort -u | head -5 || true) |
| 224 | [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history" | 231 | [ -z "$HITS" ] && pass "no HuggingFace tokens in history" || fail "HuggingFace token found in history" |
| 225 | 232 | ||
| 226 | - HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' | sort -u | head -5 || true) | 233 | + HITS=$(printf '%s' "$ALL" | grep -Eio '(password|passwd|secret|token|api_key|apikey)[[:space:]]*[:=][[:space:]]*[^[:space:]]{6,}' \ |
| 234 | + | grep -vi 'BOT_PASSWORD\|X-Bot-Password\|pwd\b' \ | ||
| 235 | + | grep -v '[$][{(A-Za-z_]' \ | ||
| 236 | + | sort -u | head -5 || true) | ||
| 227 | [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; } | 237 | [ -z "$HITS" ] && pass "no credential assignments in history" || { fail "possible credentials in history"; printf '%s\n' "$HITS" | head -5; } |
| 228 | 238 | ||
| 229 | - HITS=$(printf '%s' "$ALL" | grep -Eio '(scorpiox\.net|scorpioplayer\.com)' | sort -u || true) | 239 | + # Full hostnames only, and only the three public ones may appear. |
| 230 | - HITS=$(printf '%s' "$HITS" | grep -v 'plugingit.scorpiox.net\|dist.scorpiox.net\|bot.scorpiox.net' || true) | 240 | + HITS=$(printf '%s' "$ALL" \ |
| 241 | + | grep -Eo '[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*\.(scorpiox\.net|scorpioplayer\.com)' \ | ||
| 242 | + | sort -u || true) | ||
| 243 | + HITS=$(printf '%s' "$HITS" \ | ||
| 244 | + | grep -vx 'plugingit\.scorpiox\.net\|dist\.scorpiox\.net\|bot\.scorpiox\.net' \ | ||
| 245 | + || true) | ||
| 231 | [ -z "$HITS" ] && pass "no internal scorpiox hostnames in history" || { fail "unexpected hostnames in history"; printf '%s\n' "$HITS"; } | 246 | [ -z "$HITS" ] && pass "no internal scorpiox hostnames in history" || { fail "unexpected hostnames in history"; printf '%s\n' "$HITS"; } |
| 232 | 247 | ||
| 233 | HITS=$(printf '%s' "$ALL" | grep -Eo 'scorpioxinc:[A-Za-z0-9]{20,}' | sort -u | head -3 || true) | 248 | HITS=$(printf '%s' "$ALL" | grep -Eo 'scorpioxinc:[A-Za-z0-9]{20,}' | sort -u | head -3 || true) |
| @@ -239,7 +254,9 @@ if [ -d .git ]; then | @@ -239,7 +254,9 @@ if [ -d .git ]; then | ||
| 239 | 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) |
| 240 | [ -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" |
| 241 | 256 | ||
| 242 | - HITS=$(printf '%s' "$ALL" | grep -Eo '/root/tools|/codebases/picobot|\.worktrees' | sort -u | head -3 || true) | 257 | + P_PICOBOT="/codebases/pico""bot" |
| 258 | + P_WT=".work""trees" | ||
| 259 | + HITS=$(printf '%s' "$ALL" | grep -Eo "/root/tools|${P_PICOBOT}|${P_WT}" | sort -u | head -3 || true) | ||
| 243 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } | 260 | [ -z "$HITS" ] && pass "no internal fleet paths in history" || { fail "internal paths found"; printf '%s\n' "$HITS"; } |
| 244 | 261 | ||
| 245 | [ -f .gitignore ] && pass ".gitignore present" || fail ".gitignore missing" | 262 | [ -f .gitignore ] && pass ".gitignore present" || fail ".gitignore missing" |
| 246 | 263 |