Skip to content

Commit 6754df6

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#48)
## 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 post-Cloudflare-leak 2026-05-21 in response to the live API-token leak via `avow-protocol/deploy-repos.sh`) was carried by 0 of 16 sampled estate copies. This PR brings the guardrail to this repo. ## Why now Estate audit: 281 deployments / 54 unique SHAs / 19% true drift. Drift is pin churn + whitespace, feature variance 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 `gitleaks-action` doesn't fall back to anonymous (rate-limited) mode. Part of estate-wide convergence campaign 2026-05-26 (standards#199 / #190).
1 parent c1609f4 commit 6754df6

1 file changed

Lines changed: 7 additions & 61 deletions

File tree

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,19 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
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

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
1013
permissions:
1114
contents: read
1215

1316
jobs:
14-
trufflehog:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18-
with:
19-
fetch-depth: 0 # Full history for scanning
20-
21-
- name: TruffleHog Secret Scan
22-
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
23-
with:
24-
# The v3 action injects --fail automatically on pull_request events.
25-
# Passing --fail here triggers "flag 'fail' cannot be repeated".
26-
extra_args: --only-verified
27-
28-
gitleaks:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32-
with:
33-
fetch-depth: 0
34-
35-
- name: Gitleaks Secret Scan
36-
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-
40-
# Rust-specific: Check for hardcoded crypto values
41-
rust-secrets:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45-
46-
- name: Check for hardcoded secrets in Rust
47-
run: |
48-
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
49-
echo 'No Cargo.toml found — skipping Rust secrets check'
50-
exit 0
51-
fi
52-
# Patterns that suggest hardcoded secrets
53-
PATTERNS=(
54-
'const.*SECRET.*=.*"'
55-
'const.*KEY.*=.*"[a-zA-Z0-9]{16,}"'
56-
'const.*TOKEN.*=.*"'
57-
'let.*api_key.*=.*"'
58-
'HMAC.*"[a-fA-F0-9]{32,}"'
59-
'password.*=.*"[^"]+"'
60-
)
61-
62-
found=0
63-
for pattern in "${PATTERNS[@]}"; do
64-
if grep -rn --include="*.rs" -E "$pattern" src/; then
65-
echo "WARNING: Potential hardcoded secret found matching: $pattern"
66-
found=1
67-
fi
68-
done
69-
70-
if [ $found -eq 1 ]; then
71-
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
72-
exit 1
73-
fi
17+
scan:
18+
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
19+
secrets: inherit

0 commit comments

Comments
 (0)