Skip to content

Commit 8d9877f

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#17)
Pins to hyperpolymath/standards#190 merge SHA 3e4bd4c93911750727e2e4c66dff859e00079da0. Force-propagates the shell-secrets job (added post-Cloudflare-leak 2026-05-21) to this repo's secret-scanning gate. Replaces ~75-116 lines with a ~14-line wrapper. Part of estate-wide convergence campaign 2026-05-26 (standards#199 / #190).
1 parent d34c740 commit 8d9877f

1 file changed

Lines changed: 3 additions & 63 deletions

File tree

Lines changed: 3 additions & 63 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,61 +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@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
31-
with:
32-
extra_args: --only-verified
33-
34-
gitleaks:
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38-
with:
39-
fetch-depth: 0
40-
41-
- name: Gitleaks Secret Scan
42-
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
46-
# Rust-specific: Check for hardcoded crypto values
47-
rust-secrets:
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51-
52-
- name: Check for hardcoded secrets in Rust
53-
run: |
54-
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
55-
echo 'No Cargo.toml found — skipping Rust secrets check'
56-
exit 0
57-
fi
58-
# Patterns that suggest hardcoded secrets
59-
PATTERNS=(
60-
'const.*SECRET.*=.*"'
61-
'const.*KEY.*=.*"[a-zA-Z0-9]{16,}"'
62-
'const.*TOKEN.*=.*"'
63-
'let.*api_key.*=.*"'
64-
'HMAC.*"[a-fA-F0-9]{32,}"'
65-
'password.*=.*"[^"]+"'
66-
)
67-
68-
found=0
69-
for pattern in "${PATTERNS[@]}"; do
70-
if grep -rn --include="*.rs" -E "$pattern" src/; then
71-
echo "WARNING: Potential hardcoded secret found matching: $pattern"
72-
found=1
73-
fi
74-
done
75-
76-
if [ $found -eq 1 ]; then
77-
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
78-
exit 1
79-
fi
17+
scan:
18+
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
19+
secrets: inherit

0 commit comments

Comments
 (0)