22title : " SonarQube API Import"
33toc_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 `
911Paste 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
3337Configuration` shall be used. If you do not choose
3438any, DefectDojo will use the ` API Scan Configuration ` of the Product if there is
3539only 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
4246does not exist. If a branch name is not supplied during import/re-import, the default branch
4347of 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