Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

chore(ci): gitleaks secret scan in CI and a local pre-commit hook (TOM-1257) - #108

Merged
tomlupo merged 3 commits into
mainfrom
chore/tom-1257-public-safety
Sep 29, 2026
Merged

tomlupo merged 3 commits into
mainfrom
chore/tom-1257-public-safety

Conversation

@qute-coder

@qute-coder qute-coder Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related to TOM-1257 (qute-code-kit half; qute-plugins gets its own PR).

What

This repo is public and nothing checked that a commit carries no secret or private infra detail.

  • .gitleaks.toml: gitleaks default rules, plus tailnet-ip (100.64.0.0/10 only, i.e. 100.64–100.127) and prod-home-path (/home/prod/). No client/project names — a committed denylist would publish them.
    • prod-home-path captures home/prod/ without its leading slash on purpose: the default config's global allowlist drops any secret matching ^/(?:bin|etc|home|opt|tmp|usr|var)/…, so the naive rule never fires (verified).
  • .gitleaksignore: the four findings already in public history, one exact commit:file:rule:line fingerprint each — a Firecrawl key (commit 326a712), one tailnet IP on two lines (3de3320), one /home/prod/ prose line (6e07357). No path- or rule-wide allow. History is not rewritten.
  • ci.yml job secret-scan: gitleaks v8.30.1 linux x64, sha256 551f6fc8…70eb pinned from the official gitleaks_8.30.1_checksums.txt, set -euo pipefail, curl -f. pull_request scans only base.sha..head.sha; push to main scans full history. contents: read, no persisted credentials.
  • .pre-commit-config.yaml: one repo: local hook, gitleaks git --pre-commit --staged --redact; a missing binary FAILS with an install hint. README carries the one-line setup.

Before merge (human)

  • Revoke the Firecrawl key at Firecrawl. Not needed: it is a free-tier key, accepted rather than revoked by decision (Tom, 2026-09-29, TOM-1257). The .gitleaksignore comment says so.

Proof (forge, gitleaks 8.30.1, all --redact)

  • Full history (484 commits) with config + ignore: no leaks found, exit 0.
  • Same scan with .gitleaksignore moved away: leaks found: 4, exit 1 — exactly the four ignored fingerprints, nothing else.
  • Throwaway branch (never pushed, deleted): planted a fake AKIA… key (random 16 chars), 100.96.1.2 and 100.200.1.1. Hook on the staged file: Failed, exit 1. CI-style range scan of that commit: aws-access-token line 1, tailnet-ip line 2, nothing for line 3 (100.200.1.1); 100.63.x/100.128.x also not flagged.
  • Removed: hook on a clean staged change Passed; scan of the removal commit no leaks found.
  • Hook with gitleaks not on PATH: Failed, gitleaks not found: install it (…) or this commit cannot be checked for secrets.
  • Existing reporting-contract tests run locally: 28 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Q48fmG4d2ZB2DJP3B4o2x

Review provenance

The in-session review axes, and the commit each one actually read. A verdict against a branch NAME has no referent — the name moves. Check freshness with qute_review_freshness.py <owner/repo> <pr#>; it exits 1 when an axis is stale and 2 when it cannot tell.

  • standards — verdict SHIP, reviewed at 2ef732ebb18b3e6be967d41a66c6f281bbbd4c7c, range main...HEAD, at 2026-09-28T18:34:35+02:00

tomlupo and others added 2 commits September 28, 2026 18:29
…M-1257)

The repo is public, so nothing checked that a commit carries no secret or
private infra detail. Adds:

- .gitleaks.toml: default rules plus tailnet/CGNAT IPv4 (100.64.0.0/10)
  and the /home/prod/ path. The path rule captures "home/prod/" without its
  leading slash, because the default global allowlist drops any secret
  shaped like ^/home/... and the rule would otherwise never fire.
- .gitleaksignore: the four findings already in public history, one exact
  fingerprint each (a revoked Firecrawl key, a tailnet IP on two lines, a
  prod path in prose). No path- or rule-wide allow.
- ci.yml secret-scan job: gitleaks v8.30.1, sha256 pinned from the official
  checksums file; PR commits on pull_request, full history on push to main.
- .pre-commit-config.yaml: staged-changes scan; a missing binary fails with
  an install hint instead of passing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q48fmG4d2ZB2DJP3B4o2x
…(TOM-1257)

Review round 1: the tailnet rule consumed the character after an address,
and since matches never overlap, a second address separated by one
character was missed. Use \b boundaries instead. The secret-scan job now
runs with contents: read and no persisted credentials, and makes a single
gitleaks call. Setup hint lives in the README only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Q48fmG4d2ZB2DJP3B4o2x
@qute-coder
qute-coder Bot requested a review from tomlupo September 28, 2026 16:34
@what-the-diff

what-the-diff Bot commented Sep 28, 2026

Copy link
Copy Markdown

PR Summary

  • Introduction of a New CI Job for Secret Scanning
    We have added a new continuous integration job in our workflow that uses a tool called gitleaks to scan for hidden information or "secrets". This increases security by identifying any potentially sensitive information before it gets published.

  • Introduction of a New Configuration File .gitleaks.toml
    A new configuration file was introduced to set specific rules for the secret scanning task. This includes certain rules for identifying specific types of sensitive information.

  • Establishment of a New Ignore File .gitleaksignore
    We've created a new file that will "ignore" or dismiss certain findings that are already in the public history. This helps to prevent repetition and over-exposure of already known sensitive data.

  • Addition of a .pre-commit Configuration File
    We've added a file that helps set up secret scanning locally before any changes are committed to the codebase. This is a proactive measure that helps to ensure no secret information is accidentally included in the project code.

  • Update to the README.md File
    A series of instructions were added on how to install and use the tools for secret scanning. This emphasizes the importance of scanning for sensitive information before any code or changes are made public.

@qute-release qute-release Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[session: tom-1257-public-safety · 7d8bfa61 · https://claude.ai/code/session_015Q48fmG4d2ZB2DJP3B4o2x] codex (headless):

Reviewed commit 2ef732ebb18b3e6be967d41a66c6f281bbbd4c7c. No verified blocking defects across the six review lenses.

Gitleaks 8.30.1 passed the full-history scan. Synthetic probes confirmed adjacent addresses and production paths are detected, PR ranges catch leaks, and a missing binary fails the hook. Pre-commit configuration validation passed.

Network restrictions prevented independent verification of the release checksum.

VERDICT: SHIP

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016XFtDJbpgD12enJgui1yar
@tomlupo
tomlupo merged commit d235bf2 into main Sep 29, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant