Repository navigation
fix(security): gitleaks: allowlist the kagent-tools redaction-test fixture by file and line shape - #53
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
krateo-agentiko/kagent-tools can't merge any PR: the org ruleset
require-security-pipelinerequiressecurity / filesystem, and its gitleaks step findsgeneric-api-keyatinternal/mcp/mcp_test.go:281in 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
.gitleaksignorefingerprint is the wrong tool, as this workflow's own guidance says (#32).Change
One
[[allowlists]]entry withcondition = "AND": the path(^|/)internal/mcp/mcp_test\.go$and the exact line shapeconst secret = "eyJ<17>.<11>.<3>". Nothing else in the config changes.Tested (gitleaks 8.30.1, config extracted from this edited workflow)
const secretin another file in the same directory;const secretin another directory.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