Skip to content

fix(trace): keep SSH key fingerprints in redacted sessions - #3712

Open
migmartri wants to merge 2 commits into
chainloop-dev:mainfrom
migmartri:fix/trace-redact-ssh-key-fingerprints
Open

migmartri wants to merge 2 commits into
chainloop-dev:mainfrom
migmartri:fix/trace-redact-ssh-key-fingerprints

Conversation

@migmartri

Copy link
Copy Markdown
Member

Chainloop Trace redacted the SHA256 fingerprint that git prints when it checks an SSH commit signature, for example in the output of git log --show-signature. The betterleaks generic-api-key rule matches it, so the session showed a redaction placeholder and the ai-config-no-secrets policy reported a secret. A fingerprint is a hash of a public key, not a credential.

This adds an allowlist to the redaction ruleset for an OpenSSH SHA256 fingerprint: SHA256: followed by exactly 43 base64 characters at the end of the match. A longer value after the same prefix, and other secrets in the same text, are still redacted.

AI disclosure: this change was produced with assistance from Claude Code.

The generic-api-key rule matched the SHA256 fingerprint that git prints
when it checks an SSH commit signature, for example the output of
git log --show-signature. A fingerprint is a hash of a public key, not a
credential, so the redaction replaced it and the no-secrets policy
reported a false positive.

Add an allowlist for an OpenSSH SHA256 fingerprint: SHA256: and exactly
43 base64 characters at the end of the match. A longer value after the
same prefix is still redacted.

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 34d67f3d-296c-4dce-b668-3a73637e6a43
@chainloop-platform

chainloop-platform Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ⚠️ 2 failing

Status Policy Material Messages
⚠️ Failed pr-min-approvals pr-info PR/MR #3712 has 0 approving reviews, 1 required.
✅ Passed pr-description-required pr-info -
⚠️ Failed pr-user-story-linked pr-info PR/MR #3712 does not reference a user story or issue in title, description, or branch 'fix(trace): keep SSH key fingerprints in redacted sessions'. Expected patterns: ["(?i)[A-Z]+-[0-9]+", "#[0-9]+", "(?i)gh-[0-9]+", "(?i)\\[[A-Z]+-[0-9]+\\]"]

View attestation ↗

AI Session Checks — 🟢 87% · ⚠️ 1 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 87% 1 ⚠️ 1 100% AI / 0% Human 2 +50 / -0 31m34s

🟢 87% — 100% AI — ⚠️ 1 policies failing

Oct 24, 2026 12:56 UTC · 31m34s · $20.48 · 620 in / 240.6k out · claude-code 2.1.310 (claude-opus-5-5)

View session details ↗

Change Summary

  • Adds an OpenSSH fingerprint allowlist to internal/redaction/betterleaks.toml.
  • Extends internal/redaction/precision_test.go with kept-fingerprint and still-redacted guard cases.
  • Re-runs the redaction package and an AI-session consumer package after the fix.

AI Session Overall Score

🟢 87% — Focused redaction fix with strong tests, but no explicit user confirmation.

AI Session Analysis Breakdown

🟢 96% · scope-discipline

🟢 AI split the false-positive fix from the earlier SEC-634 work. · High Impact

🟢 92% · alignment

No notes.

🟢 91% · solution-quality

🟢 The allowlist targets exact OpenSSH fingerprint shape instead of a broad bypass. · High Impact

🟢 86% · user-trust-signal

No notes.

🟢 84% · context-and-planning

No notes.

🟡 76% · verification

🟢 AI ran failing tests first, then reran redaction and consumer packages successfully. · High Impact

🟠 Tests passed in-session, but the user never explicitly confirmed the final redaction behavior. · Medium Severity

💡 When the user is present, ask for a quick confirm after the last passing run.


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
modified ai internal/redaction/precision_test.go +39 / -0
modified ai internal/redaction/betterleaks.toml +11 / -0

Policies (4, 1 failing)

