Giter Site home page Giter Site logo

sonar-crowd's Introduction

Crowd Plugin for SonarQube

Build

This plugin allows the delegation of SonarQube authentication and authorization to Atlassian Crowd. The previous version of this plugin has been changed to provide the same functionality as the SonarQube LDAP plugin:

  • Password checking against the external authentication engine.
  • Automatic synchronization of usernames and emails.
  • Automatic synchronization of relationships between users and groups (authorization).
  • Ability to authenticate against both the external and the internal authentication systems (for instance, technical SonarQube user accounts do not need to be defined in Crowd as there is an automatic fallback on SonarQube engine if the user is not defined in Crowd or if the Crowd server is down).

During the first authentication trial, if the password is correct, the SonarQube database is automatically populated with the new user. Each time a user logs into SonarQube, the username, the email and the groups this user belongs to that are refreshed in the SonarQube database.

Requirements

This plugin requires Atlassian Crowd 2.1.0 or later.

Installation

Go to Administration > Marketplace > Search for "Crowd" > Install > Restart the SonarQube server

Usage

  1. Configure the crowd plugin by editing the SONARQUBE_HOME/conf/sonar.properties file

  2. Restart the SonarQube server and check the log file for:

    org.sonar.INFO Security realm: Crowd ... o.s.p.c.CrowdRealm Crowd configuration is valid, connection test successful.

  3. Log into SonarQube

Configuration

PropertyDescriptionDefault valueMandatoryExample
sonar.security.realm To first try to authenticate against the external sytem. If the external system is not reachable or if the user is not defined in the external system, the authentication will be performed through the SonarQube internal system.
Available since SonarQube 3.6. It replaces the property sonar.authenticator.class usage.
None Yes Crowd (only possible value)
sonar.security.savePassword To save the user password in the SonarQube database. Then, users will be able to log into SonarQube even when the Crowd server is not reachable. false No
sonar.authenticator.createUsers By default, the SonarQube database is automatically populated when a new user logs into SonarQube. Setting this value to false, makes it mandatory for a System administrator to first declare a user through the SonarQube web interface before allowing this user to log into SonarQube. true No
sonar.security.updateUserAttributes If set to true, at each login, user's attributes (name and email) are re-synchronized. If set to false, user's attributes are not re-synchronized.
Note that if set to false, user's attributes are synchronized just once, at the very first login.
Available since SonarQube 3.6.
true No
sonar.authenticator.downcase Set to true when connecting to a Crowd server using a case-insensitive setup. false No
crowd.url URL of the Crowd server. Note that if you are using https with a self certified certificate, then you should install the server certificate into the Java truststore. Since version 2.0 of the plugin the url must be the root URL of your crowd instance and not the /services/ endpoint like for previous versions of the plugin. None Yes https://my.company.com/crowd/
crowd.application Application name defined in Crowd to authenticate your sonar instance. None No sonar
crowd.password Application password defined in Crowd to authenticate your sonar instance. None No

Example of CROWD Configuration

#-------------------
# Sonar Crowd Plugin
#-------------------


# To first try to authenticate against the external sytem.
# If the external system is not reachable or if the user is not defined in the external system, the authentication will be performed through the SonarQube internal system.
sonar.security.realm=Crowd
 
# URL of the Crowd server.
crowd.url=https://my.company.com/crowd/


# Crowd application name.
# Default is 'sonar'.
crowd.application=sonar-prod


# Crowd application password.
crowd.password=bar


# Don't use crowd for sonar account
sonar.security.localUsers=admin,sonar

Upgrades

to SonarQube 5.0

  • Only crowd plugin 2.0+ supports SonarQube 5.0+
  • sonar.security.realm must be used instead of sonar.authenticator.class (deprecated since SonarQube 3.6 and removed in SonarQube 5.0)

from Crowd plugin 1.0 to 2.0

  • Crowd plugin 2.0+ uses the REST API provided by Crowd. The crowd url used in the configuration (crowd.url) must be the main URL of your crowd instance and not its /services/ end point (used with the previous SOAP integration)
  • Crowd plugin 2.0+ synchronises groups from Crowd thus take care to create a group sonar-administrators in your Crowd directory and add in this group all users you'll want to use to administer SonarQube. You can also define some accounts to not synchronise with the property sonar.security.localUsers

