Access sonarQube server behind the firewall which is running within Enterprise network

Must-share information (formatted with Markdown):

  • which versions are you using (SonarScanner 4.7.0.2747)
  • what are you trying to achieve
    We wanted to execute scan with sonar scanner client on sonarqube server running behind the firewall.
  • what have you tried so far to achieve this
    We tried to use a proxy configuration and set the virtual address as the serverUrl for sonarqube instance. Scan works fine but after it, it tries to do the GET request to download results from the actual server url and eventually it fails because the address is not reachable through the internet.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.889 INFO: ------------------------------------------------------------------------
[2023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.889 INFO: EXECUTION SUCCESS
[2023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.889 INFO: ------------------------------------------------------------------------
[2023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.889 INFO: Total time: 1:13.228s
[2023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.937 INFO: Final Memory: 17M/64M
[2023-04-17T10:09:37.994Z] info  sonarExecuteScan - 10:09:37.937 INFO: ------------------------------------------------------------------------
[2023-04-17T10:09:38.553Z] info  sonarExecuteScan - waiting for SonarQube task to complete..
[2023-04-17T10:09:38.553Z] info  sonarExecuteScan - [DEBUG] GET https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB
[2023-04-17T10:09:38.553Z] info  sonarExecuteScan - [ERR] GET https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB request failed: Get "https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB": dial tcp: lookup xxx.corp on 100.64.0.10:53: no such host
[2023-04-17T10:09:38.553Z] info  sonarExecuteScan - [DEBUG] GET https:xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB: retrying in 1s (15 left)
[2023-04-17T10:09:39.477Z] info  sonarExecuteScan - [ERR] GET https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB request failed: Get "https://xxxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB": dial tcp: lookup xxx.corp on 100.64.0.10:53: no such host
[2023-04-17T10:09:39.477Z] info  sonarExecuteScan - [DEBUG] GET https://xxx-yyy.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB: retrying in 2s (14 left)
[2023-04-17T10:09:41.361Z] info  sonarExecuteScan - [ERR] GET https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB request failed: Get "https://xxx.corp/api/ce/task?id=AYeOsOobvy4XIvbipKtB": dial tcp: lookup xxx.corp on 100.64.0.10:53: no such host

Hi @srinikitha09
where are your build servers, which ALM are you using, which version of SonarQube (probably not relevant)?
We are using Azure DevOps Services, build servers and SonarQube server are both on-premise in our corp network. That works fine.

For Microsoft hosted build pipelines we haven’t tried yet, but you’ll probably have to set up a remote proxy, see Operating the server (sonarqube.org)

Hi Volker,

Thank you for your reply. Our build servers are running on JenkinsFilerunner hosted on AWS. Only the sonarqube server is on-prem. We have already set up a proxy via the cloud connector.