feat: add CHECKMARX_JSON material type#3287
Conversation
Add support for ingesting Checkmarx One native JSON reports (ast-cli ScanResultsCollection produced by `cx --report-format json`) as a new CHECKMARX_JSON material type. The native format carries triage state, similarityId and query metadata that SARIF drops. The crafter validates the report structure (top-level scanID and results, plus per-result type and data) and injects the checkmarx tool annotation. The kind is omitted from auto-detection and must be referenced with an explicit --kind CHECKMARX_JSON. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: 23990771-b817-46fa-8543-353be0e9155a Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
AI Session Analysis
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| created | human | pkg/attestation/crafter/materials/testdata/checkmarx.json |
+299 / -0 |
| created | ai | pkg/attestation/crafter/materials/checkmarx_test.go |
+154 / -0 |
| created | ai | pkg/attestation/crafter/materials/checkmarx.go |
+129 / -0 |
| created | human | pkg/attestation/crafter/materials/testdata/checkmarx-clean.json |
+5 / -0 |
| created | human | pkg/attestation/crafter/materials/testdata/checkmarx-null-results.json |
+5 / -0 |
| modified | human | app/cli/documentation/cli-reference.mdx |
+2 / -2 |
| modified | ai | app/controlplane/api/workflowcontract/v1/crafting_schema_validations.go |
+4 / -0 |
| modified | ai | app/controlplane/api/workflowcontract/v1/crafting_schema.proto |
+3 / -0 |
| modified | ai | pkg/attestation/crafter/materials/materials.go |
+2 / -0 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-239907 |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-239907 |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-239907 |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-239907 |
- |
Powered by Chainloop and Chainloop Trace
Adds support for ingesting Checkmarx One native JSON reports (the ast-cli
ScanResultsCollectionproduced bycx ... --report-format json) as a newCHECKMARX_JSONmaterial type.Unlike the existing SARIF ingestion path, the native format preserves fields SARIF drops — the triage
state,similarityId, Checkmarx query metadata, and CVSS/CWE details — which lets policies act on already-triaged findings. A single report can bundle multiple engines (SAST, SCA, KICS, containers, secrets), distinguished per result bytype.The crafter validates the report structure (top-level
scanIDand aresultskey, plus atypeanddatapayload on each result) to reject look-alike JSON, accepts clean scans whereresultsis empty or null, and records the report verbatim for policy evaluation. The kind is omitted from auto-detection and must be referenced with an explicit--kind CHECKMARX_JSON.Assisted-by: Claude Code