Configuring Script sandbox property
Summarize
Summary of Configuring Script Sandbox Property
The script sandbox property (glide.script.use.sandbox) enables the execution of client-generated scripts within a restricted environment, enhancing security by limiting access to system resources. This property is enabled by default when the High Security Settings plugin is activated and should not be enabled outside of this context.
Show less
Key Features
- Client-generated scripts run in a reduced-rights sandbox.
- Only business rules marked as Client callable and script includes marked as Sandbox enabled are accessible.
- Certain API calls related to direct database access are disallowed, including data manipulation methods like insert, update, and delete.
- Starting with the Xanadu release, script includes previously marked as Client callable are no longer accessible unless marked as Sandbox enabled.
Key Outcomes
By utilizing the script sandbox property, ServiceNow customers can ensure that client-generated scripts operate securely without compromising the integrity of their system. This reduces the risk of unauthorized data manipulation and enhances overall system security. Customers should be aware of restricted methods when using the sandbox to avoid errors in their scripts.
Enable the script sandbox property (glide.script.use.sandbox) to run client-generated scripts inside a sandbox that has restricted rights.
There are two cases within the system that allow the client to send scripts to the server for evaluation.
- Filters or queries: It’s legal to send a filter to the server such as:
assigned_to=javascript:getMyGroups(). - System API: The API call AJAXEvaluate allows the client to run arbitrary scripts on the server and receive a response.
- Only those business rules marked Client callable are available within the sandbox.
- Only script includes marked Sandbox enabled are available within the sandbox.
- Certain API calls (largely but not entirely limited to those dealing with direct DB access) aren’t allowed.
- Data can’t be inserted, updated, or deleted from within the sandbox. Any calls to current.update(), for example, are ignored.
| Property | Description |
|---|---|
| glide.script.use.sandbox | Run client-generated scripts (AJAXEvaluate and query conditions) inside a reduced-rights "sandbox." If true, only those business rules with the Client callable option selected and script includes with the Sandbox enabled option selected are available and certain back-end API calls are disallowed.
|
Restricted methods with sandbox enabled
These methods aren’t supported in client-generated scripts when script sandboxing is enabled.
If you run the system without script sandboxing enabled, then none of these restrictions apply.
| Class | Method |
|---|---|
| GlideRecord |
|
| GlideSystem (gs) |
|
| ScopedGlideRecord |
|
| ScopedGlideSystem (gs) |
|
| GlideDate GlideDateTime GlideTime |
|
| GlideSchedule |
|