Skip to content

Commit d42e136

Browse files
committed
feat(ci): add gitleaks PR-gating + base allowlist (Phase 0.B1-fleet)
Adds a Secret Scan workflow that runs gitleaks against every PR and push to default branch. Mirrors the canonical pattern in BfxLendingBot, BfxPingPongBot, and the Wave-1 repos (BotEventAggregator, Knowledge-Hub, DigiConta, blazor-shared, infra-iac). This is Wave 2 of the Phase 0.B1-fleet rollout — the 6 repos that didn't yet have a `gitleaks.toml`. CI-style scan (`--log-opts="--no-merges -1"`) on current HEAD reports `no leaks found` against gitleaks default rules, so the toml ships as a minimal scaffold (extend `paths` / add `regexes` if findings surface). Phase 0 of the Restart-2026-04 master plan requires zero secret-leak findings across all fleet repos before the bot fleet restarts on Opus 4.7. Pre-PR gating catches hardcoded secrets before they merge to master/main. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 1e619db commit d42e136

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/secret-scan.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Secret Scan
2+
3+
# Mirrors the BfxLendingBot / BfxPingPongBot pattern:
4+
# Gitleaks PR-gating runs on every PR + every push to default branch
5+
# to catch hardcoded secrets before merge. Uses repo-local gitleaks.toml
6+
# for allowlist (extends gitleaks default rules with paths/regexes for
7+
# this repo's known false positives).
8+
#
9+
# Phase 0.B1-fleet rollout (Restart-2026-04 master plan).
10+
11+
on:
12+
push:
13+
branches: [master, main]
14+
pull_request:
15+
branches: [master, main]
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: secret-scan-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
gitleaks:
27+
name: Secret Scan
28+
runs-on: [self-hosted, Linux, Build]
29+
timeout-minutes: 5
30+
permissions:
31+
contents: read
32+
steps:
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
35+
- name: Gitleaks — secret scanning
36+
run: |
37+
GITLEAKS_VERSION=$(curl -s https://api.github.com/repos/gitleaks/gitleaks/releases/latest | grep tag_name | cut -d '"' -f4 | sed 's/^v//')
38+
mkdir -p "$HOME/.local/bin"
39+
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | tar xz -C "$HOME/.local/bin" gitleaks
40+
"$HOME/.local/bin/gitleaks" detect --source . --config gitleaks.toml --log-opts="--no-merges -1" --verbose --redact --no-banner

gitleaks.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# =============================================================================
2+
# Gitleaks Configuration
3+
# =============================================================================
4+
# Mirrors the BfxLendingBot pattern: useDefault rules + minimal path
5+
# allowlist. Currently no false positives on this repo's working tree;
6+
# extend `paths` or add `regexes` here if findings surface in CI.
7+
# =============================================================================
8+
9+
[extend]
10+
useDefault = true
11+
12+
[allowlist]
13+
description = "Global allowlist"
14+
paths = [
15+
# Standard ignores
16+
'''\.gitleaksignore''',
17+
'''\.env\.example''',
18+
'''\.env\.local''',
19+
]
20+
regexTarget = "line"

0 commit comments

Comments
 (0)