-
Type:
Task
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 7.3
-
Component/s: ElasticSearch
-
Labels:None
-
Edition:Community
-
Production Notes:The issues.indexStructure hash has to be manually updated to avoid the index to be dropped.
We should try to avoid having to drop/rebuild the entire index, especially on SonarCloud.
The plan is to deploy on pre-production without any specific action. Since the ES structure has changed, it will be detected and the index will be dropped/recreated. It will take time but this is fine since this is pre-prod.
Then run the following ES query on pre-prod to get the new ES index hash:
curl <pre-prod es server>:<port>/metadatas/_search?pretty&size=100
We are interested by the has of the issues.indexStructure
{ "_index" : "metadatas", "_type" : "metadata", "_id" : "issues.indexStructure", "_score" : 1.0, "_source" : { "value" : "<the value>" } },
Just before installing the new version on production, update the ES entry to match the one on pre-prod:
curl localhost:9200/metadatas/metadata/issues.indexStructure?refresh=true -XPUT -d '{"value":"<the value>"}'
And add the 3 new fields to the issues index:
curl localhost:9200/issues/_mapping/issue -XPUT -d'{"properties":{"owaspTop10":{"type":"keyword"}}}' curl localhost:9200/issues/_mapping/issue -XPUT -d'{"properties":{"sansTop25":{"type":"keyword"}}}' curl localhost:9200/issues/_mapping/issue -XPUT -d'{"properties":{"cwe":{"type":"keyword"}}}'
Then install the new SonarCloud version.
This should prevent the index to be dropped by the next startup.
- contributes to
-
MMF-1266 Dedicated security reports to drive the efforts towards a more secure application
-
- Closed
-