Glossary · Scanning and analysis

SARIF (Static Analysis Results Interchange Format)

SARIF, the Static Analysis Results Interchange Format, is an OASIS-standard JSON format for the output of static analysis tools: which rules ran, what they found, and where in the code each result is.

Before SARIF, every analyzer had its own report format, and every consumer needed a parser per tool. SARIF version 2.1.0, standardized by OASIS, defines one shape. A SARIF log contains one or more runs; each run names the tool and the rules it applied, and lists results. A result references a rule, carries a level (error, warning, note), a message, and one or more locations: a file URI and a region of lines and columns. Optional fields describe code flows (the path a tainted value takes), fixes, suppressions and fingerprints that let a consumer recognize the same result across runs.

How it is used in practice

SARIF is the common currency of code-scanning integrations. SAST tools, IaC scanners, linters and some dependency scanners can emit it, and code hosts and CI systems ingest it to show findings inline on a pull request or in a security dashboard. Teams also use it to aggregate results from many tools into one store, compare runs, and track whether a result is new, unchanged or fixed.

Common pitfalls

  • Unstable fingerprints. If a tool's fingerprint depends on line numbers, adding a line above a finding makes it look new, and its triage history is lost.
  • Path mismatches. Locations relative to a different checkout root than the consumer expects do not resolve to files.
  • Lossy conversion. Dependency findings do not map naturally onto file-and-line locations; forcing them into SARIF often drops package and version data.
  • Severity drift. Tools set level differently; a "warning" in one tool may be a critical issue in another.
  • Size. Large repositories can produce SARIF files that exceed a consumer's upload limits.

How TrustIvan relates to it

TrustIvan exports a scan's findings as a SARIF 2.1.0 log, from the API or a GitHub Actions job, for upload to GitHub code scanning; findings from a repository scan then annotate the changed lines of a pull request, with each rule's fix guidance carried as its help. No TrustIvan integration is installed on the code host: the upload is the code host's own step. A log holds at most 5,000 results, dropping the least severe and marking itself truncated. Suppressed and resolved findings are left out, so suppressing a finding in TrustIvan closes its alert on the next upload. Paths from an image scan are paths inside the image and annotate nothing. It is export only: TrustIvan does not import SARIF from another tool. The log's structure is validated against the OASIS schema in TrustIvan's test suite; an upload to GitHub is not part of that suite. See Findings on pull requests with SARIF.

Related terms

Guides on SARIF

All glossary terms

See TrustIvan on your own estate.

Book thirty minutes with an engineer and bring an image, a repository or a cloud account, or start free on the hosted service.