Skip to content

Commit 6e5cc04

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#23)
## 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 97308b8 commit 6e5cc04

1 file changed

Lines changed: 5 additions & 66 deletions

File tree

Lines changed: 5 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +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-
# 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
1712

18-
permissions: read-all
13+
permissions:
14+
contents: read
1915

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

0 commit comments

Comments
 (0)