sonar-crowd's People

Contributors

aheritier avatar apodkutin avatar christophelevis avatar deepy avatar dgageot avatar ehartmann avatar ferdinandhuebner avatar ganncamp avatar ganntest avatar godin avatar henryju avatar rpaasche avatar simonbrandhof avatar vai-frd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonar-crowd's Issues

Sonarqube startup stop after trying to initializing the Crowd Plugin

This is a test environment. Latest version of Atlassian Crowd deployed. Latest version of Sonatqube. We have several services in the LAB and all of them successful connect to Crowd. Sonarqube service is binding to 127.0.0.1. We use Nginx for HTTPS connection (All that is working if we disable the plugin.) Crowd is also HTTPS. We deployed Sonatype Nexus on the same server as Sonarqube and all integration to Crowd is successful.

We cannot find the problem anywhere. Any help will be greatly appreciated.

web.log we get

2019.04.14 19:46:43 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 80
2019.04.14 19:46:45 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2019.04.14 19:46:48 INFO web[][o.s.s.s.LogServerId] Server ID: 60CD2962-AWQYYfjXHq7gKnSnSBMY
2019.04.14 19:46:48 INFO web[][org.sonar.INFO] Security realm: Crowd
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'application.name' : 'sonar'
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: application.login.url
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.tokenkey' : 'session.tokenkey'
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.lastvalidation' : 'session.lastvalidation'
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.validationinterval' : '1'
2019.04.14 19:46:48 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: cookie.domain
2019.04.14 19:46:48 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.NoClassDefFoundError: javax/xml/bind/JAXB
at com.atlassian.crowd.integration.rest.service.RestExecutor.setBody(RestExecutor.java:204)
at com.atlassian.crowd.integration.rest.service.RestExecutor.post(RestExecutor.java:176)
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.searchUsers(RestCrowdClient.java:511)
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.testConnection(RestCrowdClient.java:500)
at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:97)
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:573)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
at org.sonar.server.platform.Platform.access$500(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXB
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 30 common frames omitted
2019.04.14 19:46:49 INFO web[][o.s.p.StopWatcher] Stopping process

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

sonar.properties

sonar.security.realm=Crowd
crowd.url=https://crowd01.contino.tech.int/Crowd/
crowd.application=sonar
crowd.password=
crowd.password=

Remove/change dependency on crowd-integration-client-rest

The disappearance of crowd-integration-client-rest from Atlassian's maven repos means that building this plugin is now a minor headache if you haven't built it before (as you need to manually locate dependencies)

This can be seen in travis-ci (which has lost the cached dependency)

Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project cm.xd.sonar-plugins:sonar-crowd-plugin:sonar-plugin:2.1.3:
The following artifacts could not be resolved: com.atlassian.crowd:crowd-integration-client-rest:jar:2.7.2, com.atlassian.security:atlassian-cookie-tools:jar:3.2, com.atlassian.crowd:crowd-integration-api:jar:2.7.2: Could not transfer artifact com.atlassian.crowd:crowd-integration-client-rest:jar:2.7.2 from/to atlassian (https://packages.atlassian.com/maven-public-legacy-local): Transfer failed for https://packages.atlassian.com/maven-public-legacy-local/com/atlassian/crowd/crowd-integration-client-rest/2.7.2/crowd-integration-client-rest-2.7.2.jar

Add more automated system tests

There's some basic scaffolding in the branch system-tests for quickly testing with new sonar versions

Right now it's too much of a manual process to be very useful

Plugin doesn't work with SonarQube 8.9 LTS

Hi,

We use Crowd as the primary authentication tool for SonarQube and we see that the plugin seems to be not working for newly released 8.9 LTS. SonarQube and Crowd connection is successful but unable to access Sonarqube. Is this issue known? Could you please fix this issue or give an update on when this will be done?

INFO web[][org.sonar.INFO] Security realm: Crowd INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'application.name' : 'sonarqube' INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: application.login.url INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.tokenkey' : 'session.tokenkey' INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.lastvalidation' : 'session.lastvalidation' INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.validationinterval' : '1' INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: cookie.domain INFO web[][o.s.p.c.CrowdRealm] Crowd configuration is valid, connection test successful. INFO web[][org.sonar.INFO] Security realm started

P.S. The groups on crowd and Sonarqube are synced in our previous SQ versions.

Thank you!

Create Crowd groups in Sonar automatically after login

Hi all,
we are using Crowd groups for authorization of different projects. So we have a lot of Crowd groups which should be created in Sonar automatically.
At the moment I have to create the Sonar group manually and then the group memberships are fetched automatically with this nice plugin.

My idea is, that when fetching the groups from Crowd here:

org.sonar.plugins.crowd.CrowdGroupsProvider.doGetGroups(String username)

I would like to check whether all those groups do exist in Sonar. If not I want to create the group.

My problem is that I can not find the functionality in any of the classes in org.sonar.api
Does anyone know whether to find this in Sonar API?

Kind regards

Deprecated ServerExtension is removed in 7.3

When adding the plugin to SonarQube 7.3 it prevents SonarQube from starting. This happens in an otherwise vanilla install of SonarQube 7.3. I tried versions 2.0 and 2.1 of the plugin, and both yield the same result.
The web.log logfile shows a NoClassDefFoundError:

2018.08.22 14:37:18 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube java.lang.IllegalStateException: Fail to load plugin Crowd [crowd] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:82) at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:586) at org.sonar.server.platform.Platform.start(Platform.java:211) at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185) at org.sonar.server.platform.Platform.access$500(Platform.java:46) at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119) at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371) at org.sonar.server.platform.Platform$1.doRun(Platform.java:119) at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoClassDefFoundError: org/sonar/api/ServerExtension at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125) at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76) at org.sonar.plugins.crowd.CrowdPlugin.define(CrowdPlugin.java:29) at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:72) ... 9 common frames omitted Caused by: java.lang.ClassNotFoundException: org.sonar.api.ServerExtension at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87) at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76) ... 24 common frames omitted

