Skip to content

fix(security): gitleaks: allowlist the kagent-tools redaction-test fixture by file and line shape - #53

Merged
braghettos merged 1 commit into
mainfrom
fix/gitleaks-kagent-tools-test-fixture
Nov 16, 2026
Merged

braghettos merged 1 commit into
mainfrom
fix/gitleaks-kagent-tools-test-fixture

Conversation

@braghettos

Copy link
Copy Markdown
Contributor

Why

krateo-agentiko/kagent-tools can't merge any PR: the org ruleset require-security-pipeline requires security / filesystem, and its gitleaks step finds generic-api-key at internal/mcp/mcp_test.go:281 in two commits (upstream 8fd3465 and our 7162d6d).

The value is a fake, JWT-shaped test constant. I added it in kagent-dev/tools#107 for the redaction test, which proves a tool error never puts a credential on a span. Because it's in upstream history, a repo .gitleaksignore fingerprint is the wrong tool, as this workflow's own guidance says (#32).

Change

One [[allowlists]] entry with condition = "AND": the path (^|/)internal/mcp/mcp_test\.go$ and the exact line shape const secret = "eyJ<17>.<11>.<3>". Nothing else in the config changes.

Tested (gitleaks 8.30.1, config extracted from this edited workflow)

  • Positive: krateo-agentiko/kagent-tools, full history: 2 findings → 0.
  • Negative controls (a throwaway repo, synthetic JWT-shaped value): all 3 of 3 still caught:
    • the same file with another const name;
    • const secret in another file in the same directory;
    • const secret in another directory.
  • Residual risk: a real token with exactly 17/11/3 segments on that one line of that one test file.

Follow-up

An upstream kagent-dev/tools PR replaces the literal with a value that is not token-shaped, so new history stops carrying it. Diego approved this PR and that one (2026-11-16).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TLFnUd6g7xhDXDvaho4rDW

…xture by file and line shape

kagent-dev/tools internal/mcp/mcp_test.go carries a fake JWT-shaped constant (upstream #107)
that is in upstream history and in krateo-agentiko/kagent-tools, so every PR there fails
the secret scan and a fingerprint cannot cover it. Allowlisted with condition AND on that
one path and that exact const line shape. Tested with gitleaks 8.30.1: both findings clear;
a JWT-shaped value under another const name in the file, or const secret in another file,
is still caught. The literal is being replaced upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLFnUd6g7xhDXDvaho4rDW
@braghettos
braghettos merged commit 2ce8f2e into main Nov 16, 2026
@braghettos
braghettos deleted the fix/gitleaks-kagent-tools-test-fixture branch November 16, 2026 09:50
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