Skip to content

Conversation

@migmartri
Copy link
Member

Summary

Extract and expose tool metadata from GitLab Security Reports using scanner field with fallback to analyzer. This enables consistent tool tracking across all material types (SARIF, SBOM, GitLab reports).

Changes

  • Modified gitlab.go to extract tool information from scan.scanner (actual security tool) with fallback to scan.analyzer (wrapper/integration layer)
  • Added injectAnnotations method that populates standard annotations: chainloop.material.tool.name and chainloop.material.tool.version
  • Enhanced tests with annotation assertions for all GitLab report types (SAST, container scanning, secret detection, SonarQube)
  • Added SonarQube test data file

Examples

  • Container Scanning: Trivy v0.19.2 (not GitLab Container Scanning wrapper)
  • Secret Detection: Gitleaks (not secrets analyzer)
  • SonarQube: Sonar v11.2.0.2797 (scanner engine)
  • SAST: Semgrep (same in scanner and analyzer)

Resolves #2478

Extract and expose tool metadata from GitLab Security Reports using scanner
field with fallback to analyzer. This enables consistent tool tracking across
all material types (SARIF, SBOM, GitLab reports).

Implementation uses scanner (actual security tool) as primary source and falls
back to analyzer (wrapper) if scanner info is unavailable. Populates standard
annotations: chainloop.material.tool.name and chainloop.material.tool.version.

Resolves chainloop-dev#2478

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@javirln javirln merged commit 5b5b5ae into chainloop-dev:main Oct 24, 2025
13 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.

expose tool annotation for sast scans generated as GITLAB_SECURITY_REPORT

2 participants