OBLYTECH Logo
OBLYTECH Logo

Credential-less Host Discovery in ServiceNow

Credential-less host discovery is the fallback ServiceNow Discovery uses when a live host cannot be classified with credentials. A MID Server running Nmap gathers basic facts such as a reverse DNS name and the operating system family, and the platform creates or updates a host record in the Hardware table.

When the fallback starts

Two conditions start it. The first is a host the scan finds alive but not active. The second is a host where all configured credential-based classification probes have failed. Both lead to the Credentialless Discovery Network Device pattern, which collects what it can without a login.

The route depends on whether the host already has a configuration item. When the Shazzam probe finds a live but inactive host and credential-based classification fails, horizontal Discovery launches the pattern directly. When the scanned host has no CI yet, Service Mapping launches the HorizontalDiscoveryProbe, and that probe launches the pattern. Either way, the pattern creates a host CI or updates an existing one in the Hardware [cmdb_ci_hardware] table.

Credential-less discovery applies when a credential is missing or misconfigured. When the credential problem is fixed and Discovery runs again, the credentialed run updates the host CI the fallback created. For background, see the connection and credential alias guide.

Where the fallback sits in horizontal Discovery

Horizontal discovery runs in four phases: scanning, classification, identification and exploration. Credential-less discovery is the branch taken when the credential-based classification probes fail.

Switching the pattern on and off

One system property controls the behaviour: mid.discovery.credentialless.enable. The pattern does not launch unless this property is true, and setting it to false disables the pattern. It is installed with the Discovery plugin, enabled by default, and changeable by a system administrator. It applies to all MID Server instances that have Nmap installed and connect to the instance, so it is the switch to use when collection needs to pause across the estate. For the scheduling side, see the discovery schedule explainer.

A second property, mid.discovery.credentialless.alt_port_options, sets the port range. From Discovery and Service Mapping Patterns version 1.31.0, F selects Nmap fast mode, which covers the top 100 ports, and T selects the top 1,000 ports, the Nmap default.

What Nmap returns during a host scan

The MID Server passes the target IP address and a port list to Nmap. A host counts as up when the port state returned is open or open/filtered. Nmap then performs reverse DNS on the address. When several names come back, the first one is used. When none is configured, the IP address becomes the basis for the CI.

Npcap, the packet capture library installed with Nmap, lets Nmap identify the operating system family. If the scanned host sits on the same subnet as the Windows MID Server running Nmap, its MAC address is returned as well.

Data How it is obtained How the pattern uses it
Host status Port state open or open/filtered Decides whether the host continues
Host name First reverse DNS result Names the CI; IP address is the fallback
Operating system family Identified through Npcap Chooses the server class of the host CI
MAC address Same-subnet hosts only Returned when the condition is met

Choosing which ports Nmap scans

The port list is held in the IP Service [cmdb_ip_service] table, which can be edited. By default all ports are available. To block a port, set the Credentialless Discovery [cl_discovery] column on its record to false. Blocking a port narrows what Nmap can learn, so a port carrying the main signal for a device type should stay enabled unless there is a specific reason to block it.

Nmap options that shape each scan

The table covers the options that matter most when troubleshooting a scan.

Option What it does Privilege required
-PS TCP SYN host discovery; a SYN/ACK or RST reply means the host is online Raw packet privileges; root on UNIX, administrator on Windows
-PA TCP ACK host discovery; port 80 is used when no list is given Same as -PS
-sS Default TCP SYN port scan; ports reported as open, closed or filtered Raw packet privileges
-O OS detection by TCP/IP stack fingerprinting, without NSE scripts Same as -PS
-sV Service, product and version detection No raw packet privileges needed
-Pn Skips the default ping and treats the listed hosts as up None listed

The -PA probe can get past stateless filters that block SYN probes, but stateful firewalls drop the unexpected ACK packets. OS detection runs after version detection, which helps its accuracy, but the two results can still disagree.

How host CIs are created or updated

After a successful pattern run, the SetCredentialLessDeviceClassName MID Server script identifies the operating system family. The class follows from that family.

