Module
OpenCRQ
How-to guide

Import assets from Microsoft Defender

Fill OpenCRQ's attack surface with the devices, accounts and software vulnerabilities Microsoft Defender sees, rated for criticality and exposure, and kept in step every six hours.

OpenCRQFor administrators, platform engineers and risk managers

The attack run of OpenCRQ only uses the techniques your estate exposes, so the price of a scenario is as good as the inventory behind it. The Microsoft Defender connector imports that inventory from Microsoft Defender for Endpoint, Microsoft Entra ID and Intune, through the Microsoft Graph API: your devices with the CVEs Defender finds on them, the accounts of your directory, and who uses which workstation. It rates each one's criticality and exposure from what Defender knows, and keeps them in step on a schedule. This page registers the application in Microsoft Entra ID, gives its credentials to OpenCRQ and turns the connector on. For how assets weigh in the price, read How OpenCRQ quantifies risk.

What the connector imports

The connector writes supporting assets and findings. Each run reads everything again, not only what changed.

Devices. Every device in Defender's retention window, with or without a vulnerability, since Defender keeps matching new CVEs against the last software inventory of a device that went offline. Each comes with its name, its IP and MAC addresses from its latest snapshot, its operating system release and full version, its vendor, model and subtype (switch, router, smartphone...), which refines its subcategory. A device with no name is kept and shown under a name built from its vendor, model and address.

  • Exposure follows Defender's internet-facing flag: internet facing, internal, or unknown when Defender does not say.
  • Criticality is the highest that applies: very high for a domain controller, a certificate services, federation services or Entra Connect server; high for a hypervisor or a backup server; the asset value set in Defender (very high, high or low); or one band below its primary user's (see Primary users): high under a very high account, medium under a high one, nothing under medium or below, as The criticality a device takes from its user explains. A criticality set by hand on the device outranks them all. The role names no rule rates are written in the run's log.

Software vulnerabilities. One finding per device and CVE, with the CVSS score Defender gives, whether an exploit is available, and the software that carries it. A CVE Defender stops reporting on a device is dismissed as No longer reported by Microsoft Defender. CVE details then come from the public CVE sources.

Accounts. The accounts Defender's identity inventory and logon events show over the last 30 days. Their criticality is the highest of:

  • their directory roles, active or eligible: very high for the roles that can grant any other, such as Global Administrator, Privileged Role Administrator or User Administrator; high for Global Reader, Security Operator, Security Reader and any other administrator role,
  • the privileged groups their logon tokens carry: very high for Domain, Enterprise and Schema Admins, high for Group Policy Creator Owners, medium for Cert Publishers,
  • the criticality level Defender gives the account.

Computer accounts, whose name ends in $, and service identities such as SYSTEM are not imported. Neither is a disabled account that carries no display name, user principal name, account name or SID: each run removes the ones a previous run left, unless someone added something to them by hand.

Primary users. The person each workstation is assigned to, from Intune first, then from the registered owner in Entra ID. Without these sources, the run succeeds and no workstation gets a primary user.

A machine that OpenAEV also reports becomes one asset when OpenCRQ recognizes it in both reports: see How OpenCRQ recognizes one asset in two reports and Import OpenAEV results.

Before you start

  • In OpenCRQ, your role has the Manage Security capability.

  • In Microsoft Entra ID, an app registration with a client secret, and these Microsoft Graph application permissions, each with admin consent:

    PermissionRequiredWhat it readsWithout it
    ThreatHunting.Read.AllYesAdvanced Hunting: devices, vulnerabilities, accounts and logon eventsThe run fails
    Device.Read.AllNoEntra devices and their registered ownersNo workstation gets a primary user from Entra ID
    DeviceManagementManagedDevices.Read.AllNoIntune managed devices and their primary userPrimary users come from Entra ID alone

Give OpenCRQ the credentials

The credentials are not stored in OpenCRQ's database: the deployment sets them per tenant, keyed by the tenant's id, the first segment of the address of OpenCRQ once you are signed in to that tenant. The connector turns available for a tenant once all three are set. Set them together: with one or two set, OpenCRQ does not start, and the error it stops on names the missing key under connectors.microsoft_graph.<tenant-uuid>.

