Skip to content

Commit df25487

Browse files
committed
docs: update SonarQube API pull details
1 parent cf2a8b1 commit df25487

File tree

2 files changed

+44
-27
lines changed

2 files changed

+44
-27
lines changed

docs/content/supported_tools/parsers/api/_index.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ All parsers that use API pull have common basic configuration steps, but with di
1111

1212
Follow these steps to set up API importing:
1313

14+
## Tool Configuration
15+
1416
1. Configure the API authentication details by navigating to
1517
`Configuration -> Tool Configuration -> Add Tool Configuration`. Enter a `Name`,
1618
selecting the related `Tool Type` and `Authentication Type` "API Key". Paste your credentials
17-
to the proper fields based on definitions below.
19+
into the proper fields based on the selected parser.
20+
21+
## Product-Level Configuration
22+
23+
1. Navigate to `Products -> All Products` and select a product from the list.
24+
25+
2. Click on `Settings` and select `Add API Scan Configuration`
1826

19-
2. In the `Product` settings select `Add API Scan Configuration` and select the
20-
previously added `Tool Configuration`. Provide values based on definitions below.
27+
3. Select the previously added `Tool Configuration` and provide additional values based on the selected parser.
2128

22-
3. After this is done, you can import the findings on the `Product` page through
23-
`Findings -> Import Scan Results`. As the `Scan type`, select the related type,
24-
the API scan configuration from the last step, and click `Import`.
29+
4. After this is done, you can import the findings on the `Product` page through
30+
`Findings -> Import Scan Results`. As the `Scan type`, select the related type
31+
(the `API Scan Configuration` created above) and click `Import`.

docs/content/supported_tools/parsers/api/sonarqube.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
title: "SonarQube API Import"
33
toc_hide: true
44
---
5-
All parsers which using API have common basic configuration step but with different values. Please, [read these steps](../) at first.
5+
All parsers that use API pull have common basic configuration steps, but with different values. Please, [read these steps](../) first.
66

7-
In `Tool Configuration`, select `Tool Type` to "SonarQube" and `Authentication Type` "API Key".
8-
Note the url must be in the format of `https://<sonarqube_host>/api`
7+
## Tool Configuration
8+
9+
In `Tool Configuration`, select `Tool Type` "SonarQube" and `Authentication Type` "API Key".
10+
The URL must be in the format of `https://<sonarqube_host>/api`
911
Paste your SonarQube API token in the "API Key" field.
10-
By default the tool will import vulnerabilities issues
11-
and security hotspots only, but additional filters can be setup using the
12-
Extras field separated by commas (e.g. `BUG,VULNERABILITY,CODE_SMELL`). When using
13-
SonarCloud, you must also specify the Organization ID in the Extras field as follows
14-
`OrgID=sonarcloud-organzation-ID`. If also specifying issue type filters, please
15-
seperate the items in the Extras field by a vertical bar as follows
16-
`BUG,VULNERABILITY,CODE_SMELL|OrgID=sonarcloud-organzation-ID`
17-
18-
In "Add API Scan Configuration"
12+
By default, the tool will import vulnerability issues
13+
and security hotspots only, but additional filters can be applied using the
14+
"Extras" field separated by commas (e.g. `BUG,VULNERABILITY,CODE_SMELL`). When using
15+
SonarCloud, you must also specify the Organization ID in the "Extras" field (e.g.
16+
`OrgID=sonarcloud-organzation-ID`). When also specifying issue type filters, please
17+
separate the items in the "Extras" field by a vertical bar (e.g.
18+
`BUG,VULNERABILITY,CODE_SMELL|OrgID=sonarcloud-organzation-ID`)
19+
20+
## Product-Level Configuration
21+
22+
In `Add API Scan Configuration`
1923
- `Service key 1` must
2024
be the SonarQube project key, which can be found by navigating to a specific project and
2125
selecting the value from the url
@@ -24,23 +28,29 @@ In "Add API Scan Configuration"
2428
use the name of the Product as the project key in SonarQube. If you would like to
2529
import findings from multiple projects, you can specify multiple keys as
2630
separated `API Scan Configuration` in the `Product` settings.
27-
- If using SonarCloud, the orginization ID can be used from step 1, but it
28-
can be overiden by supplying a different orginization ID in the `Service key 2` input field.
31+
- If using SonarCloud, the organization ID can be used from step 1, but it
32+
can be overridden by supplying a different organization ID in the `Service key 2` input field.
2933

3034
## Multiple SonarQube API Configurations
3135

32-
In the import or re-import dialog you can select which `API Scan
36+
In the import or re-import dialog, you can select which `API Scan
3337
Configuration` shall be used. If you do not choose
3438
any, DefectDojo will use the `API Scan Configuration` of the Product if there is
3539
only one defined or the SonarQube `Tool Configuration` if there is only one.
3640

37-
## Multi Branch Scanning
41+
## Multi-Branch Scanning
3842

39-
If using a version of SonarQube with multi branch scanning, the branch tha be scanned can
40-
be supplied in the `branch_tag` fieild at import/re-import time. If the branch does not exist,
41-
a notification will be generated in the alerts table indicating that branch to be imported
43+
If using a version of SonarQube with multi-branch scanning, the branch to be scanned can
44+
be supplied in the `branch_tag` field at import/re-import time. If the branch does not exist,
45+
a notification will be generated in the alerts table, indicating that branch to be imported
4246
does not exist. If a branch name is not supplied during import/re-import, the default branch
4347
of the SonarQube project will be used.
4448

45-
**Note:**: If `https` is used for the SonarQube, the certificate must be
46-
trusted by the DefectDojo instance.
49+
## Custom Trust
50+
51+
If you are connecting to SonarQube via HTTPS, the issuer of the certificate that is presented by
52+
SonarQube must be trusted.
53+
54+
One way of achieving this is by defining the `REQUESTS_CA_BUNDLE` environment variable to point
55+
to a PEM-encoded certificate file in the container (e.g. `REQUESTS_CA_BUNDLE=/app/media/cacerts.pem`).
56+
To ensure the certificate is persisted, the file should be in a mounted volume.

0 commit comments

Comments
 (0)