OS family CI table
AIX cmdb_ci_aix_server
HP-UX cmdb_ci_hpux_server
Linux cmdb_ci_linux_server
Solaris cmdb_ci_solaris_server
OS X or iOS cmdb_ci_osx_server
Windows cmdb_ci_win_server
Undefined cmdb_ci_hardware

Matching one of the six supported server families produces a server class derived from the Hardware base class, such as Linux Server. Anything else stays on the base class. Routers and switches are classified as hardware, and credential-less discovery does not create CIs specific to them.

The Discovery – IP Based plugin adds an identifier to the Hardware Rule that matches on the host CI name for Nmap scans. The same rule serves credential-based and credential-less discovery. The credentialed run uses the serial number, host name and system class it returns to update the host CI that the fallback created. The record is updated, not duplicated.

Application records follow a stricter path. No application CI is created when the service name ends with a question mark, because Nmap is guessing. None is created either when the product or service name is empty, or when the name is absent from Nmap’s static nmap-services file. Created records carry the CredentiallessDiscovery choice in the Discovery source [discovery_source] field of the Configuration Item [cmdb_ci] table.

Preparing MID Servers and Nmap

Nmap must be installed on each Windows MID Server that will run credential-less discovery, by a user with the agent_admin role. The MID Server should be in Up status, validated, and not yet hold the Nmap capability. For general setup, see the MID Server guides.

The install path is the first practical trap. It must not contain parentheses, curly braces or square brackets. The installer converts those characters to spaces, cannot find the correct path, and the install fails. A path such as C:\MIDServers\MID(1)\agent fails for this reason. Admin rights are needed only for the install itself. Once Nmap is present, non-admin users can run credential-less discovery.

To enable it, open the MID Server record from the Servers list, choose Enable Credential-less Discovery under Related Links, and confirm. The installer runs from the ServiceNow installer host, and the Logs tab shows the running system command. Npcap installs too if it is absent. A newer Npcap already on the host is kept, and an older one is upgraded.

Selection mode matters as much as installation. A specific MID Cluster needs Nmap on each member that reaches the same ranges. Auto-Select needs Nmap on at least one eligible server. A specific MID Server needs Nmap on that server. Service Mapping does not check for the capability and picks a server by IP address alone, so installing Nmap on all MID Servers that reach the schedule’s ranges avoids an error on the map. For how the two tools differ, see the Discovery and Service Mapping comparison. For how a server connects to the instance, see the MID Server explainer.

Limits and environments where it does not fit

Use credential-less discovery only on known subnets where credentials are not viable, and not as a long-term approach. The credential side of that decision is covered in the discovery credential governance article.

Cloud platforms need separate thought. Nmap scans against resources in AWS, Microsoft Azure, IBM Cloud or Google Cloud Platform often conflict with provider terms, so credential-less discovery is not appropriate inside those environments. In AWS, testing is limited to EC2 and RDS instances the customer owns, within an approved time window. A violation can lead to removal from the service.

Frequently asked questions

Does credential-less discovery replace credential-based discovery?

No. It collects basic information while credentials are missing or failing.

Do I need Nmap on every MID Server?

Not necessarily. It depends on the selection mode. A specific MID Server needs Nmap on that server, Auto-Select needs at least one eligible server, and a specific MID Cluster needs each member that reaches the same ranges. Service Mapping needs Nmap on all MID Servers that reach the schedule’s ranges, because it does not check the capability.

Why did a discovered service not become an application record?

Nmap has to return a usable name. A service name ending with a question mark, an empty product or service name, or a name missing from the static services file all prevent an application CI from being created.

How do I stop the fallback across the whole estate?

Set mid.discovery.credentialless.enable to false. The property applies to all MID Server instances with Nmap installed that connect to the instance. Removing Nmap is a separate job on each MID Server.

Planning a rollout that includes this fallback

If you are planning a Discovery rollout that uses this fallback, settle which subnets are in scope, which MID Servers can reach them, and where Nmap will be installed before anything runs. The ServiceNow Discovery Implementation page is the place to start that conversation.