Skip to main content

Windows Credentialed Scanning: Setup Guide

Audience​

The domain administrator who prepares Windows hosts so Cyprob EE can log in and read their patch and configuration state.

What Cyprob Needs​

Cyprob talks to Windows over WinRM only. It does not use SMB, WMI, RPC or the Remote Registry service, so none of those need to be opened or enabled for it. You prepare four things: a WinRM listener, a firewall rule, a dedicated account and, for one kind of account, one registry value.

Choose a Transport​

Each credential in Cyprob uses one transport. Both are available.

HTTPS, port 5986Sealed HTTP, port 5985
Use it whenyou can issue a listener certificate from an internal CAyou cannot issue certificates
Host identityverified against the CA you upload in the credentialnot verified
Certificaterequired on every hostnone
ProtectionTLSthe login is NTLM and everything after it is encrypted by NTLM message sealing

Prefer 5986 where you can. Choose 5985 sealed only where a listener certificate cannot be issued, and read the notes the credential form shows before saving it. Cyprob never falls back from one transport to the other: a credential is tried on its own port only.

Setup​

1. One Group Policy Object​

Create one GPO linked to the OUs that hold the hosts to scan, under Computer Configuration:

  1. Policies > Administrative Templates > Windows Components > Windows Remote Management (WinRM) > WinRM Service: enable Allow remote server management through WinRM and set the IPv4 and IPv6 filters to * (the filter names the host's own addresses the listener binds to, not who may connect; the firewall rule in step 3 limits who may connect). Leave Allow unencrypted traffic disabled (the default): Cyprob requires encryption on both transports.
  2. Windows Settings > Security Settings > System Services: set Windows Remote Management (WS-Management) to Automatic.

Windows Server 2012 R2 and later already run the service with a listener on 5985. Workstations get theirs from this GPO.

2. The listener​

  • 5985: nothing more is needed on a default Windows Server. On a workstation the GPO above creates it.

  • 5986: the HTTPS listener has no native Group Policy setting. Enroll a computer certificate with the Server Authentication purpose through auto-enrollment, then create the listener with a startup script in the same GPO:

    New-Item -Path WSMan:\localhost\Listener -Transport HTTPS -Address * `
    -CertificateThumbprint <thumbprint of the host's certificate> -Force

    Which name Cyprob verifies that certificate against is described in Certificate Names on 5986 below.

3. The firewall rule​

In the same GPO, under Windows Defender Firewall with Advanced Security > Inbound Rules, add a rule that allows TCP 5986 (HTTPS) or TCP 5985 (sealed HTTP) from the scan node addresses only, on the Domain profile. The built-in Windows Remote Management rule accepts, on public networks, connections from the same subnet only: it is not a substitute for this rule.

4. The account​

Use one dedicated domain account (for example CORP\svc-cyprob-scan):

  • Add it to the local Administrators group on the scanned hosts with Group Policy Preferences, Local Users and Groups, action Update (an Update adds the account and leaves the other members alone).
  • Deny it interactive logon: User Rights Assignment, Deny log on locally and Deny log on through Remote Desktop Services.
  • In Active Directory Users and Computers, tick Account is sensitive and cannot be delegated.
  • Give it a long random password and rotate it on your own schedule. Update the credential in Cyprob when you do.
  • Do not put it in the Protected Users group, and make sure your NTLM restrictions allow this account to these hosts. Cyprob connects by address, so it authenticates with NTLM on both transports; an account that cannot use NTLM is rejected.

Cyprob stops using an account after two rejected logins within 30 minutes, scans and credential tests together, so a wrong stored password cannot lock the account. If your lockout threshold is two or lower, tell your Cyprob contact before you start.

5. Local accounts: one extra value​

A host outside the domain can use its built-in Administrator account. Any other local account, even one in the local Administrators group, is refused by Windows' remote token filter after a successful login, and Cyprob sees that as a rejected login. Set this value on the host to let it through:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
LocalAccountTokenFilterPolicy DWORD 1

This lowers a protection you may want to keep, and the filter does not apply to domain accounts. Prefer the dedicated domain account.

Certificate Names on 5986​

Cyprob connects to a host by its address, and a listener certificate that Windows auto-enrolls carries the host's DNS name, not its address. Cyprob therefore verifies the certificate against a name it takes from a source the scanned host does not control, and verification is never turned off. It uses the first of these that applies:

  1. The credential's Certificate name, when you set it. Use it for a credential that covers one host.
  2. The name you gave as the scan target, when the scan has exactly one target and that target is written as a host name (for example dc01.corp.example). The certificate must chain to your CA and carry that name.
  3. The credential's Certificate name suffix, for a credential that covers a domain, when no certificate name is given. The form says: "For a credential that covers a domain rather than one host, when no certificate name is given. A host's certificate is accepted only if it chains to the certificate authority below and carries a name that ends with this suffix and resolves, in this appliance's DNS, to the address being scanned, or is issued to that address itself. When a scan target is written as a host name, that name is used instead. It proves "a machine of this domain, certified by this CA", not "this machine". Not together with a certificate name." A suffix starts with a dot and has at least two labels, such as .corp.example.com.
  4. Neither: the address. The certificate must then carry the address itself, and an auto-enrolled certificate does not, so the login is refused as a certificate failure before any credential is sent.

What each path proves:

PathCyprob checksWhat it proves
A certificate issued to the addressthe certificate chains to your CA and carries the addressthat address presented a certificate your CA issued for the address
A scan target written as a host namethe certificate chains to your CA and carries that namethis host, by the name you gave
A name suffixthe certificate chains to your CA and carries a name under the suffix that resolves forward, in the appliance's DNS, to the addressa machine of this domain, certified by your CA, not this machine: a certificate for another host of the domain, with a DNS record pointing at the address, passes

Cyprob never takes the name from the host itself: reverse DNS, NetBIOS and the name inside the certificate are not used as the name to verify against. Where you can, scan Windows hosts by name: it is the only path that verifies which host answered. The name suffix needs the appliance's DNS to resolve your hosts' names.

Check Before the First Scan​

In Cyprob, create a Windows (WinRM) credential: the account (CORP\user or [email protected]), the account type, the transport and port, the certificate authority as PEM text and, if you need one, a Certificate name or a Certificate name suffix for 5986, and the scope (the prefixes or addresses it may be offered to; it is required). Save it, then use Test this credential against one host of each kind. The test is a real login and counts toward the two-rejection limit.

Cyprob saysUsual causeWhat to do
The host refused the connectionno listener on that portcheck the GPO, the service and the listener on the host
The host did not answer in timea firewall between the scan node and the hostopen the port from the scan node address
The certificate did not verifythe certificate is not signed by the CA in the credential, or carries no name Cyprob can verify (see Certificate Names on 5986)upload the issuing CA, scan the host by name, or set a Certificate name or Certificate name suffix
The listener demands channel binding / refused encryptionthe host's WinRM policyuse the 5986 transport, or change the policy on the host
The host rejected the account name or passworda wrong password, or a local account blocked by the token filtercheck the password; for a local account other than Administrator, set the registry value above
The account is locked, disabled or its password expiredthe account statefix it in Active Directory, then test again
The login worked, but the account lacks the rightsthe account is not a local administrator on that hostadd it to local Administrators

Attach the Credential to a Scan or a Policy​

A credential does nothing until a scan or a scan policy carries it. If your role may view credentials:

  • New scan: in the scan settings, the Windows credential (WinRM) picker lists your Windows credentials. None keeps the scan from logging in to Windows hosts.
  • Scan policy: on the policy's edit page, in the Credential section, the same pickers.

A scan that carries a Windows credential always probes that credential's own listener port, 5985 for sealed HTTP or 5986 for HTTPS, whatever its port strategy, so the Well-known strategy no longer hides the Windows hosts. That is one more port per target. The credential is offered only to hosts inside its scope.

Host Identity on 5986​

  • First login records a key. The first successful login over 5986 records the key of the certificate the host presents, per address and port. Hosts you logged in to before the upgrade get their record at their first login afterwards, so trust is placed at that first contact, which is why the certificate-name rules above matter.
  • A renewal is accepted. A new certificate with another key is accepted automatically, and audited, when it chains to the same CA and carries the same names as the recorded one.
  • Any other change is refused. A different key that does not meet that rule is refused as host_identity_changed before any credential is sent. It does not count toward the account's rejection limit.
  • You accept a change in the credential test. When Test this credential is refused as host_identity_changed, the result explains that the key the host presented before is not the one it presents now, and nothing was sent to it. Look at what the host presents shows the Recorded key (SHA-256) and the Key presented now (SHA-256). If the certificate names are unchanged, it says this looks like a renewed certificate: the next successful login records the new key and there is nothing to accept. Otherwise Accept the new key asks you to confirm, probes the host again (it must still present that key), and records the change in the audit log with both keys and your name. Accept only a change you expect, such as a reinstalled host or a replaced certificate key. You need permission to update credentials.
  • A host verified only by the name you gave cannot be reached from that screen, because the screen sends the address only. Use the API with the permission to update credentials: POST /api/v1/orgs/{org_id}/credentials/{id}/host-identity/inspect with {"host": "10.0.0.20", "host_name": "dc01.corp.example"} shows the recorded key and the one the host presents, and writes nothing. POST .../host-identity/accept with {"host": "10.0.0.20", "host_name": "dc01.corp.example", "spki_sha256": "<hash from inspect>"} records it. The same two calls without host_name work for the other hosts.
  • The name check comes first. If a credential still names a host name (Certificate name) that the new certificate does not carry, the login is refused by the certificate-name check as a certificate failure (the test says the host's certificate did not verify) before the host identity is reached. Correct or clear the name on the credential.
  • Sealed HTTP on 5985 has no certificate, so it has no record.

Evidence​

  • Cyprob has no SMB, WMI or RPC client; its Windows transport is WinRM with the two listeners above.
  • Certificate-name verification, the scan always probing the credential's port, and the picker on scans and policies are part of the product. With no name given, the check fails on an address mismatch; with the name you supply, it passes when the certificate carries that name; with a wrong name, it fails.
  • Windows Server 2012 R2 and later run PowerShell remoting by default on 5985; the default firewall rule on public networks accepts the same subnet only (Microsoft Learn: Security considerations for PowerShell Remoting using WinRM). Configuring WinRM through Group Policy is documented in Installation and configuration for Windows Remote Management.
  • On a Windows Server 2022 host, the built-in Administrator logs in over 5985 with sealed NTLM on default settings, with nothing enabled beyond the listener the server already has. Another local account in the Administrators group is refused with HTTP 401 until LocalAccountTokenFilterPolicy is set to 1; once it is, the same account holds administrator rights.
  • Over 5986, the first login records the certificate's public-key hash (SHA-256) and later logins compare against it. A different key with different names is refused as host_identity_changed before any credential is sent. Accepting the presented key lets the next test log in, and the audit log carries both keys.
  • When a certificate is renewed, a new key with the same names and the same certificate authority is accepted, the record is rewritten and the audit log shows a renewal with both keys. A certificate with different names is refused as host_identity_changed and the record is left as it was. A credential that still names the old host name is refused earlier, by the certificate-name check.

Limitations​

  • The steps for a domain account over 5985, for auto-enrolled certificates on a Windows host over 5986, and for Windows 11 hosts follow Microsoft's documentation above.
  • The operator's name is carried only when a scan has exactly one target written as a host name. A scan of several hosts relies on the name suffix, or on certificates that carry the address.
  • Cyprob uses NTLM on both transports. If your policy blocks NTLM towards the scanned hosts, the login is rejected until an exception exists for the scan account.
  • The credential test screen accepts a changed key only for a host reached by its address; a host verified only by the name you gave is accepted through the API.
  • A credential is offered only to hosts inside its scope.
  • A renewal is judged against the CA of the credential that makes the login, not against a CA stored in the host's record. If two credentials with overlapping scopes carry two different CAs, a certificate from either CA that carries the recorded names counts as a renewal. Keep one CA for each range of addresses.

Next Action​

Prepare one test host with this page, create the credential and run Test this credential. When it reports the login worked, link the GPO to the OUs you want scanned.