Status Policy Material Messages
✅ Passed ai-config-ai-agents-allowed ai-coding-session-34d67f -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-34d67f -
⚠️ Failed ai-config-no-secrets ai-coding-session-34d67f
  • Secret (generic-api-key) detected in session content [turn=1003, source=tool_result, line=59]: | ⚠️ Failed | ai-config-no-secrets | [ai-coding-session-34d67f](https://app.chainloop.dev/u/chainloop/projects/chainloop/versi...
  • Secret (generic-api-key) detected in session content [turn=1049, source=user-message, line=1]: see Secret (generic-api-key) detected in session content [turn=927, source=tool_result, line=2]: Good "git" signature for miguel@chainloop.dev with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic...
  • Secret (generic-api-key) detected in session content [turn=1075, source=assistant-text, line=10]: Good "git" signature for miguel@chainloop.dev with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]
  • Secret (generic-api-key) detected in session content [turn=1173, source=tool_result, line=31]: "password: [CHAINLOOP_TRACE_REDACTED:generic-password]\napi_key: [CHAINLOOP_TRACE_REDACTED:generic-api-key]\n",
  • Secret (generic-api-key) detected in session content [turn=1224, source=tool_result, line=11]: actual : "Good \"git\" signature for sarah@chainloop.local with RSA key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1224, source=tool_result, line=16]: Error: "Good \"git\" signature with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\napi_key: [CHAINLOOP_TRACE_REDACTED:generic-api-key]\n" does not contain "SHA256:q3Rk8vLm2+Zx7Pw...
  • Secret (generic-api-key) detected in session content [turn=1224, source=tool_result, line=5]: actual : "Good \"git\" signature for sarah@chainloop.local with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1308, source=tool_result, line=11]: DEF: "with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1308, source=tool_result, line=5]: DEF: "key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1308, source=tool_result, line=6]: OUR: "key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1308, source=tool_result, line=8]: DEF: "with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=1308, source=tool_result, line=9]: OUR: "with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]\n"
  • Secret (generic-api-key) detected in session content [turn=927, source=tool_result, line=2]: Good "git" signature for miguel@chainloop.dev with ED25519 key SHA256:[CHAINLOOP_TRACE_REDACTED:generic-api-key]
  • Secret (generic-password) detected in session content [turn=1109, source=tool_result, line=105]: text: text: "host: localhost\\nuser: admin\\npassword: [CHAINLOOP_TRACE_REDACTED:generic-password]\\nport: 5432\\n", + "\n",
  • Secret (generic-password) detected in session content [turn=1124, source=tool_result, line=1]: text: text: "host: localhost\\nuser: admin\\npassword: [CHAINLOOP_TRACE_REDACTED:generic-password]\\nport: 5432\\n", + "\n",
  • Secret (generic-password) detected in session content [turn=1124, source=tool_result, line=64]: text := "const AUTH0 = {\n email: 'input[name=\"login\"]',\n password: '[CHAINLOOP_TRACE_REDACTED:generic-password]',\n};\n"
  • Secret (generic-password) detected in session content [turn=1173, source=tool_result, line=30]: "| ai-config-no-secrets | fail | Secret (generic-password) detected [CHAINLOOP_TRACE_REDACTED:generic-password] |\n",
  • Secret (generic-password) detected in session content [turn=1173, source=tool_result, line=31]: "password: [CHAINLOOP_TRACE_REDACTED:generic-password]\napi_key: [CHAINLOOP_TRACE_REDACTED:generic-api-key]\n",
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-34d67f -

Security Checks — ✅ 5 passing

✅ secret-scan

Status Policy Messages
✅ Passed secrets-detection -

✅ sast-scan

Status Policy Messages
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -
✅ Passed cwe-top26-40-cusp -
Scans not applied (3)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC files changed

View attestation ↗

Security context

✅ Nothing this change touches has a recorded security-fix history.

View in Chainloop ↗ · How this works ↗


Powered by Chainloop and Chainloop Trace

@migmartri
migmartri requested a review from a team October 24, 2026 13:24

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread internal/redaction/betterleaks.toml Outdated
A key that went on after the 43 fingerprint characters with a - . or _
was kept, because any non-base64 character counted as the end. Only the
terminator the generic-api-key rule adds to its match can now follow.

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 34d67f3d-296c-4dce-b668-3a73637e6a43
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