Periodic synchronization with Crowd

Dear all,

I'm opening a discussion in order to implement a new functionality on this plugin.
A periodic synchronization with CROWD configurable (parameter like every 1 hour).

From that moment, CROWD will be the only source to manage permissions.
We will use the "Developer Edition" of SonarQube, meaning that one project contains multiple branches.
This project is existing in the CROWD with a specific group, containing people having access to sonar.

The goal will be to sync SonarQube permissions/project every hour, analyzing if a new project is configured in the crowd and/or if new people were added/removed from the specific group.

What do you think about it ?

KR,
Dimitri

Sonarqube in Docker

Is it possible to configure the sonar-crowd plugin via the environment from a docker-compose file? Ie.:

sonarqube:
image: sonarqube
expose:
- '9000'
environment:
- sonar.jdbc.url=jdbc:postgresql://sonardb:5432/sonar
- crowd.url=${CROWD_URL}
- crowd.application=${CROWD_APPNAME}
- crowd.password=${CROWD_PASSWORD}
- sonar.security.realm=Crowd
- sonar.security.localUsers=admin,sonar

In this case whether hardcoded or using an environment variable to keep this info out of our repo sonarqube service can't start with error:

sonarqube_1 | 2019.09.23 21:02:07 INFO web[][org.sonar.INFO] Security realm: Crowd
sonarqube_1 | 2019.09.23 21:02:07 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
sonarqube_1 | org.sonar.api.utils.SonarException: Security realm fails to start: crowd.password is not set

Wondering if this is just not a capability, or if something crazy is happening,
thanks!

map groups from crowd

Hi,
is it possible to use this plugin to map groups from crowd to sonar?

So for example I have in crowd groups called:

  • sonar-administrators
  • sonar-qualitygates
  • sonar-etc

and I would like to map those groups with groups in sonar. Reading the wiki I understand is possible, but I could not find any description of how to configure them.

Thanks

Plugin does not start in SQ 8

Developer Edition Version 8.1 (build 31237)
Crowd INTEGRATION 2.1.3
Atlassian Crowd Version: 3.4.5

