You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
Copy file name to clipboardexpand all lines: 030_Data/45_Partial_update.asciidoc
+26-6
Original file line number
Diff line number
Diff line change
@@ -91,14 +91,34 @@ POST /website/blog/1/_update
91
91
92
92
For those ((("documents", "partial updates", "using scripts")))((("updating documents", "partial updates", "using scripts")))moments when the API just isn't enough, Elasticsearch allows you to
93
93
write your own custom logic in a script.((("scripts", "using to make partial updates"))) Scripting is supported in many APIs
94
-
including search, sorting, aggregations, and document updates. Scripts can be
95
-
passed in as part of the request, retrieved from the special `.scripts`
96
-
index, or loaded from disk.
94
+
including search, sorting, aggregations, and document updates. Scripts can be passed in as part of the request,
95
+
retrieved from the special .scripts index, or loaded from disk.
97
96
98
97
The default scripting language ((("Groovy")))is a http://groovy.codehaus.org/[Groovy], a
99
-
fast and expressive scripting language, similar in syntax to JavaScript. It
100
-
runs in a _sandbox_ to prevent malicious users from breaking out of
101
-
Elasticsearch and attacking the server.
98
+
fast and expressive scripting language, similar in syntax to JavaScript. It was first introduced
99
+
in Elasticsearch version v1.3.0 and it runs in a _sandbox_, however there is vulnerability
100
+
in the Groovy scripting engine that allows an attacker to construct
101
+
Groovy scripts that escape the sandbox and execute shell commands as the user
102
+
running the Elasticsearch Java VM.
103
+
104
+
Therefore in versions v1.3.8, v1.4.3, and version v1.5.0 and newer it has been disabled by default.
105
+
Alternatively you can disable dynamic Groovy scripts by
106
+
adding this setting to the `config/elasticsearch.yml` file in all nodes in the
107
+
cluster:
108
+
109
+
[source,yaml]
110
+
-----------------------------------
111
+
script.groovy.sandbox.enabled: false
112
+
-----------------------------------
113
+
114
+
This will turn off the Groovy sandbox, thus preventing dynamic Groovy scripts
115
+
from being accepted as part of a request or retrieved from the special
116
+
`.scripts` index. You will still be able to use Groovy scripts stored in files
117
+
in the `config/scripts/` directory on every node.
118
+
119
+
If your architecture and security is one that does not need worry about the vulnerability,
120
+
for example your Elasticsearch endpoints are only exposed and available to trusted applications,
121
+
then you can choose to re-enable the dynamic scripting if it is a feature your application needs.
0 commit comments