Skip to content

feat(materials): record checkmarx engine types from SARIF via scan.types annotation#3296

Merged
migmartri merged 2 commits into
chainloop-dev:mainfrom
javirln:javier/com-373-recognize-checkmarx-sarif-in-scan-present-via-a-crafter
Jul 17, 2026
Merged

feat(materials): record checkmarx engine types from SARIF via scan.types annotation#3296
migmartri merged 2 commits into
chainloop-dev:mainfrom
javirln:javier/com-373-recognize-checkmarx-sarif-in-scan-present-via-a-crafter

Conversation

@javirln

@javirln javirln commented Jul 17, 2026

Copy link
Copy Markdown
Member

Enriches the SARIF crafter so a Checkmarx One SARIF report advertises the engines that produced its findings through the shared chainloop.material.scan.types annotation, mirroring the native CHECKMARX_JSON crafter (COM-372).

Checkmarx One bundles every engine (sast, sca, kics, containers, sscs) under a single driver, so the driver name alone cannot tell attestation-level policies which analyses actually ran. The engine type is recovered from the (engine) suffix ast-cli appends to every SARIF rule id, gated on Checkmarx detection (driver name or the checkmarx rule tag), and normalized onto the canonical scan-type vocabulary using the same map the native crafter uses (kics→iac, containers→container, sscs→supply-chain). Engines that cannot be classified are dropped, so recognition fails closed and never over-claims for other tools.

A Checkmarx SARIF and the equivalent native JSON report now yield the identical scan.types value, so the *-scan-present compliance policies can key on it uniformly regardless of material type once the compliance-manifests side ships.

This contribution was assisted by Claude Code.

Review in cubic

…pes annotation

Enrich the SARIF crafter so a Checkmarx One report emits the shared
chainloop.material.scan.types annotation, mirroring the native
CHECKMARX_JSON crafter. Engine types are read from the (engine) ruleId
suffix ast-cli appends to every rule, gated on Checkmarx detection, and
normalized onto the canonical scan-type vocabulary via the existing
checkmarxEngineToScanType map. Unrecognized engines are dropped so
recognition fails closed and never over-claims for other tools.

Assisted-by: Claude Code
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>

Chainloop-Trace-Sessions: a306a5c2-d7a3-4c8c-b021-584300a909fe
@chainloop-platform

Copy link
Copy Markdown
Contributor

AI Session Analysis

Missing AI Coding Sessions

We 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 skip-ai-session label to this PR to bypass this check.

Learn more about Chainloop Trace.


Powered by Chainloop and Chainloop Trace

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

Copy link
Copy Markdown

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 4 files

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

Re-trigger cubic

Comment thread pkg/attestation/crafter/materials/sarif.go Outdated
Comment thread pkg/attestation/crafter/materials/sarif.go Outdated
Address review feedback on the Checkmarx SARIF scan.types extraction:

- Read the engine from each finding's ruleId instead of the driver's rule
  catalog, so a report carrying rule metadata without matching findings no
  longer overstates scan.types. This keeps the annotation findings-based,
  consistent with the native CHECKMARX_JSON crafter.
- Detect and extract per run rather than gating on the whole document, so a
  multi-run SARIF that mixes a Checkmarx run with another tool's run no longer
  attributes the other tool's suffixed rule ids to Checkmarx.

Assisted-by: Claude Code
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>

Chainloop-Trace-Sessions: a306a5c2-d7a3-4c8c-b021-584300a909fe
@migmartri
migmartri merged commit 95917cc into chainloop-dev:main Jul 17, 2026
15 of 16 checks passed
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.

2 participants