You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SonarQube scanners DO NOT support anything other then basic\token based authentication. Because of that you will need to setup 2 websites. The first is for the browser and supports single sign on. [WWWROOT_USER] You will also need an unauthenticated one for supporting scanners [WWWROOT_SCANNER]. Please setup these websites ahead of time (ssl required) and make sure you can access index.html. DO NOT USE AN SNI based website for WWWROOT_SCANNER. Run it on a different port then 443. There is a bug that makes it unsupported.
9
+
SonarQube scanners DO NOT support anything other then basic\token based authentication. I've created a module that attempts to detect when the connecting application is a scanner or includes a token. When a scanner is detected the module will then bypass the windows authentication process. Right now the bypass conditions are:
10
+
* If there is an Authorization header with Basic auth
11
+
* this indicates a token is present
12
+
* If the user agent of the request starts with any of the agent strings listed in the web.config setting: PassThruAgents
I've only tested this with the MsBuild scanner so the agent list may need to be expanded.
16
+
17
+
Previously the only way to enable single sign on was to have 2 websites, one for windows authentication, and one for token based authentication. The bypass module SHOULD remove the need for that second site. Until there is more exhaustive testing I will still include the multi-site installation instructions and artifacts. My plan is to remove those once the single site method is proven stable.
18
+
19
+
20
+
21
+
# Installation (Single Site)
22
+
23
+
These are the prefered installation directions.
24
+
25
+
`Note: This configuration assumes sonarqube is running on the same server as IIS on port 9000. If this is not correct you will need to edit the reverse proxy rules in the web.config file to match your configuration.`
26
+
27
+
1) Configure sonarqube for RUTA per: https://jira.sonarsource.com/browse/SONAR-5430 (If default settings are used all you should need to do is add: sonar.web.sso.enable=true to the sonar.properties file and restart sonarqube.)
28
+
29
+
2) Download the current release and extract to [EXTRACT_FOLDER]
30
+
31
+
3) Run: ConfigureServer.ps1
32
+
`Note: This installs the following windows features: IIS-HttpRedirect, IIS-ASPNET45, IIS-WebServerManagementTools, IIS-HttpTracing, IIS-WindowsAuthentication, IIS-NetFxExtensibility45, IIS-ApplicationDevelopment. It unlocks the IIS module ordering system wide as well as the authentication module configuration. It also installs ARR and UrlRewrite server wide.`
33
+
34
+
4) Create a website [WWWROOT], ssl required, pointing to a directory [WWWROOT_DIRECTORY] with a test file in it. Make sure you can browse to that file via your browser.
35
+
36
+
5) Copy: [EXTRACT_FOLDER]\inetpub-user to: [WWWROOT_DIRECTORY]
37
+
38
+
6) Browse to https://[WWWROOT] You should hopefully be signed in.
39
+
40
+
7) Test a scanner run with the url https://[WWWROOT]
41
+
42
+
# Installation (Multi Site)
43
+
44
+
These directions are only if you run into trouble with the single site method.
45
+
46
+
The first site is for the browser and supports single sign on. [WWWROOT_USER] You will also need an unauthenticated one for supporting scanners [WWWROOT_SCANNER]. Please setup these websites ahead of time (ssl required) and make sure you can access index.html. DO NOT USE AN SNI based website for WWWROOT_SCANNER. Run it on a different port then 443. There is a bug that makes it unsupported.
10
47
11
48
1) Configure sonarqube for RUTA per: https://jira.sonarsource.com/browse/SONAR-5430 (If default settings are used all you should need to do is add: sonar.web.sso.enable=true to the sonar.properties file and restart sonarqube.)
12
49
@@ -17,13 +54,15 @@ SonarQube scanners DO NOT support anything other then basic\token based authenti
17
54
18
55
4) Copy: [EXTRACT_FOLDER]\inetpub-user to: [WWWROOT_USER]
19
56
20
-
5) Browse to https://[WWWROOT_USER_URL] You should hopefully be signed in.
57
+
5) Remove the line: <addname="SonarAuthPassthroughModule"type="RutaHttpModule.SonarAuthPassthroughModule"preCondition="runtimeVersionv4.0" /> from the web.config file.
58
+
59
+
6) Browse to https://[WWWROOT_USER_URL] You should hopefully be signed in.
21
60
22
61
`Note: This configuration assumes sonarqube is running on the same server as IIS on port 9000. If this is not correct you will need to edit the reverse proxy rules in the web.config file to match your configuration.`
23
62
24
-
6) Once you have the SSO working the only thing left is to configure the reverse proxy on [WWWROOT_SCANNER].
63
+
7) Once you have the SSO working the only thing left is to configure the reverse proxy on [WWWROOT_SCANNER].
25
64
26
-
7) Copy:[EXTRACT_FOLDER]\inetpub-scanner to: [WWWROOT_SCANNER]
65
+
8) Copy:[EXTRACT_FOLDER]\inetpub-scanner to: [WWWROOT_SCANNER]
27
66
28
67
8) You should now be able to run a scanner configured to point at: https://[WWWROOT_SCANNER_URL] with token based authentication.
29
68
@@ -43,5 +82,7 @@ While this should work fine out of the box there are a few options that can be u
43
82
44
83
6) AdGroupBaseDsn - For users, only return groups that are in the following OU.
45
84
85
+
7) PassThruAgents - If you discover new user agent strings that are not bypassing windows authentication add them to this list. (Please open an issue or pull request also.)
86
+
46
87
Note: For large AD trees setting AdUserBaseDsn and AdGroupBaseDsn can greatly improve performance.
0 commit comments