Enable ServiceNow to Guardrails Sync
Prerequisites
Associate Your ServiceNow Instance to Turbot Guardrails
Before you get started, if you have not already completed it, follow the Connect a ServiceNow Instance guide to associate your ServiceNow instance to Turbot Guardrails.
Turbot Guardrails Mods to Be Installed
Only the @turbot/servicenow mod needs to be installed in your Guardrails workspace. There are no additional mods required for this integration.
Set ServiceNow System Properties
ServiceNow Business Rules are automatically managed by Turbot Guardrails to set up event handlers to capture record changes (adds, updates, and deletes) within the tables in scope for the sync. As part of the Business Rules configuration, Turbot Guardrails stores its webhook URL in a ServiceNow System Properties object for an integrated retrieval mechanism from the Business Rules.
The following policies are associated:
ServiceNow > Config > System Propertiesdefaults toSkip, set toEnforce: Configuredto enable the auto-configuration.ServiceNow > Config > System Properties > Templateleave as the default.
The template provides flexibility for Guardrails to control additional system properties, but by default it is configured to manage the webhook URL. No changes to the template are necessary.
[!IMPORTANT] Make sure you set
ServiceNow > Config > System PropertiestoEnforce: Configuredso later steps are successful.
Sync ServiceNow Tables to Guardrails
Syncing data between systems is automated and continuous. Similar to how Guardrails captures cloud inventory and configs, any ServiceNow CMDB table can sync in real time as well.
Once you have your ServiceNow instance associated, enabling syncing of ServiceNow tables to your Guardrails workspace is simply setting one CMDB policy per applicable table.
There are three table policy types already pre-configured in the mod to get you started:
ServiceNow > Application > *syncs thecmdb_ci_appltableServiceNow > Cost Center > *syncs thecmn_cost_centertableServiceNow > User > *syncs thesys_usertable
Each policy type aligns to a ServiceNow table and defines whether the sync is enabled and whether ServiceNow Business Rules are enabled for event-driven updates of table record changes. For example:
ServiceNow > {ServiceNow Table} > CMDB- Enables the controls to sync the table to Guardrails.
- Defaults to
Skip. Setting the policy toEnforce: Enabledwill enable the sync to Guardrails immediately. - The Business Rule policy below will enable event handlers to capture ongoing changes.
ServiceNow > {ServiceNow Table} > CMDB > Query- Allows filtering of records synced from ServiceNow using a ServiceNow encoded query string. Paste the encoded query string as the policy value.
- If a query is applied, any existing records in Guardrails that do not match the query criteria will be deleted.
- The default value depends on the table: it is
""(empty string) forApplicationandCost Center, meaning no filter is applied. For theUsertable, the default is"active=true".
ServiceNow > {ServiceNow Table} > Business Rule- Configures ServiceNow Business Rules for event handling of table record changes (new, updated, and deleted records).
- Defaults to
Skip. Automatic setup and management of the policy is enabled by setting the policy toEnforce: Configured.
ServiceNow > {ServiceNow Table} > Business Rule > Name- The name of the Business Rule is configurable; defaults to
Guardrails Application Business Rule. Can be adjusted to fit your naming standards.
- The name of the Business Rule is configurable; defaults to
Example of Syncing the Application Table
To enable the sync for the Application table, set the following policies:
ServiceNow > Application > CMDBset toEnforce: Enabled.ServiceNow > Application > Business Ruleset toEnforce: Configured.ServiceNow > Application > Business Rule > Nameleave as the default.
[!NOTE] Remember to set your
ServiceNow > Config > System Propertiespolicy toEnforce: Configuredfrom the prerequisites section above.
[!NOTE] When setting the policies, select the resource scope at or above the level where your ServiceNow instance was imported. If you have set your instance at the Turbot level, set the policies at that level. If you imported the ServiceNow instance within a folder (e.g., Acme), set the policy at the Acme folder or higher (e.g., Turbot level).
Once the policies are set, you should now see the Applications brought into Guardrails under your ServiceNow instance.
Next Steps
- Additional context about the feature and a demo is in the announcement post ServiceNow + Guardrails: Context-aware cloud & security automation.
- Consider integrating Turbot Guardrails to ServiceNow. Follow the Enable Guardrails sync to ServiceNow guide to configure real-time syncing of cloud resources to your ServiceNow CMDB.
Troubleshooting
| Issue | Solution |
|---|---|
| No records appear after enabling sync | Verify the CMDB policy is set to Enforce: Enabled at the correct scope. Check the discovery control status in the Controls tab. |
| Records are not updating in real time | Verify ServiceNow > Config > System Properties is Enforce: Configured and the Business Rule policy is Enforce: Configured. Check the Activity tab for webhook-related events. |
| Too many records imported | Use the CMDB > Query policy to filter records with a ServiceNow encoded query string. |
| Further assistance | Open a support ticket or join the Slack Community. |