feat(materials): add TruffleHog and Cobertura material types#3285
Merged
javirln merged 1 commit intoJul 14, 2026
Merged
Conversation
Contributor
AI Session AnalysisMissing AI Coding SessionsWe detected commits in this PR that were AI-assisted, but the matching Chainloop Trace session(s) could not be found in Chainloop. Please make sure the AI coding session evidence has been sent by the Chainloop CLI, or add the Learn more about Chainloop Trace. Powered by Chainloop and Chainloop Trace |
There was a problem hiding this comment.
1 issue found across 38 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="pkg/attestation/crafter/materials/trufflehog.go">
<violation number="1" location="pkg/attestation/crafter/materials/trufflehog.go:56">
P1: A report beginning with `[]` can hide appended findings because the array parser ignores remaining bytes. The crafter then accepts and attests it as zero findings, so policy evaluation misses those findings; have `Parse` reject non-whitespace content after the array.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
matiasinsaurralde
previously approved these changes
Jul 14, 2026
Add native support for two evidence material types so they can be attested and policy-evaluated: - TRUFFLEHOG_JSON: TruffleHog secret-scan output (JSONL), projected to policy input as findings so secret-detection policies can evaluate it. A clean scan (no secrets, zero-byte output) is crafted as a canonical empty report so a passing scan stays attestable and projects to an empty findings list. - COBERTURA_XML: Cobertura code-coverage reports, projected to policy input. A non-finite line-rate (an empty report's 0/0) is serialized as null so an empty report stays evaluable and remains distinguishable from genuine 0% coverage. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: 1abd9936-0822-465f-ac3b-2694450852b7 Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
b965a78 to
8ca737a
Compare
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.
What
Add two native material types to the attestation crafter so their evidence can be attested and policy-evaluated:
TRUFFLEHOG_JSON— TruffleHog secret-scan output (JSONL). Projected to policy input as a findings list so secret-detection policies can evaluate it. A clean scan (no secrets, zero-byte output) is crafted as a canonical empty report, so a passing scan stays attestable and projects to an empty findings list.COBERTURA_XML— Cobertura code-coverage reports. Projected to policy input; a non-finite line-rate (an empty report's0/0) is serialized asnullso an empty report stays evaluable and remains distinguishable from genuine 0% coverage.Both follow the existing crafter pattern: proto enum, crafter and parser, dispatch in
Craft, policy-input projection iningestMaterialToJSON, and auto-detection ordering (Cobertura only; TruffleHog is intentionally excluded from auto-detection since JSONL validation is weak).AI disclosure
AI assisted in producing this contribution (Claude Code). Each commit carries an
Assisted-by: Claude Codetrailer.