Skip to content

Commit 0e44b51

Browse files
chore(ci): replace secret-scanner.yml with reusable wrapper (#19)
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 d8f3a18 commit 0e44b51

1 file changed

Lines changed: 7 additions & 55 deletions

File tree

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +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

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

0 commit comments

Comments
 (0)