I am trying to use the reindex api to create a copy of a set of documents. One of the fields (productId) of the document is a UUID. I need the copied documents to have new UUIDs for the productId field.
Please note, simply using the elastic search _id field is not an option as services using these documents depend on this field being a valid UUID.
According to  and  the method java.util.UUID.randomUUID() is not whitelisted for use in painless scripts.
Why is randomUUID() considered an unsafe operation? Or is it just an oversight that it is not whitelisted?
What would be the process for whitelisting this method on our ES server? I have read  which describes supplying our own java policy file on jvm startup. The problem with this is that I don't really want to overwrite all the existing policies but only add to them. Is there a way to do this?
Will the approach described in  really work for painless whitelisting. Looking at the source, it seems there is a separate framework for whitelisting java classes for painless here .
- Elastic Search: 6.4.2
- Deploying to kubernetes with helm (https://github.com/elastic/helm-charts/tree/master/elasticsearch)
 - Generate a UUID using randomuuid in painless
 - https://www.elastic.co/guide/en/elasticsearch/painless/6.4/painless-api-reference.html
 - https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-scripting-security.html
 - https://github.com/elastic/elasticsearch/blob/master/modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/java.util.txt