SARIF viewer
Open a SARIF 2.1.0 file from CodeQL, Semgrep, Trivy or any other scanner and read its results by level, with rule, message, file and line, in your browser.
The file is read in your browser. It is not uploaded.
Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.
How to use the SARIF viewer
- Drop a .sarif or .json file on the page, or paste its contents.
- Read the totals and the count per tool and level.
- Go through the results, errors first; pick a level to narrow the list.
About this tool
SARIF, the Static Analysis Results Interchange Format, is an OASIS standard for the output of code scanners. One JSON file holds one or more runs. Each run names the tool that produced it, the rules it knows, and a list of results: which rule fired, a message, and where. CodeQL, Semgrep, Trivy, ESLint and many others can write it, and GitHub code scanning takes it as upload.
The file is built for machines. This viewer turns it into a table sorted by level, errors first, with the rule, the message, the file and the line of each result, and a count of results per tool and level. Message placeholders are filled in from the result’s arguments. You can show one level at a time.
A result’s level is not always written on the result. The standard says to take it from the result, then from the default configuration of its rule, and to use “warning” when neither is given; a result whose kind is not “fail” has the level “none”. The viewer follows that order. Keep in mind that the level is the tool’s rating of the rule, not a severity score.
Sources
Questions
A JSON document in which a static analysis tool reports what it found: the tool, its rules, and for each result a message and a location. SARIF 2.1.0 is the version in use; it was approved as an OASIS standard in 2020.
They are the tool’s own rating of a result. Error is a serious problem, warning a problem, note an observation. None is used for results that are not failures, such as a rule that passed or a result that is informational.
Most scanners have an output option, for example --sarif in Semgrep, --format sarif in Trivy and ESLint’s SARIF formatter. CodeQL writes SARIF by default. In GitHub Actions the file is usually handed to the upload-sarif action.
No. It is read in your browser and nothing is uploaded. SARIF files quote your source paths and sometimes code, so that is how it should be.