sonar.security.realm=Crowd
crowd.url=https://domain.com/crowd/
crowd.application=sonar_server
crowd.password=sonar_passw
sonar.security.localUsers=admin
sonar.authenticator.downcase=true

In the log has to be success or error notification from CrowdRealm.java.
But command gives me 0 lines
cat /opt/sonarqube/logs/* | grep -i realm

This one gives 1 line:
cat /opt/sonarqube/logs/* | grep -i crowd
INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Crowd / 2.1.3

As I undertood SQ sees the plugin but the fact that there is no CrowdRealm class object means that plugin is not able to start.

Is plugin really compatible with 8 SQ?

Problems with integration to internal crowd directories

We have problems to be able to synchronize the internal directories from crowd to sonarqube, only the directory that we have integrated into Ldap works correctly.

Some months ago we have upgrated sonar to its version 7.9.1, since then we have such a problem.

Our current sonar.properties configuration is as follows:

sonar.security.realm=Crowd

crowd.url=http://xx.xx.xx.xx:8080/crowd/

crowd.application=sonar_crowd

crowd.password=xxxxxx

crowd.groups.sync=true

sonar.authenticator.createUsers=true

sonar.security.updateUserAttributes=true

Currently our integrated tools are sonarqube 7.9.1 Enterprise, crowd 4.1.0 and the plugin for crowd is 2.1.3

Could you tell us if it is necessary to add any additional parameters?

Regards

Synchronization issue with specific group names

We have a long running issue that some specific groups are not being synchronized between JIRA and Sonarqube. (currently JIRA 8.0.0 and Sonar 6.7.4).

For example, given the following group names (yep, 45 chars!)

lorem-ipsum-dolores-dominus-whatever12-admin
lorem-ipsum-dolores-dominus-whatever12-users

Users from the group ending in admin are synced properly, users from the group ending in users are never synchronized and the group will forever stay empty in Sonarqube.

The length of the group names are supported fully within sonarqube and JIRA, and I find it strange that the same lenght works for one but not the other. There are no errors logged whatsoever. Adding users to a different group works, but this specific group is not syncing.

sonar-crowd with SSO

The installation I have of Crowd is integrated with
-JIRA
-Bamboo
-Confluence
-Bitbucket

through SSO.

Is it possible that when I login for example to JIRA (which by SSO also logs me in to Crowd) I will also be logged in to SonarQube?

Thanks.

JAVA 11 on SQ leads to Exeption

I'm working on the #5 but when loading plugin into SQ 7.9 running on JAVA 11 (in official Docker container) I got
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
from
at javax.xml.bind.JAXB.unmarshal(JAXB.java:241)
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:349)
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.findUserFromSSOToken(RestCrowdClient.java:859)
at org.sonar.plugins.crowd.CrowdSsoIdentityProvider.init(CrowdSsoIdentityProvider.java:78)

Even with the newest Crowd plugin version they obviously do not remove the JAXB usage.

I merged your latest master code (to include the JAVA 11 commits) also but this does not solve the problem.

Any ideas? It looks like the plugin is not JAVA 11 compatible regarding SQ running on JAVA 11 at all.

Upgrading to Sonar 7.1 latest plugin now fails

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.<clinit>(MultiThreadedHttpConnectionManager.java:70) at com.atlassian.crowd.integration.rest.service.RestExecutor.<init>(RestExecutor.java:53) at com.atlassian.crowd.integration.rest.service.RestCrowdClient.<init>(RestCrowdClient.java:85) at com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory.newInstance(RestCrowdClientFactory.java:26) at org.sonar.plugins.crowd.CrowdRealm.createCrowdClient(CrowdRealm.java:82) at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:92) at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)

This seems to be within the atlassian side on a dependency:
<dependency> <groupId>com.atlassian.crowd</groupId> <artifactId>crowd-integration-client-rest</artifactId> <version>2.7.2</version> <exclusions> <!-- Provided by Sonar --> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency>
Where you previously excluded those logging artifacts but maybe they where loaded by sonar and now they are not.

compatible problem : SQ 7.9 with plugin 2.1.3

hi ,
i have the issue that the plugin never started with with SQ , i use the following installation :

sq: version 7.9-community (Image from the official sq docker hub repository)
crowd plugin: 2.1.3 (from sq market place)
Atlassian Crowd Version: 3.7.5

my sonar.properties config:
sonar.security.realm=Crowd
crowd.url=https://my-company.com/crowd/
crowd.application=sonar
crowd.password=the_password
sonar.authenticator.downcase=true
after editing this file and restarting the sq server i can see from the logs that the plugin successfully installed and deployed but not started correctly due to reaseon i dont know yet :
pod logs:
kubectl logs sonarqube-7ccfcd4d6b-ggzsr | grep -i "crowd" :
INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Crowd / 2.1.3

but :

kubectl logs sonarqube-7ccfcd4d6b-ggzsr | grep -i "realm"
nothing ..

so i dont know if plugin compatible with SQ version,
any ideas to help out, will really appreciated !

Groups Aren't Being Synced

Hi,

We have installed SonarQube 6.7.x from scratch. There were no configuration or installation files before. After installing the plugin version 2.1 and making the necessary configurations, people were able to login Sonar over Crowd. However, groups aren't being synced to Sonar.
Groups are important for us for defining the Administrator users and Application permissions.
Is there any idea what is wrong? I couldn't test the version 2.1.1 since it was saying support for 7.x. Not sure if it's gonna break Sonar or not.

Thanks in advance.

Sonarqube 7.9.1 is not starting up with sonar-crowd 2.1.3

We have upgraded sonarqube from 7.4 to 7.9.1 where we need to upgrade sonar-crowd plugin from 2.1.1 to 2.1.3.

After the upgrade, sonar application is starting up as expected without Crowd config. But while starting up with crowd, it fails at the start up.

Here is the crowd config on sonar properties.

#-------------------
  # Sonar Crowd Plugin
  #-------------------


  # To first try to authenticate against the external sytem.
  # If the external system is not reachable or if the user is not defined in the external system, the authentication will be performed through the SonarQube internal system.
  sonar.security.realm=Crowd

  # URL of the Crowd server.
  crowd.url=https://mycompany:8443/crowd/


  # Crowd application name.
  # Default is 'sonar'.
  crowd.application=sonar


  # Crowd application password.
  crowd.password=password

  # Crowd group sync
  crowd.groups.sync=true

  # Don't use crowd for sonar account
  sonar.security.localUsers=admin,sonar

  # Don't save passwords incase Crowd is down
  sonar.security.savePassword=false

  # Don't create users, they must come from Crowd
  sonar.authenticator.createUsers=false


Here is the web log error
```
2019.11.15 21:19:13 INFO web[][org.sonar.INFO] Security realm: Crowd
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'application.name' : 'sonar'
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: application.login.url
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.tokenkey' : 'session.tokenkey'
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.lastvalidation' : 'session.lastvalidation'
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.validationinterval' : '1'
2019.11.15 21:19:13 INFO web[][c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: cookie.domain
2019.11.15 21:19:13 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.sonar.api.utils.SonarException: Security realm fails to start: Unable to test connection to crowd
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:93)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:545)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
at org.sonar.server.platform.Platform.access$500(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.sonar.api.utils.SonarException: Unable to test connection to crowd
at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:106)
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)



Any suggestion would be much appreciated. Thanks

org.sonar.api.utils.SonarException: Unable to test connection to crowd

env
my sonar version:5.6.6
crowd sonar plugin:2.0
crowd version:2.3.4

conf/sonar.properties:
sonar.security.realm=Crowd
sonar.security.savePassword=false
sonar.authenticator.createUsers=true
sonar.security.updateUserAttributes=true
sonar.authenticator.downcase=false
crowd.url=http://my_crowd_server:8095/crowd/
crowd.application=t3-sonar
crowd.password=sonar
sonar.security.localUsers=admin,sonar

When I start sonar, get this error:
org.sonar.api.utils.SonarException: Unable to test connection to crowd

Detail error info :
2017.04.19 18:11:29 INFO web[org.sonar.INFO] Security realm: Crowd
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Loading property: 'application.name' : 't3-sonar'
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: application.login.url
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.tokenkey' : 'session.tokenkey'
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.lastvalidation' : 'session.lastvalidation'
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Loading property: 'session.validationinterval' : '1'
2017.04.19 18:11:29 INFO web[c.a.c.s.c.ClientPropertiesImpl] Failed to find value for property: cookie.domain
2017.04.19 18:11:54 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
org.sonar.api.utils.SonarException: Unable to test connection to crowd
at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:100) ~[na:na]
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:84) ~[sonar-server-5.6.6.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.6.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.6.jar:na]
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:655) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:190) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.Platform.doStart(Platform.java:113) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.Platform.doStart(Platform.java:99) ~[sonar-server-5.6.6.jar:na]
at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:44) ~[sonar-server-5.6.6.jar:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: com.atlassian.crowd.exception.OperationFailedException: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 5000 ms
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:353) ~[na:na]
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.searchUsers(RestCrowdClient.java:511) ~[na:na]
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.testConnection(RestCrowdClient.java:500) ~[na:na]
at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:97) ~[na:na]
... 32 common frames omitted
Caused by: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 5000 ms
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155) ~[na:na]
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125) ~[na:na]
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) ~[na:na]
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) ~[na:na]
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) ~[na:na]
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[na:na]
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[na:na]
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) ~[na:na]
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.executeCrowdServiceMethod(RestExecutor.java:452) ~[na:na]
at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.andReceive(RestExecutor.java:341) ~[na:na]
... 35 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_121]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_121]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140) ~[na:na]
... 44 common frames omitted
2017.04.19 18:11:54 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2017.04.19 18:11:54 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors

Your help is highly appreciated.

java.lang.NoClassDefFoundError: javax/xml/bind/JAXB

I tried to run the Crowd plugin 2.1.2 on Sonarqube 7.9 on OpenJDK 11 and I run into this problem on startup:

2019.07.02 14:41:31 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.NoClassDefFoundError: javax/xml/bind/JAXB
at com.atlassian.crowd.integration.rest.service.RestExecutor.setBody(RestExecutor.java:204)
at com.atlassian.crowd.integration.rest.service.RestExecutor.post(RestExecutor.java:176)
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.searchUsers(RestCrowdClient.java:511)
at com.atlassian.crowd.integration.rest.service.RestCrowdClient.testConnection(RestCrowdClient.java:500)
at org.sonar.plugins.crowd.CrowdRealm.init(CrowdRealm.java:97)
at org.sonar.server.user.SecurityRealmFactory.start(SecurityRealmFactory.java:87)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:545)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
at org.sonar.server.platform.Platform.access$500(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXB
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 25 common frames omitted

Unable to authenticate against Crowd from Sonarqube

We have Sonarqube installed on docker environment and are trying to authenticate users & groups against our Atlassian Crowd. We see the request is not reaching Crowd.

The crowd add-on is installed and configuration details are provided in sonar.properties.

Sonarqube version: Version 6.7.6 LGPL
Any help is much appreciated

Thanks

sonar-administrators group membership is disappearing

I'm seeing a problem where if a user belongs to sonar-administrators AND sonar-users in Crowd, when they log into sonar, they are removed from sonar-administrators locally (doesn't change in Crowd). Can a person belong to only one sonar- group at a time?

Update: it seems that any user belonging to sonar-administrators group is automatically removed that group in Sonar upon login.

(Crowd 2.7.2, Sonar 5.1)

Crowd based user cannot log in

Hello sonar-crowd plugin developers,

We have a couple of questions:

  1. We have encountered a situation when we have a 'username' in Crowd, but if the user tries to log in using capital 'Username', the user will only be able to use his capitalized account 'Username'. This is confusing and we think it is a bug actually.

User renamed in crowd. Can not log in to sonarqube

Hi,
we just renamed a bunch of users in crowd. (Not just changed the display name or Email, but changed the login name)
The atlassian tools picked up on the rename without a hitch.
Sonarqube apparently did not. (At least I can still see the old names in Administration > Security > Users, and the user can no longer login.)
Question1: Is this a bug or a missing feature?
Question2: What is the workaround? (stop sonarqube; change users.login in the database; start sonarqube ?)

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.