Skip to content

Add SARIF format reporting for CI/CD integration #599

Description

@hellonico

Summary

This PR introduces support for the SARIF (Static Analysis Results Interchange Format) output format.

By adding the --output sarif flag (or sarif to the .xeol.yaml config), users can now seamlessly integrate Xeol's End-of-Life dependency findings directly into modern CI/CD security dashboards, such as GitHub Advanced Security (GHAS) or GitLab Security.

Changes Made

  • Added a new sarifFormat to the internal format parsers and presenter options.
  • Implemented a new sarif.Presenter utilizing the github.com/owenrumney/go-sarif library to ensure strict compliance with the SARIF v2.1.0 specification.
  • Mapped Xeol's internal match.Match objects into standardized SARIF Rules and Results.
  • Properly mapped Syft-discovered file coordinates (Locations) so that EOL findings highlight the exact file paths in the user's IDE or PR diffs.

How to Test

  1. Build the binary from this branch.
  2. Run a scan against a local directory or image with the SARIF output flag:
    xeol dir:. -o sarif > xeol-results.sarif
  3. Verify the xeol-results.sarif file is generated properly.
  4. (Optional) Upload the generated file to a SARIF viewer (like the VS Code extension) to verify that the physical locations correctly map to the repository files.

Related Issues

(Link any related issue here, e.g., "Closes #123")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions