Closed asjadathick closed 4 years ago
Pinging @elastic/es-core-features (:Core/Features/Watcher)
Pinging @elastic/es-core-infra (:Core/Infra/Scripting)
We have that API in the ingest context, see https://github.com/elastic/elasticsearch/pull/59671
The API currently supports sha1
and sha256
as they are guaranteed to be supported in all java implementations. See the MessageDigest documentation for Java 14. Java 8 through Java 13 also includes support for md5
but we've omitted it due to its extreme insecurity.
Added in 7.10
Painless in the watcher context does not provide APIs to generate hash values from strings. This is an issue when integrating with external systems that require a unique/key field for documents sent to them.
In my use case, I'm aggregating events on Elasticsearch before sending aggregated results into ServiceNow as CIs (configuration items). Without a hash value, I have no way to update/overwrite existing CIs on servicenow.
I suggest adding support for md5, sha1, sha256 and sha512 methods into the watcher context. Supporting more collision resistant hashes with higher bit lengths will future proof this API.
I suggest the API looks something like this: