Skip to content

Commit efeb668

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#45)
## 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 8caa756 commit efeb668

1 file changed

Lines changed: 3 additions & 62 deletions

File tree

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
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-
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
11-
# updates do not pile up queued runs against the shared account-wide
12-
# Actions concurrency pool. Applied only to read-only check workflows
13-
# (no publish/mutation), so cancelling a superseded run is always safe.
149
concurrency:
1510
group: ${{ github.workflow }}-${{ github.ref }}
1611
cancel-in-progress: true
@@ -19,60 +14,6 @@ permissions:
1914
contents: read
2015

2116
jobs:
22-
trufflehog:
23-
runs-on: ubuntu-latest
24-
steps:
25-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26-
with:
27-
fetch-depth: 0 # Full history for scanning
28-
29-
- name: TruffleHog Secret Scan
30-
uses: trufflesecurity/trufflehog@37b77001d0174ebec2fcca2bd83ff83a6d45a3ab # v3
31-
with:
32-
# trufflehog action 3.95.x appends its own --fail internally;
33-
# passing --fail here would duplicate the flag and the CLI exits 1.
34-
# See hyperpolymath/standards#51.
35-
extra_args: --only-verified
36-
37-
gitleaks:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41-
with:
42-
fetch-depth: 0
43-
44-
- name: Gitleaks Secret Scan
45-
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
49-
# Rust-specific: Check for hardcoded crypto values
50-
rust-secrets:
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54-
55-
- name: Check for hardcoded secrets in Rust
56-
run: |
57-
# Patterns that suggest hardcoded secrets
58-
PATTERNS=(
59-
'const.*SECRET.*=.*"'
60-
'const.*KEY.*=.*"[a-zA-Z0-9]{16,}"'
61-
'const.*TOKEN.*=.*"'
62-
'let.*api_key.*=.*"'
63-
'HMAC.*"[a-fA-F0-9]{32,}"'
64-
'password.*=.*"[^"]+"'
65-
)
66-
67-
found=0
68-
for pattern in "${PATTERNS[@]}"; do
69-
if grep -rn --include="*.rs" -E "$pattern" src/; then
70-
echo "WARNING: Potential hardcoded secret found matching: $pattern"
71-
found=1
72-
fi
73-
done
74-
75-
if [ $found -eq 1 ]; then
76-
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
77-
exit 1
78-
fi
17+
scan:
18+
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
19+
secrets: inherit

0 commit comments

Comments
 (0)