SonarCloud
Visualize SonarCloud data, map SonarCloud users to employees, and monitor changes through queries and alerts.
- Installation
- Data Model
- Types
Installation
SonarCloud is now branded SonarQube Cloud. You may see either name in the vendor console and documentation; the integration and the steps below are unchanged.
Prerequisites
- A SonarQube Cloud (SonarCloud) account with access to the organization or organizations you want to ingest.
- An API token generated from your account. The token inherits the permissions of the user who issues it, so generate the token as a user whose permissions on the organization cover the data you want to ingest (members, groups, projects, and issues). Administrative Web API services require the user to have specific permissions.
Create an API token
- In SonarQube Cloud, open the account menu in the top-right corner and select My account.
- Go to Access Tokens, then open the Personal Tokens tab.
- Under Generate Tokens, enter a name, choose an expiration (7, 30, 60, or 90 days, or a custom value from 1 day to 1 year), and click Generate Token.
- Copy the token value immediately. It cannot be retrieved again after you leave the page. See Managing tokens for details.
The Personal Tokens tab is only available to users signed in with GitHub. A token created without an expiration date is automatically removed after 60 days of inactivity.
Find your organization key
You will provide one or more organization keys when you configure the integration. To find an organization key, go to https://sonarcloud.io/organizations/<your-organization>/edit and look under the Edit organization key section, which displays the exact key.
Configuration in JupiterOne
To install the SonarCloud integration in JupiterOne, navigate to the Integrations tab in JupiterOne and select SonarCloud. Click New Instance to begin configuring your integration.
Creating an instance requires the following:
- The Account Name used to identify the SonarCloud account in JupiterOne. Ingested entities will have this value stored in
tag.AccountNamewhen theAccountNametoggle is enabled. - A Description to assist in identifying the integration instance, if desired.
- A Polling Interval that fits your monitoring needs. You may leave this as
DISABLEDand manually execute the integration. - Your SonarCloud API Token, generated in the steps above.
- The Organization Names to ingest. Enter the organization key (found above) for each organization you want to monitor. To ingest multiple organizations, separate each key with a comma.
Click Create once all values are provided to finalize the integration.
Next steps
Now that your integration instance has been configured, it will begin running on the polling interval you provided, populating data within JupiterOne. Continue on to our Instance management guide to learn more about working with and editing integration instances.
Entities
The following entities are created:
| Resources | Entity _type | Entity _class |
|---|---|---|
| Issue | sonarcloud_issue | Issue |
| Organization | sonarcloud_organization | Organization |
| Project | sonarcloud_project | Project |
| User | sonarcloud_user | User |
| UserGroup | sonarcloud_group | UserGroup |
Relationships
The following relationships are created:
Source Entity _type | Relationship _class | Target Entity _type |
|---|---|---|
sonarcloud_group | HAS | sonarcloud_user |
sonarcloud_organization | HAS | sonarcloud_group |
sonarcloud_organization | HAS | sonarcloud_project |
sonarcloud_project | HAS | sonarcloud_issue |
Mapped Relationships
The following mapped relationships are created:
Source Entity _type | Relationship _class | Target Entity _type | Direction |
|---|---|---|---|
sonarcloud_project | SCANS | CodeRepo | FORWARD |