> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/10.0/analyzing-source-code/importing-external-issues/importing-issues-from-sarif-reports.md).

# Importing issues from SARIF reports

SonarQube Server 10.0 supports the standard Static Analysis Results Interchange Format (SARIF) for raising external issues in code.

{% hint style="info" %}
**For AI agents:** You're in the SonarQube Server 10.0 documentation. For a list of all 10.0 pages, see the [SonarQube Server 10.0 page index](https://1407932334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5RUfx2eNg633cL6XgYzZ%2Fuploads%2FMKuy2QelfTxXM57mBiay%2Fsonarqube-server-10.0-llms.txt?alt=media). For the whole site, see the [page index](https://docs.sonarsource.com/llms.txt) or the [full text](https://docs.sonarsource.com/llms-full.txt). For another version, replace 10.0 in the URL with that version. The [latest version](https://docs.sonarsource.com/sonarqube-server/) has no version number in its URL.
{% endhint %}

SonarQube Server supports the standard [Static Analysis Results Interchange Format (SARIF)](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) for raising external issues in code. All issues raised in a SARIF report will be considered vulnerabilities in SonarQube Server.

The imported SARIF files must comply with the [official SARIF format, version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html).

## Import <a href="#import" id="import"></a>

The [Analysis parameters](/sonarqube-server/10.0/analyzing-source-code/analysis-parameters.md) `sonar.sarifReportPaths` accepts a comma-delimited list of paths to SARIF reports. The reports must be UTF-8 file encoded.

**Mandatory fields for SonarQube:**

* `version`: Must be "2.1.0"
* `runs[].tool.driver.name`: Name of the tool that created the report
* `runs[].results[].message.text`: Message of the external issue
* `runs[].results[].ruleId`: ID of the corresponding rule in the tool that created the report
* `runs[].results[].locations[]`: SonarQube Server only uses the first item in the array. Must be a physical location
  * `physicalLocation.artifactLocation.uri`: Path of the file concerned by the issue
  * `physicalLocation.region`: Text range concerned by the issue, defined by the following fields:
    * `startLine`
    * `startColumn` (optional)
    * `endLine` (optional)
    * `endColumn` (optional)

If `startColumn`, `endLine`, `endColumn` are not specified, SonarQube Server automatically retrieves the full coordinates of the line.

{% hint style="info" %}
If a mandatory field is missing, the report is ignored (see the corresponding line in the logs).
{% endhint %}

**Optional fields:**

* `sarifLog.runs[].results[].level` - severity of the issue. The following mapping applies:

|                   |                        |
| ----------------- | ---------------------- |
| **SARIF 2.1.0**   | **SonarQube severity** |
| error             | critical               |
| warning           | major                  |
| note              | minor                  |
| none              | info                   |
| `empty` or `null` | major (default)        |

## Example <a href="#example" id="example"></a>

```css-79elbk
{
  "version": "2.1.0",
  "$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.5",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "a test linter",
          "informationUri": "https://www….",
          "version": "8.27.0"
        }
      },
      "results": [
        {
          "level": "error",
          "message": {
            "text": "'toto' is assigned a value but never used."
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "file:///Users/sample/Workspace/Sarif-For-Test/src/simple-file.js"
                },
                "region": {
                  "startLine": 1,
                  "startColumn": 5,
                  "endLine": 1,
                  "endColumn": 9
                }
              }
            }
          ],
          "ruleId": "no-unused-vars"
        }
      ]
    }
  ]
}
```

## Limitations <a href="#limitations" id="limitations"></a>

There are a couple of limitations with importing SARIF issues:

* You can’t manage them within SonarQube Server; for instance, there is no ability to mark them as False Positive.
* You can’t manage the activation of the rules that raise these issues within SonarQube Server. External rules aren’t visible on the Rules page or reflected in quality profiles.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/10.0/analyzing-source-code/importing-external-issues/importing-issues-from-sarif-reports.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
