Configuring Script sandbox property
Summarize
Summary of Configuring Script sandbox property
Theglide.script.use.sandboxsystem property controls whether client-generated scripts, such as those sent via filters, queries, or the AJAXEvaluate API, run inside a restricted sandbox environment on the server. This sandbox limits script capabilities to enhance security by reducing rights and restricting certain backend operations.
Show less
By default, this property is enabled when the High Security Settings plugin is activated. It is not recommended to enable it independently outside of this plugin due to potential impact on script functionality and security considerations.
Key Features
- Scripts executed via filters or the AJAXEvaluate API run with reduced rights inside the sandbox.
- Only business rules marked Client callable and script includes marked Sandbox enabled are accessible within this sandbox.
- Direct database modification methods such as insert(), update(), and delete() are blocked, preventing data changes from sandboxed scripts.
- Certain GlideSystem (gs) and ScopedGlideSystem methods related to messaging, logging, and workflow execution are restricted.
- Starting from the Xanadu release, script includes must be explicitly marked as Sandbox enabled to be accessible inside the sandbox; the older Glide AJAX enabled (Client callable) flag is no longer sufficient.
- When upgrading from Washington DC or earlier to Yokohama, script includes with the Client callable flag are automatically marked Sandbox enabled to maintain compatibility.
Practical Implications for ServiceNow Customers
- Enabling this property improves security by isolating client-generated scripts and restricting potentially unsafe operations.
- Customers should ensure that only trusted, necessary business rules and script includes are marked Client callable or Sandbox enabled to control script access in the sandbox.
- Scripts that attempt to modify records or use restricted methods will have those actions ignored or blocked, which may impact functionality if previously allowed.
- Logging methods can be selectively enabled or disabled in the sandbox using the glide.security.sandboxnologging property.
- Understanding which methods are restricted helps in debugging and designing scripts that run successfully within the sandbox constraints.
Key Outcomes
- Enhanced instance security by running client-generated scripts in a controlled, reduced-rights environment.
- Prevention of unauthorized data modifications and restricted API usage from client-initiated scripts.
- Clear governance on which scripts and APIs are permitted in sandboxed execution, aiding compliance and risk management.
- Maintained backward compatibility during upgrades via automatic flag adjustments for script includes.
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 |
|