> 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/sonarqube.md).

# SonarQube

## About SonarQube

You can connect OX to your self-managed SonarQube server to import the security issues it reports for your projects. OX merges them with its own findings, so your teams see one prioritized queue instead of switching tools.

SonarQube collects and analyzes source code and reports on code quality and security over time. OX reads your SonarQube projects and issues through the SonarQube Web API, using a user token that you generate on your server.

After the connection succeeds, OX imports SonarQube 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 SonarQube

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

### Prerequisites

* SonarQube account: A user with the **Browse** permission on the projects you want to import.

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

OX authenticates to SonarQube with a user token. The token inherits the permissions of the account that creates it, so create it from an account that can browse the projects you want in OX.

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

### Step 2: Connect SonarQube to OX

1. In the OX platform, go to the **Connectors** page.
2. In the search box, enter **SonarQube**.
3. Select the **SonarQube** card under **Code Security (Static Analysis)**. The **Configure your SonarQube credentials** box opens.

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

4. Enter the connection fields as follows:

<table><thead><tr><th width="219.8333740234375">Field</th><th>What to use</th></tr></thead><tbody><tr><td>SonarQube Host URL</td><td>The base URL of your SonarQube server, for example <code>https://sonarqube.&#x3C;customer-name>.com</code>.</td></tr><tr><td>Token</td><td>The SonarQube API token you create in Step 1. OX stores it encrypted and never displays it again.</td></tr><tr><td>OX Broker</td><td>Enable to connect through an OX Broker. Use this option when Harbor is accessible only through an internal network or when your organization requires all connector traffic to be routed through an <a href="https://docs.ox.security/get-started/onboarding-to-ox/prerequisites-and-access/ox-deployment/ox-broker.md">OX Broker</a>.</td></tr></tbody></table>

5. Select **Verify Connectivity**. OX calls SonarQube with the values you entered and reports whether the call succeeds.
6. Select **Connect**.
7. To select which SonarQube 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 SonarQube 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/sonarqube.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.
