> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/ox-integrations/3rd-party-integrations/code-security-static-analysis/sonarcloud.md).

# SonarCloud

## About SonarCloud

You can connect OX to SonarCloud to import the security issues that SonarCloud raises on your projects. OX shows them with its own findings for the same repository, so a single view covers code quality risk and security risk together.

SonarCloud is the hosted Sonar service for code quality and security. OX reads your SonarCloud organizations, projects, and issues through the SonarCloud API, using a user token that you generate in your account security settings.

After the connection succeeds, OX imports SonarCloud findings on the next scan and maps them to your OX applications. From there, they follow the same policies, severity model, and ticketing that your other findings follow.

### What OX imports from SonarCloud

The SonarCloud connector belongs to the Code Security (Static Analysis) category. OX imports the static analysis issues that SonarCloud finds in your source code.

### Prerequisites

* SonarCloud account: An account with access to the organizations and projects you want in OX.

### Step 1: Generate a user token \[SonarCloud]

OX authenticates to SonarCloud with a user token. The token inherits the permissions of the account that creates it, so use an account that can read the projects you want to import.

1. Sign in to SonarCloud.
2. Open your account menu, then go to **My Account > Security**.
3. Enter a name for the token that identifies the OX integration, then select **Generate**.
4. Copy the token value and store it in a secure location. SonarCloud shows it once.

### Step 2: Connect SonarCloud to OX

1. In the OX platform, go to the **Connectors** page.
2. In the search box, enter SonarCloud.
3. Select the **SonarCloud** card under **Code Security (Static Analysis)**.

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-09c9bd22f891162de8244cd4528e12b7e8127d54%2FSonarCloud.png?alt=media" alt="" width="511"><figcaption></figcaption></figure>

4. Enter the connection fields, as follows:

| Field               | What to use                                                                                        |
| ------------------- | -------------------------------------------------------------------------------------------------- |
| SonarCloud Host URL | The SonarCloud API host, `https://sonarcloud.io`.                                                  |
| Token               | The SonarCloud API token you create in Step 1. OX stores it encrypted and never displays it again. |

5. Select **Verify Connectivity**. OX calls SonarCloud with the values you entered and reports whether the call succeeds.
6. Select **Connect**.
7. To select which SonarCloud projects OX imports, select the gear icon next to **Delete**, select the projects you want to import, and then select **Save**.

   > **Note:** The gear icon becomes active after the connection succeeds. Select it to limit the import to specific SonarCloud projects.


---

# 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.ox.security/ox-integrations/3rd-party-integrations/code-security-static-analysis/sonarcloud.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.
