Connect a ServiceNow Instance

In this guide, you will connect a ServiceNow instance to Turbot Guardrails. The connection enables bi-directional sync between your ServiceNow CMDB and the Guardrails platform. You can import ServiceNow resources into Guardrails and push cloud resource data back into ServiceNow.

Connecting a ServiceNow instance involves two phases: preparing your ServiceNow environment with the required credentials, then importing the instance through the Guardrails Create Connection wizard.

Prerequisites

Step 1: Create a ServiceNow Application

Guardrails uses an application scope in ServiceNow to isolate Guardrails-related configuration (Business Rules, System Properties, etc.) from your other applications. You can use an existing application or create a new one.

To create a new application:

  1. Log into your ServiceNow instance as an administrator.
  2. Navigate to System Applications > Custom Applications (or search for "Custom Applications" in the All menu).
  3. Click New to create a new application.

Creating a new Custom Application in ServiceNow

  1. Enter a name for the application (e.g., Guardrails). Leave the Scope field empty. ServiceNow auto-generates it on save.
  2. Click Submit.

Custom Applications list showing the Guardrails application with its auto-generated scope

  1. Note the Scope value (e.g., x_1553127_guardrai). You will need this when connecting the instance in Guardrails.

Step 2: Create a Service Account

Guardrails authenticates to ServiceNow using a dedicated service account. Creating a separate account provides clear audit trails and scoped permissions.

  1. Navigate to User Administration > Users (or search for "Users" in the All menu).
  2. Click New to create a new user.
  3. Fill in the fields:
FieldValue
User IDguardrails_svc (or a name that fits your naming convention)
First nameGuardrails
Last nameService Account
ActiveChecked

Creating the Guardrails service account user

  1. Click Submit to create the user.
  2. Open the newly created user record and click Set Password. Generate or set a strong password and save it securely. You will need it when connecting in Guardrails.
  3. Click the Roles tab and click Edit. Add the admin role and click Save.

[!NOTE] We recommend the admin role for initial setup to avoid access constraints. Your team can evaluate more restrictive roles once the integration is working.

Step 3: Create an OAuth Application

Guardrails uses OAuth 2.0 (Resource Owner Password Credentials flow) to generate bearer tokens for API calls to ServiceNow.

  1. Navigate to System OAuth > Application Registry (or search for "Application Registry" in the All menu).
  2. Click New and select Create an OAuth API endpoint for external clients.
  3. Fill in the fields:
FieldValue
NameGuardrails OAuth Application
Accessible fromAll application scopes
ActiveChecked
Refresh Token LifespanDefault or per your preference
Access Token LifespanDefault or per your preference

The Guardrails OAuth Application in the Application Registry

  1. Click Submit to create the OAuth application.
  2. Note the Client ID and Client Secret. You will need both when connecting in Guardrails.

Step 4: Create a User Preference Row

Guardrails requires a row in the User Preferences table for the service account. There are two ways to create it:

Option A: Log into the ServiceNow instance as the service account. ServiceNow automatically creates the required row.

Option B: Manually create the row:

  1. In the All menu, search for User Preferences.
  2. Click New in the top right corner.
  3. Set the Name field to apps.current_app.
  4. Look up the service account in the User field.
  5. Click Submit. If ServiceNow requires a Value, any placeholder string will work. Guardrails updates it automatically.

Step 5: Open the Create Connection Wizard

Navigate to Accounts and click Create Connection. Select ServiceNow from the provider grid.

Create Connection page showing the provider selection grid with ServiceNow highlighted

The wizard opens to Step 1: Credentials.

Step 6: Enter ServiceNow Credentials

Fill in the credentials from the previous steps:

FieldDescription
Instance URLThe full URL of your ServiceNow instance (e.g., https://dev12345.service-now.com).
UsernameThe User ID of the service account you created.
PasswordThe password for the service account.
Client IDThe Client ID from your OAuth application.
Client SecretThe Client Secret from your OAuth application.
Application ScopeThe scope identifier from your custom application (e.g., x_1553127_guardrai).

ServiceNow Credentials wizard step with all fields filled in

Click Continue to proceed.

Step 7: Test the Connection

Click Test Connection to verify that Guardrails can authenticate and communicate with your ServiceNow instance. Guardrails validates the credentials, discovers the instance name and version, and lists installed applications.

Test Connection step showing a successful connection with instance details

If the test succeeds, you will see the instance name, version, and number of applications discovered. Click Continue.

[!NOTE] If the test fails, verify that your Instance URL is correct, the service account is active with the admin role, the OAuth application is active, and the Client ID/Secret are correct.

Step 8: Choose the Destination Folder

Select where to place the ServiceNow instance in your Guardrails resource hierarchy. You can select the root Turbot level or any existing folder.

Destination Folder step with the folder selector

Click Continue to proceed.

Step 9: Review and Create the Connection

Review your configuration. The summary shows your credentials (with passwords and secrets masked), instance details from the test step, and the destination folder.

Review step showing the full configuration summary before import

Click Create Connection to import the ServiceNow instance. Guardrails creates the instance resource, stores your credentials as policies, and begins discovering resources.

Step 10: Verify the Import

After the import completes, Guardrails navigates to the instance overview page. You will see the instance name, controls being initialized, and policies being set.

ServiceNow instance overview page showing discovery in progress

The ServiceNow > Config > * policies are now set for your instance. Under the Policies tab, you can see the stored credentials and configuration.

Next Steps

Troubleshooting

IssueSolution
Test connection fails with authentication errorVerify the service account is active, has the admin role, and the password is correct. Check that the OAuth application is active with the correct Client ID and Secret.
Test connection fails with network errorVerify the Instance URL is correct and accessible from the Guardrails workspace. Check for any firewall or network restrictions.
Instance is hibernatingServiceNow developer instances hibernate after inactivity. Wake the instance by logging in through the ServiceNow portal, then retry the test.
App Scope Valid shows "No"This is informational. It means the specified application scope was not found among the discovered applications. The import will still succeed. The scope is used to isolate Guardrails-managed objects (Business Rules, System Properties) in your ServiceNow instance.
Controls stuck in TBDAfter import, controls take a few minutes to initialize. If they remain in TBD after several minutes, check the Activity tab for errors.