Skip to content

feat: SARIF 2.1.0 output format #417

@sonukapoor

Description

@sonukapoor

SARIF (Static Analysis Results Interchange Format) is the standard output format for security tools integrating with GitHub Advanced Security, Azure DevOps, and most CI security dashboards.

CVE Lite CLI already supports --json for machine-readable output and --report for HTML. SARIF would complete the CI integration story by letting findings appear as code-scanning alerts in GitHub.

Scope:

  • Add --sarif flag that writes a SARIF 2.1.0 JSON file
  • Follow the html-reporter.ts pattern: new file src/output/sarif-reporter.ts, no logic in index.ts
  • Map findings to SARIF result objects with severity, package name, CVE ID, and a fix hint in the message
  • Output to stdout or a file path passed via --sarif <path>
  • Suppress terminal output when --sarif is used (same behaviour as --json)
  • Add tests in tests/sarif-reporter.test.ts

Reference: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions