Skip to content

fix(secret-scanner): stage the estate baseline only for repos without a local config - #1297

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/new-session-th4e9w-gitleaks-stage
Oct 19, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
claude/new-session-th4e9w-gitleaks-stage

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Gates the "Fetch estate gitleaks baseline" and "Stage estate gitleaks baseline" steps on hashFiles('.gitleaks.toml') == '', and updates the comment above them to match.

Why

These steps copied .gitleaks-estate.toml into every caller's workspace. A repo with its own .gitleaks.toml scans with that config. If that config does not [extend] the baseline, the staged file sits in the scanned tree. Nothing allowlists the fixture values its own comments quote, so the gate reports the estate file as the caller's leak.

This surfaced on hyperpolymath/echidnabot#185 as soon as its lock repair let the reusable start: three generic-api-key findings in .gitleaks-estate.toml, at lines 84 and 85.

Behaviour by consumer

Consumer Before After
No .gitleaks.toml (most of the estate) baseline staged, used as CONFIG unchanged
.gitleaks.toml that [extend]s the baseline staged twice (ungated and gated steps) staged once, by the existing gated block
.gitleaks.toml that does not extend it staged, then scanned as a finding not staged

Every later reference to .gitleaks-estate.toml (the working-tree pass, the git-history pass and the AsciiDoc mirror) uses it only when no .gitleaks.toml exists, so no pass is left naming a missing file.

Validation

actionlint reports only the two existing job.workflow_sha lines, which are unchanged from main. That field is newer than the local actionlint.


Generated by Claude Code

… a local config

The ungated "Fetch/Stage estate gitleaks baseline" steps copied
.gitleaks-estate.toml into every caller's workspace. A repo with its own
.gitleaks.toml scans with that config; if it does not [extend] the baseline,
the staged file sits in the scanned tree with no allowlist for the fixture
values its comments quote, and the gate reports the estate file as the
caller's leak (echidnabot#185: three generic-api-key findings, lines 84-85).

Gate both steps on hashFiles('.gitleaks.toml') == ''. Repos without a local
config are unchanged (CONFIG still resolves to the staged baseline); repos
that [extend] it are still staged by the existing gated block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 46ebdde0-fd59-4b42-8471-deb4bbfc9063
📥 Commits

Reviewing files that changed from the base of the PR and between 8be8ffa and d5993e3.

📒 Files selected for processing: 1
  • .github/workflows/secret-scanner-reusable.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit d5993e3a522d · run 39273566717

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 ↔ unchanged
K9 validator self-test 🟢 conformant 34 0 0 0 ↔ unchanged
K9 positive/negative controls 🟢 conformant 27 0 0 0 ↔ unchanged
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 19, 2026 12:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T14:59:51.580511Z d5993e3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff272158cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/secret-scanner-reusable.yml
claude and others added 2 commits October 19, 2026 13:02
TOML literal strings are single-quoted, and gitleaks reads extend.path as a
plain string, so `path = '.gitleaks-estate.toml'` is a valid reference. The
detection matched only the double-quoted spelling. With the ungated staging
now skipped for repos that have a .gitleaks.toml, such a repo would have
scanned with an [extend] pointing at a file nothing staged. Accept either
quote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 14:56
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 14:57
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 14:57
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 3e269c2 into main Oct 19, 2026
65 of 67 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-th4e9w-gitleaks-stage branch October 19, 2026 14:57

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5993e3a52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

set -euo pipefail
if [ -f .gitleaks.toml ] && \
grep -qE '^[[:space:]]*path[[:space:]]*=[[:space:]]*"\.gitleaks-estate\.toml"' .gitleaks.toml; then
grep -qE "^[[:space:]]*path[[:space:]]*=[[:space:]]*[\"']\.gitleaks-estate\.toml[\"']" .gitleaks.toml; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recognize dotted extend keys before skipping the baseline

Although the single-quoted variant is now handled, valid TOML can also express this setting as extend.path = ".gitleaks-estate.toml"; Gitleaks decodes that as the same nested extend.path, but this regex does not match it. For a repository using that form, both newly gated initial staging steps are skipped because .gitleaks.toml exists, this step reports referenced=false, and each scan fails while loading the absent extended file. Parse the TOML or recognize the dotted-key form before suppressing baseline staging.

Useful? React with 👍 / 👎.

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.

2 participants