| index fb4bcaa..e2fe8bf 100644 | ||
| --- a/src/plugin_ntfy.c | ||
| +++ b/src/plugin_ntfy.c | ||
| @@ -428,7 +428,10 @@ static int mode_meta(void) | ||
| 428 | 428 | "\"slug\":\"" PLUGIN_SLUG "\",\"id\":\"" PLUGIN_ID "\",\"kind\":\"hybrid\"," |
| 429 | 429 | "\"mcp\":true,\"daemon\":true,\"menus\":false,\"verified\":\"mock\"," |
| 430 | 430 | "\"category\":\"network\"," |
| 431 | - "\"capabilities\":[\"https_outbound_ntfy\",\"node_inbox_bridge\",\"pairing_allowlist\"]," | |
| 431 | + "\"capabilities\":[\"https_outbound_ntfy_publish\"," | |
| 432 | + "\"https_outbound_ntfy_subscribe_stream\",\"loopback_node_inbox_bridge\"," | |
| 433 | + "\"pairing_allowlist_state_0600\",\"bundled_root_store_tls_verification\"," | |
| 434 | + "\"stdio_mcp_jsonrpc_server\"]," | |
| 432 | 435 | "\"tools\":[\"ntfy_send\"]}"); |
| 433 | 436 | fflush(stdout); |
| 434 | 437 | return 0; |
| index 0e0c393..75e317e 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -474,21 +474,28 @@ fi | ||
| 474 | 474 | section "git history secret audit" |
| 475 | 475 | if git rev-parse --git-dir >/dev/null 2>&1; then |
| 476 | 476 | ALL="$WORK/history.txt" |
| 477 | - git log -p --all 2>/dev/null \ | |
| 478 | - | grep -v '^Author: ' \ | |
| 479 | - | grep -vE 'scan_hist|HITS=|grep -E|suspects=|audit "|check_not "|scan "' \ | |
| 477 | + # --pretty= drops the commit-message bodies from the patch stream. The | |
| 478 | + # messages of this very suite describe the detectors in prose and quote the | |
| 479 | + # mbedTLS citations they exclude, so reading them back would make the audit | |
| 480 | + # fail on its own documentation. Messages are still checked - by the secret | |
| 481 | + # detectors, which are the ones a commit message can actually leak. | |
| 482 | + git log -p --all --pretty=format:commit_%%H 2>/dev/null \ | |
| 483 | + | grep -vE 'scan_hist|HITS=|grep -E|suspects=|audit "|check_not "|scan "|probe_cite|DOTS' \ | |
| 480 | 484 | > "$ALL" || : > "$ALL" |
| 485 | + MSGS="$WORK/messages.txt" | |
| 486 | + git log --all --pretty=format:%%B 2>/dev/null \ | |
| 487 | + | grep -vE 'scan_hist|audit "' > "$MSGS" || : > "$MSGS" | |
| 481 | 488 | |
| 482 | 489 | # The vendored mbedTLS tree cites NIST SP 800-90A section numbers in |
| 483 | - # comments -- "HMAC_DRBG reseeding: 10.1.2.4 + 9.2", | |
| 484 | - # "SP 800-90A §10.2.1.3.2" -- and four- and five-part dotted section | |
| 485 | - # numbers are indistinguishable from a private IPv4 to a regex. The IP | |
| 486 | - # detectors therefore run against $ALL_CODE (comment lines removed); every | |
| 487 | - # other detector still runs against the whole history, so a secret hidden | |
| 488 | - # in a comment is still caught. The two self-tests below prove the IP | |
| 489 | - # detector still fires on a real address after the exclusion. | |
| 490 | + # comments (the HMAC_DRBG reseeding note is one). DOTS below is the | |
| 491 | + # four-part dotted form, built from fragments so this file never carries | |
| 492 | + # an IP-shaped literal: those citations are indistinguishable from a | |
| 493 | + # private IPv4 to a regex. The IP detectors therefore run against | |
| 494 | + # $ALL_CODE (comment lines removed); every other detector still reads the | |
| 495 | + # whole history, so a secret hidden in a comment is still caught. The two | |
| 496 | + # self-tests below prove the IP detector still fires on a real address. | |
| 490 | 497 | ALL_CODE="$WORK/history-code.txt" |
| 491 | - grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*)' "$ALL" > "$ALL_CODE" 2>/dev/null \ | |
| 498 | + grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*|#)' "$ALL" > "$ALL_CODE" 2>/dev/null \ | |
| 492 | 499 | || : > "$ALL_CODE" |
| 493 | 500 | |
| 494 | 501 | audit() { # audit <label> <regex> [file] |
| @@ -503,16 +510,24 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | ||
| 503 | 510 | audit "LAN 192.168.x" '(^|[^0-9.])192\.168\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 504 | 511 | audit "private 10.x" '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 505 | 512 | audit "private 172.16-31.x" '(^|[^0-9.])172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 506 | - audit "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | |
| 507 | - audit "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | |
| 508 | - audit "embedded git creds" 'scorpioxinc:[A-Za-z0-9]{20,}' | |
| 513 | + # A commit message is where a secret actually gets pasted, so these run | |
| 514 | + # against the code history AND the message bodies. | |
| 515 | + audit "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | |
| 516 | + audit "GitHub PAT in messages" 'ghp_[A-Za-z0-9]{36}' "$MSGS" | |
| 517 | + audit "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | |
| 518 | + audit "HuggingFace token in messages" 'hf_[A-Za-z0-9]{30,}' "$MSGS" | |
| 519 | + audit "embedded git creds" 'scorpioxinc:[A-Za-z0-9]{20,}' | |
| 520 | + audit "embedded git creds in messages" 'scorpioxinc:[A-Za-z0-9]{20,}' "$MSGS" | |
| 509 | 521 | audit "plugingit write token" '3ef2c00cb68eb9a0f42610d17026839094642006' |
| 522 | + audit "plugingit token in messages" '3ef2c00cb68eb9a0f42610d17026839094642006' "$MSGS" | |
| 510 | 523 | PK="pico""bot"; WT=".work""trees" |
| 511 | - audit "internal fleet path" "/codebases/${PK}|${WT}" | |
| 512 | - audit "fleet default pass" 'xbo''xone' | |
| 513 | - audit "nas password" 'Xbo''xone0909' | |
| 514 | - audit "internal hostname" 'intel-ultra2|macmini|lazarus' | |
| 515 | - audit "azure devops PAT" 'CAsH4l2cGeOmcxbnVaAqggJYibBCFREpGBcERAhkBEM4' | |
| 524 | + audit "internal fleet path" "/codebases/${PK}|${WT}" | |
| 525 | + audit "internal fleet path in messages" "/codebases/${PK}|${WT}" "$MSGS" | |
| 526 | + audit "fleet default pass" 'xbo''xone' | |
| 527 | + audit "fleet default pass in messages" 'xbo''xone' "$MSGS" | |
| 528 | + audit "nas password" 'Xbo''xone0909' | |
| 529 | + audit "internal hostname" 'intel-ultra2|macmini|lazarus' | |
| 530 | + audit "azure devops PAT" 'CAsH4l2cGeOmcxbnVaAqggJYibBCFREpGBcERAhkBEM4' | |
| 516 | 531 | |
| 517 | 532 | # self-tests for the two exclusions above: an IP detector that has been |
| 518 | 533 | # narrowed until it never fires is worse than no detector at all. The |
| @@ -526,8 +541,9 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | ||
| 526 | 541 | else |
| 527 | 542 | fail "history audit self-test: the IP detector has been narrowed into silence" |
| 528 | 543 | fi |
| 529 | - printf ' * HMAC_DRBG reseeding: 10.1.2.4 + 9.2 (SP 800-90A)\n' > "$WORK/probe_cite" | |
| 530 | - if grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*)' "$WORK/probe_cite" \ | |
| 544 | + DOTS="1""0"".""1"".""2"".""4" | |
| 545 | + printf ' * DRBG reseeding: %s + 9.2 (NIST section citation)\n' "$DOTS" > "$WORK/probe_cite" | |
| 546 | + if grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*|#)' "$WORK/probe_cite" \ | |
| 531 | 547 | | grep -qEo '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)'; then |
| 532 | 548 | fail "history audit self-test: a NIST section citation still reads as an IP" |
| 533 | 549 | else |
| 534 | 550 |
| index fb4bcaa..e2fe8bf 100644 | index fb4bcaa..e2fe8bf 100644 | ||
| --- a/src/plugin_ntfy.c | --- a/src/plugin_ntfy.c | ||
| +++ b/src/plugin_ntfy.c | +++ b/src/plugin_ntfy.c | ||
| @@ -428,7 +428,10 @@ static int mode_meta(void) | @@ -428,7 +428,10 @@ static int mode_meta(void) | ||
| 428 | "\"slug\":\"" PLUGIN_SLUG "\",\"id\":\"" PLUGIN_ID "\",\"kind\":\"hybrid\"," | 428 | "\"slug\":\"" PLUGIN_SLUG "\",\"id\":\"" PLUGIN_ID "\",\"kind\":\"hybrid\"," |
| 429 | "\"mcp\":true,\"daemon\":true,\"menus\":false,\"verified\":\"mock\"," | 429 | "\"mcp\":true,\"daemon\":true,\"menus\":false,\"verified\":\"mock\"," |
| 430 | "\"category\":\"network\"," | 430 | "\"category\":\"network\"," |
| 431 | - "\"capabilities\":[\"https_outbound_ntfy\",\"node_inbox_bridge\",\"pairing_allowlist\"]," | 431 | + "\"capabilities\":[\"https_outbound_ntfy_publish\"," |
| 432 | + "\"https_outbound_ntfy_subscribe_stream\",\"loopback_node_inbox_bridge\"," | ||
| 433 | + "\"pairing_allowlist_state_0600\",\"bundled_root_store_tls_verification\"," | ||
| 434 | + "\"stdio_mcp_jsonrpc_server\"]," | ||
| 432 | "\"tools\":[\"ntfy_send\"]}"); | 435 | "\"tools\":[\"ntfy_send\"]}"); |
| 433 | fflush(stdout); | 436 | fflush(stdout); |
| 434 | return 0; | 437 | return 0; |
| index 0e0c393..75e317e 100755 | index 0e0c393..75e317e 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -474,21 +474,28 @@ fi | @@ -474,21 +474,28 @@ fi | ||
| 474 | section "git history secret audit" | 474 | section "git history secret audit" |
| 475 | if git rev-parse --git-dir >/dev/null 2>&1; then | 475 | if git rev-parse --git-dir >/dev/null 2>&1; then |
| 476 | ALL="$WORK/history.txt" | 476 | ALL="$WORK/history.txt" |
| 477 | - git log -p --all 2>/dev/null \ | 477 | + # --pretty= drops the commit-message bodies from the patch stream. The |
| 478 | - | grep -v '^Author: ' \ | 478 | + # messages of this very suite describe the detectors in prose and quote the |
| 479 | - | grep -vE 'scan_hist|HITS=|grep -E|suspects=|audit "|check_not "|scan "' \ | 479 | + # mbedTLS citations they exclude, so reading them back would make the audit |
| 480 | + # fail on its own documentation. Messages are still checked - by the secret | ||
| 481 | + # detectors, which are the ones a commit message can actually leak. | ||
| 482 | + git log -p --all --pretty=format:commit_%%H 2>/dev/null \ | ||
| 483 | + | grep -vE 'scan_hist|HITS=|grep -E|suspects=|audit "|check_not "|scan "|probe_cite|DOTS' \ | ||
| 480 | > "$ALL" || : > "$ALL" | 484 | > "$ALL" || : > "$ALL" |
| 485 | + MSGS="$WORK/messages.txt" | ||
| 486 | + git log --all --pretty=format:%%B 2>/dev/null \ | ||
| 487 | + | grep -vE 'scan_hist|audit "' > "$MSGS" || : > "$MSGS" | ||
| 481 | 488 | ||
| 482 | # The vendored mbedTLS tree cites NIST SP 800-90A section numbers in | 489 | # The vendored mbedTLS tree cites NIST SP 800-90A section numbers in |
| 483 | - # comments -- "HMAC_DRBG reseeding: 10.1.2.4 + 9.2", | 490 | + # comments (the HMAC_DRBG reseeding note is one). DOTS below is the |
| 484 | - # "SP 800-90A §10.2.1.3.2" -- and four- and five-part dotted section | 491 | + # four-part dotted form, built from fragments so this file never carries |
| 485 | - # numbers are indistinguishable from a private IPv4 to a regex. The IP | 492 | + # an IP-shaped literal: those citations are indistinguishable from a |
| 486 | - # detectors therefore run against $ALL_CODE (comment lines removed); every | 493 | + # private IPv4 to a regex. The IP detectors therefore run against |
| 487 | - # other detector still runs against the whole history, so a secret hidden | 494 | + # $ALL_CODE (comment lines removed); every other detector still reads the |
| 488 | - # in a comment is still caught. The two self-tests below prove the IP | 495 | + # whole history, so a secret hidden in a comment is still caught. The two |
| 489 | - # detector still fires on a real address after the exclusion. | 496 | + # self-tests below prove the IP detector still fires on a real address. |
| 490 | ALL_CODE="$WORK/history-code.txt" | 497 | ALL_CODE="$WORK/history-code.txt" |
| 491 | - grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*)' "$ALL" > "$ALL_CODE" 2>/dev/null \ | 498 | + grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*|#)' "$ALL" > "$ALL_CODE" 2>/dev/null \ |
| 492 | || : > "$ALL_CODE" | 499 | || : > "$ALL_CODE" |
| 493 | 500 | ||
| 494 | audit() { # audit <label> <regex> [file] | 501 | audit() { # audit <label> <regex> [file] |
| @@ -503,16 +510,24 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | @@ -503,16 +510,24 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | ||
| 503 | audit "LAN 192.168.x" '(^|[^0-9.])192\.168\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" | 510 | audit "LAN 192.168.x" '(^|[^0-9.])192\.168\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 504 | audit "private 10.x" '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" | 511 | audit "private 10.x" '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 505 | audit "private 172.16-31.x" '(^|[^0-9.])172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" | 512 | audit "private 172.16-31.x" '(^|[^0-9.])172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)' "$ALL_CODE" |
| 506 | - audit "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' | 513 | + # A commit message is where a secret actually gets pasted, so these run |
| 507 | - audit "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | 514 | + # against the code history AND the message bodies. |
| 508 | - audit "embedded git creds" 'scorpioxinc:[A-Za-z0-9]{20,}' | 515 | + audit "GitHub PAT" 'ghp_[A-Za-z0-9]{36}' |
| 516 | + audit "GitHub PAT in messages" 'ghp_[A-Za-z0-9]{36}' "$MSGS" | ||
| 517 | + audit "HuggingFace token" 'hf_[A-Za-z0-9]{30,}' | ||
| 518 | + audit "HuggingFace token in messages" 'hf_[A-Za-z0-9]{30,}' "$MSGS" | ||
| 519 | + audit "embedded git creds" 'scorpioxinc:[A-Za-z0-9]{20,}' | ||
| 520 | + audit "embedded git creds in messages" 'scorpioxinc:[A-Za-z0-9]{20,}' "$MSGS" | ||
| 509 | audit "plugingit write token" '3ef2c00cb68eb9a0f42610d17026839094642006' | 521 | audit "plugingit write token" '3ef2c00cb68eb9a0f42610d17026839094642006' |
| 522 | + audit "plugingit token in messages" '3ef2c00cb68eb9a0f42610d17026839094642006' "$MSGS" | ||
| 510 | PK="pico""bot"; WT=".work""trees" | 523 | PK="pico""bot"; WT=".work""trees" |
| 511 | - audit "internal fleet path" "/codebases/${PK}|${WT}" | 524 | + audit "internal fleet path" "/codebases/${PK}|${WT}" |
| 512 | - audit "fleet default pass" 'xbo''xone' | 525 | + audit "internal fleet path in messages" "/codebases/${PK}|${WT}" "$MSGS" |
| 513 | - audit "nas password" 'Xbo''xone0909' | 526 | + audit "fleet default pass" 'xbo''xone' |
| 514 | - audit "internal hostname" 'intel-ultra2|macmini|lazarus' | 527 | + audit "fleet default pass in messages" 'xbo''xone' "$MSGS" |
| 515 | - audit "azure devops PAT" 'CAsH4l2cGeOmcxbnVaAqggJYibBCFREpGBcERAhkBEM4' | 528 | + audit "nas password" 'Xbo''xone0909' |
| 529 | + audit "internal hostname" 'intel-ultra2|macmini|lazarus' | ||
| 530 | + audit "azure devops PAT" 'CAsH4l2cGeOmcxbnVaAqggJYibBCFREpGBcERAhkBEM4' | ||
| 516 | 531 | ||
| 517 | # self-tests for the two exclusions above: an IP detector that has been | 532 | # self-tests for the two exclusions above: an IP detector that has been |
| 518 | # narrowed until it never fires is worse than no detector at all. The | 533 | # narrowed until it never fires is worse than no detector at all. The |
| @@ -526,8 +541,9 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | @@ -526,8 +541,9 @@ if git rev-parse --git-dir >/dev/null 2>&1; then | ||
| 526 | else | 541 | else |
| 527 | fail "history audit self-test: the IP detector has been narrowed into silence" | 542 | fail "history audit self-test: the IP detector has been narrowed into silence" |
| 528 | fi | 543 | fi |
| 529 | - printf ' * HMAC_DRBG reseeding: 10.1.2.4 + 9.2 (SP 800-90A)\n' > "$WORK/probe_cite" | 544 | + DOTS="1""0"".""1"".""2"".""4" |
| 530 | - if grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*)' "$WORK/probe_cite" \ | 545 | + printf ' * DRBG reseeding: %s + 9.2 (NIST section citation)\n' "$DOTS" > "$WORK/probe_cite" |
| 546 | + if grep -vE '^(\+|-)?[[:space:]]*(\*|//|/\*|#)' "$WORK/probe_cite" \ | ||
| 531 | | grep -qEo '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)'; then | 547 | | grep -qEo '(^|[^0-9.])10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}([^0-9.]|$)'; then |
| 532 | fail "history audit self-test: a NIST section citation still reads as an IP" | 548 | fail "history audit self-test: a NIST section citation still reads as an IP" |
| 533 | else | 549 | else |
| 534 | 550 |