VariableWhat it holds
CONNECTORS__MICROSOFT_GRAPH__<tenant-uuid>__AZURE_TENANT_IDThe ID of your Microsoft Entra tenant
CONNECTORS__MICROSOFT_GRAPH__<tenant-uuid>__CLIENT_IDThe application (client) ID of the app registration
CONNECTORS__MICROSOFT_GRAPH__<tenant-uuid>__CLIENT_SECRETIts client secret. Pass it through a secret store

With none of them set, the Microsoft Defender card stays on the Available tab of Integrations, and its page reads Unavailable:

OpenCRQ 0.261123.0

See the configuration reference.

Turn the connector on

  1. Open Integrations, stay on the Deployed tab, and click the Microsoft Defender card, under Vulnerability. Its state reads Not configured.
  2. Click Configure.
  3. Under Service account, keep Create a new service account, named Microsoft Defender connector by default, or choose Use an existing service account. The new account is created with the integration, in the Connectors group; a tenant with no account to reuse offers it alone. The connector writes the assets and findings as this account.
  4. Under Schedule, keep Every 6 hours in Frequency, or choose another: from Every hour to Every week, or Manual only. A run reads the whole estate, which takes minutes on a large tenant: run it more often only if the estate changes faster.
  5. Click Save, then Sync now to run it without waiting for the schedule.

A run stops after 30 minutes, and a failed run is tried again, up to 3 attempts. The Works tab lists the runs in progress and the completed ones. A primary user source that refuses for lack of consent, or does not answer, such as Intune on a tenant without its license, does not fail the run: the primary users it named stay as they were.

ExampleImport Grand Meridian's hotels from Defender

Grand Meridian Hotels manages the workstations of its front desks and the servers of its booking platform in Microsoft Defender for Endpoint, and assigns each front-desk workstation in Intune. The risk manager wants the booking servers that face the internet, and the CVEs on them, in the attack surface of Grand Meridian France.

In Microsoft Entra ID, the administrator registers the application OpenCRQ Defender connector, creates a client secret, and grants ThreatHunting.Read.All, Device.Read.All and DeviceManagementManagedDevices.Read.All with admin consent. The platform engineer sets the entry of Grand Meridian's tenant, 01a043da-ff47-72c2-aaa4-7da56d85c83e:

services:
  opencrq:
    environment:
      - CONNECTORS__MICROSOFT_GRAPH__01a043da-ff47-72c2-aaa4-7da56d85c83e__AZURE_TENANT_ID=${GRAND_MERIDIAN_ENTRA_TENANT_ID}
      - CONNECTORS__MICROSOFT_GRAPH__01a043da-ff47-72c2-aaa4-7da56d85c83e__CLIENT_ID=${GRAND_MERIDIAN_DEFENDER_CLIENT_ID}
      - CONNECTORS__MICROSOFT_GRAPH__01a043da-ff47-72c2-aaa4-7da56d85c83e__CLIENT_SECRET=${GRAND_MERIDIAN_DEFENDER_CLIENT_SECRET}

In OpenCRQ, the administrator opens Configure integration, keeps the new service account Microsoft Defender connector and Every 6 hours, saves and clicks Sync now.

The booking servers arrive as internet facing when Defender flags them so, each with the CVEs Defender finds on it, and the domain controllers of the chain as very high criticality. The front-desk accounts arrive with the workstation each one uses. Every 6 hours, a CVE patched on a server is dismissed and the scenarios that reach it are priced again.

Check that it works

  1. On the connector page, the state reads Healthy, and Last run, Status, Duration and Processed describe the run.
  2. Assets lists the devices and accounts, and Findings their CVEs.
  3. The Logs tab gives, at the end of the accounts, how many disabled accounts with no identifying data were skipped and how many assets were removed. It keeps the last runs only.

If the run fails at once, check the three variables and the consent for ThreatHunting.Read.All.

What's next

NextImport compliance readiness from Drata
OpenCRQ
Cyber risk quantification: every risk priced in money, every control weighed by the loss it removes.

Published

Overview