Embed the sonarqube server

Hello,
We are trying to embed the SonarQube server in our special visualization portal

  • SonarQube v7.9.2
  • According the log in SonarQube server, connection is ok:

access.2020-10-22.log:127.0.0.1 - - [22/Oct/2020:11:27:15 -0700] "GET /dashboard?id=OurProject_Automation_Sonar HTTP/1.1" 200 - "*https://ourdashboard.eng.company.com/*" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/XX.X.XXX.XX Safari/537.36" "AXUmgG1rIu0U/QnLAJA2"

  • Firefox says that SonarQube server doesn’t allow the website if its embedded. We tried it on chrome as well. Screeshot is bellow:

  • It’s all on our Rancher.
  • Please could you advise us how to set x-frame options?

Hi @puci ,

let me try to understand your setup and correct me if i have wrong assumptions in there:

you have a RKE cluster and deployed sonarqube in there (btw you are 2 patch releases behind the latest LTS release). now you are trying to display sonarqube in an iframe as part of a broader dashboard, resulting in the screenshot you posted. did i get that right?

i don’t think there is a easy way to configure the X-Frame-Options currently as they are hardcoded into sonarqube. What you could do is to configure a reverse proxy in front of sonarqube to hide the original X-Frame-Options from the request (option proxy_hide_header 'x-frame-options'; for nginx for example).

while i would not recommend you to do so for security reasons, it might solve your use case.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.