Skip to content

Commit 97dce02

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#17)
## Summary Replaces this repo's `secret-scanner.yml` (~75-116 lines) with a thin ~14-line wrapper calling `hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0` (merged via standards#190). ## Security debt closed The `shell-secrets` job (added to the canonical 2026-05-21 in direct response to the live Cloudflare API token leak via `avow-protocol/deploy-repos.sh` — a leak both `trufflehog --only-verified` and default `gitleaks` missed) was carried by 0 of 16 sampled estate copies. This PR brings that guardrail to this repo. ## Why now Estate audit: 281 `secret-scanner.yml` deployments / 54 unique SHAs / 19% true drift. Drift is pin churn + whitespace; feature variance is near-zero. Converging behind the reusable means the next post-incident guardrail update propagates via one SHA bump. `secrets: inherit` flows `GITHUB_TOKEN` through implicitly so the `gitleaks-action` step doesn't fall back to anonymous (rate-limited) mode. Part of estate-wide convergence campaign 2026-05-26 (standards#199 / #190).
1 parent 9cad5a6 commit 97dce02

1 file changed

Lines changed: 9 additions & 62 deletions

File tree

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,19 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Prevention workflow - scans for hardcoded secrets before they reach main
32
name: Secret Scanner
43

54
on:
65
pull_request:
76
push:
87
branches: [main]
98

10-
permissions: read-all
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
1112

12-
jobs:
13-
trufflehog:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
17-
with:
18-
fetch-depth: 0 # Full history for scanning
19-
20-
- name: TruffleHog Secret Scan
21-
uses: trufflesecurity/trufflehog@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3
22-
with:
23-
# The v3 action injects --fail automatically on pull_request events.
24-
# Passing --fail here triggers "flag 'fail' cannot be repeated".
25-
extra_args: --only-verified
26-
27-
gitleaks:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
31-
with:
32-
fetch-depth: 0
33-
34-
- name: Gitleaks Secret Scan
35-
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
permissions:
14+
contents: read
3815

39-
# Rust-specific: Check for hardcoded crypto values
40-
rust-secrets:
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
44-
45-
- name: Check for hardcoded secrets in Rust
46-
run: |
47-
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
48-
echo 'No Cargo.toml found — skipping Rust secrets check'
49-
exit 0
50-
fi
51-
# Patterns that suggest hardcoded secrets
52-
PATTERNS=(
53-
'const.*SECRET.*=.*"'
54-
'const.*KEY.*=.*"[a-zA-Z0-9]{16,}"'
55-
'const.*TOKEN.*=.*"'
56-
'let.*api_key.*=.*"'
57-
'HMAC.*"[a-fA-F0-9]{32,}"'
58-
'password.*=.*"[^"]+"'
59-
)
60-
61-
found=0
62-
for pattern in "${PATTERNS[@]}"; do
63-
if grep -rn --include="*.rs" -E "$pattern" src/; then
64-
echo "WARNING: Potential hardcoded secret found matching: $pattern"
65-
found=1
66-
fi
67-
done
68-
69-
if [ $found -eq 1 ]; then
70-
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
71-
exit 1
72-
fi
16+
jobs:
17+
scan:
18+
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
19+
secrets: inherit

0 commit comments

Comments
 (0)