Julien Lancelot [Fri, 27 Nov 2020 15:16:52 +0000 (16:16 +0100)]
SONAR-14175 Update doc about admin password reset
* SONAR-14175 Add upgrade note about default admin credentials usage
* SONAR-14175 Update docs to set reset_password to true in the resetting admin password SQL
Julien Lancelot [Fri, 27 Nov 2020 08:16:06 +0000 (09:16 +0100)]
SONAR-14175 SONAR-14176 Detect usage of admin account with default credential
SONAR-14175 Add a startup task to detect admin default credential usage and set reset_password flag to true
SONAR-14176 Warn administrators when default admin credential is detected
Julien Lancelot [Thu, 26 Nov 2020 07:56:50 +0000 (08:56 +0100)]
SONAR-14175 Prevent using same password as before in api/users/change_password
* Prevent using same password as before in api/users/change_password
* Improve UT
- Replace usage of ExpectedException by assertThatThrownBy
- Add expected message when exceptions are thrown (help me to detect that some UTs were not covering the correct use case)
- Use generated values as much as possible
Duarte Meneses [Fri, 27 Nov 2020 02:34:42 +0000 (20:34 -0600)]
Speed up unit tests by improving indexing in unit tests
* Unit tests no longer use the LargeSizeHandler for indexing. This handler is designed for indexing large amounts of data and is slower for the data sets used in unit tests.
* Insert all data in DB before indexing in unit tests (there is a huge overhead in each call to index)
Malena Ebert [Tue, 17 Nov 2020 08:29:18 +0000 (09:29 +0100)]
BUILD Fix unauthorized builds with artifactory repo
Due to a misbehavior in artifactory, the wrong http status code is returned and the build will stop immediately. This happens if you access a virtual repository which contains a repository which requires authentication.
As a workaround a virtual repository is used, which does not include non-public repositories.
Michal Duda [Fri, 30 Oct 2020 12:31:18 +0000 (13:31 +0100)]
SONAR-12686 Fix Elasticsearch properties for a single node
- https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html#_discovery_configuration_is_required_in_production
Michal Duda [Tue, 27 Oct 2020 22:02:20 +0000 (23:02 +0100)]
SONAR-13979 Fail when sonar.search.host or sonar.search.port are defined in DCE
- Orchestrator upgrade was required as by default it was setting these properties
Jacek [Thu, 9 Jan 2020 08:26:53 +0000 (09:26 +0100)]
SONAR-12686 upgrade es client to 7.9.3 and move to HTTP
- add should minimum match eq 1 to user index queries
ES 7.X changed behaviour in case filter query with bool it defaults to '0'
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html#_the_filter_context_has_been_removed
- fix issue index routing param
ES 7.X helped discover this bug as new setting has been auto configured which is 'index.number_of_routing_shards'.
This has changed how documents are distributed across shards depending on how many shards the index has.
Without that change issues docs has been incorrectly routed to the same shard hash as projects and it worked no matter what routing key you used projectUuid or auth_projectUuid.
- update ngram and edge_ngram names to match with es 7.x
nGram and edgeNgram has been deprecated in favour of ngram and edge_ngram
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#deprecated-ngram-edgengram-token-filter-cannot-be-used
- remove `_all : enabled` usage from UT
This field was already deprecated in 6.X, now it has been removed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#all-meta-field-removed
- add Elasticsearch High Level REST client dependency
- use sonar.search.port for ES HTTP
- main process use ES Rest client to check ES status
- sonar.cluster.search.hosts has HTTP ports on APP nodes
also sonar.search.port and sonar.search.host MUST be configured on each Search node with the host and HTTP port of the current node
- use Elasticsearch high level rest client
- use in EsTester
- use as primary es client
- use indices api to get all indices name instead of cluster api
- use cluster health api to check cluster state
- support raw requests for 'nodes/_stats' and '_cluster/stats'
- support raw requests for 'indices/_stats'
- leave netty4plugin as testCompile dependency it is used in UTs
SONAR-12686 fix ES discovery settings in cluster mode
deprecated "discovery.zen.ping.unicast.hosts" has been removed, "discovery.seed_hosts" should be used instead
"discovery.zen.minimum_master_nodes" is ignored now: stop setting it and drop sonar property "sonar.search.minimumMasterNodes"