OBLYTECH Logo
OBLYTECH Logo

CI Lookup Rules in ServiceNow: How Records Get Matched

CI lookup rules in ServiceNow decide which configuration item incoming data belongs to. Two features share the name. Lookup identifier entries sit inside CMDB identification rules and match through a related table that references the CI. The CI Lookup Rules module under Security Operations matches scanner and application data to CMDB records using field matching or a script.

Two features share the name

The first sits in the CMDB itself. An identification rule belongs to a CI class and contains identifier entries. An identifier entry can be regular, lookup or hybrid. The lookup flavour lets the Identification and Reconciliation Engine (IRE) find a CI by looking at records in a related table instead of fields on the CI row.

The second is a module in Security Operations, reached through All > Security Operations > CMDB > CI Lookup Rules. These rules take the host or application details that arrive from a vulnerability scanner or integration and work out which CMDB record they describe. In the Application Vulnerability Response (AVR) version, the rules identify applications and application releases and add them to the application vulnerable item record so remediation has a target. In the Vulnerability Response version, they match host information from third-party scanner imports against discovered items, unmatched configuration item classes and the CMDB.

The two share a purpose, matching, and little else: different menus, roles and form fields.

How identification rules are built

Each CMDB class is associated with a single identification rule. A rule has one CI identifier, one or more identifier entries, and optionally related entries, and each entry carries a priority. An identifier entry defines a set of criterion attributes that uniquely identify a CI, for example Serial Number, Serial Number Type or Name.

Priority is the ordering mechanism. Lower numbers are evaluated first, and entries that share a priority are applied in random order. Gaps in the numbering are allowed, which means a new entry can be slotted in later without renumbering the rest. Give the strongest identifier entries, along with their related entries, the highest priority, which means the lowest numbers.

A rule has one or more identifier entries.

Regular, lookup and hybrid identifier entries

The three entry types answer one question: where do the identifying attributes live?

Entry type Where the attributes come from Typical use
Regular The CI’s own table A name, or a serial number held on the CI
Lookup A related table that references the CI Identifiers stored as separate records, such as serial number records
Hybrid Both the main table and a lookup table Cases where the lookup alone leaves two CIs indistinguishable

A lookup entry’s table needs a reference field that points to the cmdb_ci table or one of its descendants. If the lookup records do not exist when a CI is processed, they are inserted into the referenced lookup table.

A lookup entry on the Hardware class can use a Serial Number table with Serial Number and Serial Number Type as criterion attributes. If the lookup records do not exist yet, they are inserted into that table.

Hybrid entries cover cases where a lookup alone is ambiguous. Two virtual machines can carry identical serial numbers. A Hardware lookup on Serial Number and Serial Number Type cannot separate them, but adding the Name field from the main Hardware table makes each one unique. On a hybrid entry, the allow-null option is fixed to false, so all criteria attributes chosen from both tables must carry a value.

Settings that change how a lookup entry matches

When you add a lookup entry in CI Class Manager, a few options decide how forgiving the match is.

Enforce exact count match. When enforced, a CI matches when all lookup records in the payload point to the same CI in the lookup table. If several CIs still qualify, the oldest-created one is chosen. When it is not enforced, a single matching lookup record suffices, and the engine picks the CI with the highest count of matching lookup records, falling back to the oldest CI if the count ties.

Advanced options. A filter that narrows which records are searched. It becomes available when the system property glide.identification_engine.enable_identifier_optional_condition is set to true; the default is false.

Where to create the rule

Identification rules are edited in CI Class Manager. Go to All > Configuration > CI Class Manager, open Hierarchy, pick the class, expand Class Info and choose Identification Rule. From there you can edit, add or replace the rule. Replace is the option for a class that inherits its rule.

The itil role gives read access to identification rules, and itil_admin gives full access.

A child class with no explicit rule derives the parent’s rule, including its identifier and related entries. Creating a rule on the child overrides the derived one, so any parent entry still needed must be added again.

Independent rules and dependent rules

An independent rule identifies a CI from its own attributes. A dependent rule identifies the CI after its parent has been identified. A dependent CI can have only a single parent CI with dependency.

Guidelines for clean identification rules

Several habits keep identification clean:

  • Use a lookup identifier entry when the identifying values live in a related table. Prefer a regular entry built on the CI’s own attributes where that is enough.
  • Avoid conflicting rules. A Hardware lookup rule for Network Adapter plus a CI identifier for Network Adapter can produce duplicates, because the two rules use different criteria.

The CI Lookup Rules module in Security Operations

This is the second feature, and its form works differently. Open All > Security Operations > CMDB > CI Lookup Rules, select New and complete the form. The application version requires the App-Sec Manager group; the Vulnerability Response version requires the sn_vul.vulnerability_admin role.

Field What it does
Name Names the rule
Lookup method Script (pre-built, such as IP address or DNS name, or custom) or Field matching, which searches a CMDB table or field
Type The script type, used with the Script method
Order Sets precedence; rules with the lowest order run first
Active Enables or disables the rule
Source and Source field The input to the rule
Condition When the rule applies; depends on the attribute the third-party scanner sends
Search on table The CMDB table searched to locate the CI
Search on field The field in that table matched against the source value
Applies to Discovered Item (Vulnerability Response) or Discovered Application (Application Vulnerability Response)

The Applies to field has no default value. For integrations that support both applications, such as the Wiz integration, set it on each rule. Leaving it empty means the background jobs for both applications act on the same rules, which can cause conflicts and set the reapply flag incorrectly.

Script rules start from a template whose process function takes three parameters: rule, sourceValue and sourcePayload.

For changes, copy an existing rule and edit the copy, then deactivate the original once the copy works. Deactivate rather than delete, because removed rules cannot be recovered.

Frequently asked questions

What is a lookup identifier entry?

It is an identifier entry that identifies a CI through a related table instead of through fields on the CI’s own table. The related table needs a reference field pointing to cmdb_ci or one of its descendants.

What is the difference between a lookup and a hybrid entry?

A lookup entry uses attributes from the related table alone. A hybrid entry combines those with attributes from the main table, which helps when lookup values such as serial numbers are identical across different CIs.

Which rule runs first when several apply?

In identification rules, lower priority numbers take precedence. In the Security Operations CI Lookup Rules module, the rule with the lowest order value is evaluated first.

When does a lookup entry fit?

A lookup entry fits when the identifying values sit in a related table. Where the CI’s own attributes are enough, a regular entry does the job.

Should I edit an existing CI lookup rule in Security Operations?

Copy it and edit the copy. Once the copy behaves as intended, deactivate the original. Deleted rules cannot be recovered.