Skip to content

feat: shared gitleaks + privacy-scan (CI reusables + pre-commit hook)#13

Merged
roleme merged 1 commit into
mainfrom
feat/security-scans
Jun 25, 2026
Merged

feat: shared gitleaks + privacy-scan (CI reusables + pre-commit hook)#13
roleme merged 1 commit into
mainfrom
feat/security-scans

Conversation

@roleme

@roleme roleme commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What & why

Automate the secret/privacy scanning that was previously done by hand, and centralize it so every repo shares one rule set.

New

  • gitleaks-reusable.yml — secret scan over full history (workflow_call), lifted from docker_infra's local gitleaks.yml.
  • scripts/privacy-scan.sh — fails if tracked files contain private-infrastructure markers (private IP ranges, .local hosts, host paths like /home/* /volume* /etc/komodo/, key/secret markers). Built-in patterns are generic and safe for this public repo.
  • privacy-scan-reusable.yml — runs the script. Callers pass their own private hostnames via the extra-patterns input → EXTRA_PATTERNS env, so secret-ish values live only in the private caller, never here. The script is checked out from this repo at job.workflow_sha (untamperable by the caller's tree).
  • .pre-commit-hooks.yaml — exposes the same script as a pre-commit hook, so local hook and CI enforce identical rules.

Design note

privacy-scan.sh is the single source of truth, shared by CI and the local pre-commit hook. Private hostnames are never hardcoded in this public repo — they flow in via EXTRA_PATTERNS.

Validation

  • shellcheck clean; zizmor no findings; privacy-scan clean on this repo; all YAML parses.

Follow-ups

  • Wire these into docker_infra (replace local gitleaks.yml), bots, training_tracker.
  • Add .pre-commit-config.yaml referencing this hook where wanted.

🤖 Generated with Claude Code

Centralize the secret/privacy scanning so all repos share one source of truth
instead of agent-driven manual review:

- gitleaks-reusable.yml: secret scan over full history (workflow_call),
  lifted from docker_infra's local gitleaks.yml.
- privacy-scan-reusable.yml + scripts/privacy-scan.sh: fail if tracked files
  contain private-infrastructure markers (private IPs, .local hosts, host
  paths, key/secret markers). Built-in patterns are GENERIC (safe for this
  public repo); callers pass their own private hostnames via the extra-patterns
  input / EXTRA_PATTERNS env, so secret-ish values stay in the private caller.
  The reusable checks out the script from this repo at job.workflow_sha so the
  rules cannot be tampered with by the calling repo's tree.
- .pre-commit-hooks.yaml: exposes the same script as a pre-commit hook, so the
  local hook and CI enforce identical rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@roleme roleme merged commit 2843cba into main Jun 25, 2026
1 check passed
@roleme roleme deleted the feat/security-scans branch June 25, 2026 16:41
@roleme roleme mentioned this pull request Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant