From 87ec5700533ca7be7a7efb95f6f3ec979ee0bf30 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 15:51:07 +0000 Subject: [PATCH 1/2] fix(ci): sync secret-scanner.yml from the template; stop echoing matched credential lines Replaces the inline scanner with rsr-template-repo d183b32's copy. The only differences: standards helper pin e064539 -> f0b3cd4 (reachable from standards main); matched lines are reported as file:line only, so a credential is not printed to the Actions log; the credential regex gains quoted-literal *_TOKEN=/*_API_KEY=/*_SECRET=/PASSWORD= detection. No uses: line changes, so actions.lock is untouched. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- .github/workflows/secret-scanner.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/secret-scanner.yml b/.github/workflows/secret-scanner.yml index 2e9830b..76767c4 100644 --- a/.github/workflows/secret-scanner.yml +++ b/.github/workflows/secret-scanner.yml @@ -16,7 +16,7 @@ permissions: contents: read # Self-contained execution of the estate secret-scanning contract pinned to -# metadatastician/standards@e064539116c2dcfdf282a4749dbd58c69961c7e6. +# metadatastician/standards@f0b3cd4c464d33e1584f8528c17bce104555e256. # Produces the `scan / gitleaks` status check that the `Secret-Scan-Floor` # ruleset (24309812) was created to require on `main`. # @@ -90,7 +90,7 @@ jobs: env: GITLEAKS_VERSION: '8.18.4' GITLEAKS_SHA256: 'ba6dbb656933921c775ee5a2d1c13a91046e7952e9d919f9bac4cec61d628e7d' - STANDARDS_SHA: 'e064539116c2dcfdf282a4749dbd58c69961c7e6' + STANDARDS_SHA: 'f0b3cd4c464d33e1584f8528c17bce104555e256' steps: - name: Checkout repository with full history uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -102,7 +102,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: metadatastician/standards - ref: e064539116c2dcfdf282a4749dbd58c69961c7e6 + ref: f0b3cd4c464d33e1584f8528c17bce104555e256 path: .standards-baseline sparse-checkout: config/gitleaks sparse-checkout-cone-mode: true @@ -305,13 +305,15 @@ jobs: old_scope="$(printf '%s\n' "$hits" | grep -E '^\./src/' || [ $? -eq 1 ])" new_scope="$(printf '%s\n' "$hits" | grep -vE '^\./src/' || [ $? -eq 1 ])" + # Print file:line only. The matched source text is the credential + # itself; echoing it would publish it to the Actions log. if [ -n "$old_scope" ]; then - printf '%s\n' "$old_scope" + printf '%s\n' "$old_scope" | cut -d: -f1,2 | sed 's/$/: hardcoded-secret pattern match (line text withheld)/' echo "WARNING: Potential hardcoded secret found matching: $pattern" blocking=1 fi if [ -n "$new_scope" ]; then - printf '%s\n' "$new_scope" + printf '%s\n' "$new_scope" | cut -d: -f1,2 | sed 's/$/: hardcoded-secret pattern match (line text withheld)/' if [[ "$TODAY" < "$ENFORCE_RUST_WIDE_SCAN_FROM" ]]; then echo "::warning::Potential hardcoded secret outside ./src matching:" \ "$pattern — becomes BLOCKING on $ENFORCE_RUST_WIDE_SCAN_FROM (today is $TODAY)." @@ -350,7 +352,16 @@ jobs: run: | set -euo pipefail rc=0 - git grep -IlE '(ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{82}|glpat-[A-Za-z0-9_-]{20,}|AKIA[0-9A-Z]{16}|-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----)' > "$RUNNER_TEMP/hits.txt" || rc=$? + # Provider-specific patterns, plus assignment of a quoted literal to a + # *_TOKEN / *_KEY / *_SECRET / password name (as in the estate canonical + # reusable, metadatastician/standards@f0b3cd4 + # .github/workflows/secret-scanner-reusable.yml). The value classes + # exclude '$', so ="${VAR}" and ="$VAR" never match. Only file names + # are listed, never the matched text. + SQ="'" + ASSIGN="[A-Z_]*(TOKEN|API_KEY|SECRET)[A-Z_]*=[\"${SQ}][A-Za-z0-9_./+=-]{16,}[\"${SQ}]|PASS[W]ORD=[\"${SQ}][^\"${SQ}\$]{6,}[\"${SQ}]" + PROVIDER='ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{82}|glpat-[A-Za-z0-9_-]{20,}|AKIA[0-9A-Z]{16}|-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----' + git grep -IlE "(${PROVIDER}|${ASSIGN})" > "$RUNNER_TEMP/hits.txt" || rc=$? # git grep exits 1 when nothing matches; above 1 is an error. if [ "$rc" -gt 1 ]; then echo "::error::Secret pattern scan failed with exit ${rc}" From 925f212484a246363e06ab666ce7f1c0c87ccfb9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 15:56:15 +0000 Subject: [PATCH 2/2] fix(ci): keep the scanner on the repo's shared standards pin (e064539) The template file moved the scanner to standards f0b3cd4, but this repo's other workflows (governance.yml) still use e064539, and the file's own contract says the scanner pin must match every other workflow's. Keep e064539 here; the credential-echo fix and the extended detection do not depend on the pin. The whole-repo pin move is the applier's job and lands in one change. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- .github/workflows/secret-scanner.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/secret-scanner.yml b/.github/workflows/secret-scanner.yml index 76767c4..f8f8cef 100644 --- a/.github/workflows/secret-scanner.yml +++ b/.github/workflows/secret-scanner.yml @@ -16,7 +16,7 @@ permissions: contents: read # Self-contained execution of the estate secret-scanning contract pinned to -# metadatastician/standards@f0b3cd4c464d33e1584f8528c17bce104555e256. +# metadatastician/standards@e064539116c2dcfdf282a4749dbd58c69961c7e6. # Produces the `scan / gitleaks` status check that the `Secret-Scan-Floor` # ruleset (24309812) was created to require on `main`. # @@ -90,7 +90,7 @@ jobs: env: GITLEAKS_VERSION: '8.18.4' GITLEAKS_SHA256: 'ba6dbb656933921c775ee5a2d1c13a91046e7952e9d919f9bac4cec61d628e7d' - STANDARDS_SHA: 'f0b3cd4c464d33e1584f8528c17bce104555e256' + STANDARDS_SHA: 'e064539116c2dcfdf282a4749dbd58c69961c7e6' steps: - name: Checkout repository with full history uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -102,7 +102,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: metadatastician/standards - ref: f0b3cd4c464d33e1584f8528c17bce104555e256 + ref: e064539116c2dcfdf282a4749dbd58c69961c7e6 path: .standards-baseline sparse-checkout: config/gitleaks sparse-checkout-cone-mode: true