Connecting Microsoft Defender
Last Modified: 2026-11-19

Connecting Microsoft Defender

This connector links RSA Agent ID to Microsoft Defender XDR through the Microsoft Graph API. It runs advanced hunting queries to surface AI agents and automation frameworks running across your estate, reading:

  • Devices onboarded to Defender
  • Running processes and software inventory on those devices
  • Network connections made by AI tools
  • AI agents from Defender's exposure graph
  • Security alerts, which feed a risk finding shown in RSA Agent ID

The connector is read-only: everything listed above is read through Defender advanced hunting, and the connector makes no changes to devices, alerts or Defender configuration. RSA Agent ID combines this connector with other data sources to build device- and process-level visibility; it is not an authoritative agent registry on its own.

Service principals, app registrations, permission grants, directory roles, users, and devices in Microsoft Entra ID are collected by the separate Microsoft Entra ID connector. For more information, see Connecting Microsoft Entra ID.

Before you begin 

Ensure you have the following:

Type

Requirement

Purpose

RolesApplication Developer role or higherTo register the application
Global Administrator or Privileged Role Administrator

To grant admin consent

No license tier substitutes for this role.

LicensesMicrosoft Entra ID Free, included with every Microsoft 365 and Azure tenantTo register the application

Microsoft Defender for Endpoint Plan 2 is required, and devices must be onboarded to Defender.

The connector reads Defender only through advanced hunting, which needs Plan 2. Plan 1 is not supported. A tenant with only Plan 1 shows Limited access when tested, and its scans return nothing. In tenants that mix Plan 1 and Plan 2, results for Plan 1 devices are not guaranteed.

For Defender data
For Microsoft Graph, no license is required. Graph has no SKU and no per-call charge; directory reads are included in the tenant's existing subscription.For Microsoft Graph

Required Permissions

Permission

Type

Purpose

ThreatHunting.Read.AllApplicationDefender advanced-hunting queries

Adding a permission is not the same as consenting to it. Without admin consent, the connector gets a valid token but cannot read Defender data, and Test Connection reports Limited access. Add nothing beyond this one permission.

You can reuse the application registration created for the Microsoft Entra ID connector. Add ThreatHunting.Read.All to that application and grant admin consent, then skip ahead to adding API permissions and granting consent as detailed below. Defender is still added as a separate source in Agent ID.

Microsoft-side Setup (Entra Admin Center)

Procedure 

  1. Sign in to entra.microsoft.com and go to Entra ID > App registrations > New registration.

    You can also sign in through the Azure portal, under Microsoft Entra ID. If your account has access to multiple tenants, select the Settings icon in the top bar and switch to the tenant you want to scan.

  2. Type a name (for example agent-discovery-api-app), select Accounts in this organizational directory only (single tenant), leave Redirect URI empty, and click Register.
  3. From the application's Overview page, copy the Application (client) ID and Directory (tenant) ID.
  4. Go to API permissions > Add a permission > Microsoft Graph > Application permissions, select ThreatHunting.Read.All, and click Add permissions.
  5. Click Grant admin consent for <tenant>, confirm, then verify the permission shows Granted for <tenant>. Delete the automatically added User.Read delegated permission.
  6. Go to Certificates & secrets > Client secrets > New client secret, set an expiration per policy, and copy the generated secret Value immediately (not the Secret ID). The Value is shown once. After you leave the page, it is masked permanently and you must create a new secret.
  7. Note the secret's expiration date. The connector stops working when the secret expires, so rotate it before that date.

Alternative: Certificate instead of Client Secret

RSA Agent ID can generate the certificate, so no shared secret is exchanged. Follow the below steps:

  1. In the connector form, enter the Display Name, Tenant ID, and Client ID.

  2. Select Certificate, then click Generate Certificate and download the public certificate.

    Download the public certificate before leaving the screen. It can be downloaded only once; if it is lost, you must delete the connector and start over.

  3. In Entra ID, go to Certificates & secrets > Certificates > Upload certificate.

    Upload the file downloaded in Step 2.

  4. Return to the connector form and click Confirm.

The private key stays encrypted in RSA Agent ID and is never displayed or exported.

The certificate expires two years after it is generated and is not renewed automatically. Record the expiry date. Similar to an expired secret, an expired certificate stops the connector from working.

Agent ID Setup

Procedure 

  1. On the Connectors page, click Add source, then click Connect on the Microsoft Defender card.
  2. Enter a Connection name, the Tenant ID, and the Client ID (application ID).
  3. Select Secret or Certificate in Authentication Method, and enter the Client secret or generate/upload a certificate.
  4. Click Test connection, confirm it succeeds, then click Save and start discovery.

    A certificate connection can only be verified after the certificate is generated and uploaded.

Test Connection runs one advanced hunting query and confirms the Tenant ID, Client ID, and credential, and it also catches a missing ThreatHunting.Read.All permission or a tenant without advanced hunting. Either problem shows as Limited access, with one of the two messages listed under Troubleshooting. Resolve the Limited access error before relying on scan results.

Troubleshooting

  • Could not get a token

    Recheck the tenant ID, client ID, and whether the secret value (not the Secret ID) was entered, or whether it expired.

  • Authorization_RequestDenied

    Grant admin consent for ThreatHunting.Read.All and confirm it shows Granted.

  • Grant admin consent is unavailable.

    Use a Global Administrator or Privileged Role Administrator account.

  • Findings missing for some devices.

    Devices not onboarded, or covered only by Plan 1 in a mixed Plan 1/Plan 2 tenant. Confirm Defender onboarding and Plan 2 license assignment for those devices.

  • Limited access: "Token works but is missing the ThreatHunting.Read.All application permission."

    ThreatHunting.Read.All not added, or not admin-consented. Grant the permission with admin consent, then test again.

  • Limited access: "Token works but advanced hunting is unavailable (the tenant needs Microsoft Defender for Endpoint P2 with onboarded devices)."

    No Defender for Endpoint Plan 2 license (Plan 1 alone is not supported), or no devices onboarded. Check the Plan 2 license and that devices are onboarded, then test again.

  • Connector worked, then stopped.

    Client secret expired. Create a new secret and update the connector.