Add a custom http header to all requests from sonar-scanner to a sonarqube instance

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarScanner 5.0.1.3006

  • how is SonarQube deployed: zip, Docker, Helm
    CircleCI Developer Hub - sonarsource/sonarcloud, but with a modified SONARQUBE_SCANNER_PARAMS to point to our instance

  • what are you trying to achieve
    Send data to our sonarqube instance

  • what have you tried so far to achieve this
    HTTP header

Hello!

Our sonarqube instance is behind a firewall, and to pass it, we need to add a x-* header with every request. The sonarqube scan is running in circleci.

I’ve tried to enable the sso headers, but those don’t seem to do anything.

What are ways I can add that header to all outgoing requests? Thanks.

1 Like

Hi,

Welcome to the community!

I’ve moved this to the Product Manager for a Day category since the functionality doesn’t exist.

Could you share what header(s) you need to add?

 
Thx,
Ann

Thank you.

Ideally, it would be an arg that I pass to the sonar-scan call so that I can pass arbitrary headers.

I’m thinking of something like

sonar-scanner -H "X-Custom-Header=123123" -H "X-Other-Custom-Header=456456"