Microsoft Defender XDR
Fluency polls Microsoft Defender XDR for incidents and alerts, and Defender for Endpoint for the device inventory and vulnerability posture those detections land on. Defender correlates the alerts raised by its own components (Defender for Endpoint, for Identity, for Office 365, for Cloud Apps) into incidents, so this one integration covers all of them.
Authentication is app-only: you register one application in Microsoft Entra ID, grant it six read-only permissions, and give its credentials to Fluency. The six permissions come from two APIs, Microsoft Graph and Defender for Endpoint, which is why step 2 and step 3 are separate. Missing the second is the most common mistake.
The setup has two halves:
- In Microsoft Entra ID: as an administrator who can grant tenant-wide admin consent, register a single-tenant application under App registrations; add two Microsoft Graph application permissions and four from WindowsDefenderATP (on the APIs my organization uses tab); grant admin consent; create a client secret. Copy the Directory (tenant) ID, the Application (client) ID and the secret's Value.
- In Fluency: install the Microsoft Defender XDR application template and paste those three values in.
| Template | Template ID | Data lake and index |
|---|---|---|
| Microsoft Defender XDR (this page) | MSDefender | Chosen on the form, under Advanced configuration (v1: Advanced Configurations) |
| Microsoft Defender XDR (Legacy, incidents only) | DefenderATPLegacy | Fixed by the template |
Both take the same three credentials, and Part 1 applies to either. The legacy template collects incidents alone and is kept so existing deployments keep working; install the current one unless you are matching an existing deployment.
What arrives
| Stream | What it holds | Lands in |
|---|---|---|
| Incidents | Correlated attacks: severity, classification, status, assignee and the Defender portal link. | The MSDefender index |
| Alerts | Individual detections, with MITRE techniques and an evidence array naming the devices, users, processes, files and addresses involved. | The MSDefender index |
| Device inventory | Every onboarded device, and its antivirus health. | Resources: Machine, AvHealth |
| Vulnerabilities | CVEs per device, and per-device configuration compliance. | Resources: Vulnerability, SecureConfig |
| Security recommendations | The prioritised remediation list. | Resources: Recommendation |
| Device secure score | Microsoft Secure Score for Devices over time. | Resources: SecureScore |
Incidents and alerts are events, so a quiet tenant legitimately produces none. The other four rows are record sets describing the current state of your estate, each backed by its own permission: skip one and its record set is empty, with no error (record sets). The last three rows also need Defender Vulnerability Management (Before you begin).
Endpoints, the permission behind each record set, and how alerts join to devices are in Reference.
Before you begin
A Defender XDR licence that provisions incidents. Any of Microsoft 365 E5/A5, Microsoft 365 E3 with the Defender Suite add-on, Office 365 E5, Defender for Endpoint, Defender for Business, or Microsoft 365 Business Premium will do; Microsoft's Defender XDR prerequisites has the complete list. The practical test: if https://security.microsoft.com shows you an Incidents queue, you are covered for the first two streams.
Defender for Endpoint, provisioned and licensed for vulnerability management. The four Defender for Endpoint permissions reach capabilities licensed separately from incidents and alerts. Two checks answer it:
-
Assets → Devices in the Defender portal shows a Device inventory. If it does,
Machine.Read.Allwill return data.
-
Exposure management → Recommendations (or, on tenants not yet moved, Endpoints → Vulnerability management → Recommendations) shows a populated recommendations list. If it does, the three vulnerability-management permissions will return data.

A tenant without the vulnerability-management entitlement installs successfully and leaves four of the six record sets empty, so settle this before you install (licensing).
An Entra identity that can register an application and grant tenant-wide admin consent. That means Global Administrator, or Privileged Role Administrator combined with Application Administrator or Cloud Application Administrator. Without consent rights you can create the application, but its permissions stay unconsented and no data ever flows.
Access to the Fluency portal with permission to install applications.
Part 1: Microsoft Entra ID
Work through this half in the Microsoft Entra admin center, or in the Azure portal under Microsoft Entra ID. If you would rather script it, skip to Automated alternative: Azure CLI; the result is identical.
1. Register the application
Go to App registrations → New registration.
- Name: anything recognisable.
ingext-defenderis the name Fluency's own tooling uses, and is a good default. - Supported account types: Accounts in this organizational directory only (single tenant).
- Redirect URI: leave blank. This application never signs a user in.
Click Register.
2. Add the Microsoft Graph permissions
On the new application, go to API permissions → Add a permission. On the Microsoft APIs tab, choose Microsoft Graph.

Choose Application permissions: "Your application runs as a background service or daemon without a signed-in user." Delegated permissions would require a signed-in user and will not work here.

Tick two permissions. The search box takes a fragment of the name:
| Search for | Tick | Listed as |
|---|---|---|
securityincident | SecurityIncident.Read.All | Read all security incidents |
securityalert | SecurityAlert.Read.All | Read all security alerts |
Pick SecurityAlert.Read.All, not SecurityAlert.Create.All or SecurityAlert.ReadWrite.All. Admin consent required reads Yes for both; that is step 4.


Click Add permissions.
Do not follow Microsoft's older walkthrough, Create an app to access Microsoft Defender XDR without a user: it grants Incident.Read.All and Alert.Read.All on the legacy Microsoft Threat Protection resource, a different API. Fluency calls Microsoft Graph, so the two permissions must come from the Microsoft Graph tile (legacy permissions).
3. Add the Defender for Endpoint permissions
Still on API permissions, click Add a permission again. This time switch to the APIs my organization uses tab, type WindowsDefenderATP, and select it. The application ID should read fc780465-2017-40d4-a0c5-307022471b92.

WindowsDefenderATP is Entra's name for the Microsoft Defender for Endpoint API, and it is not on the Microsoft APIs tab. Choose Application permissions again.

Tick four permissions:
| Permission | Listed as | What it buys |
|---|---|---|
| Machine.Read.All | Read all machine profiles | Machines and AV Health |
| Vulnerability.Read.All | Read Threat and Vulnerability Management vulnerability information | Vulnerabilities and Secure Config |
| SecurityRecommendation.Read.All | Read Threat and Vulnerability Management security recommendation information | Recommendations |
| Score.Read.All | Read Threat and Vulnerability Management score | Secure Score |
"Threat and Vulnerability Management" is the former name of Defender Vulnerability Management, which the permission picker still uses.
Click Add permissions.
The tab shows only "Apps in your directory that expose APIs". If WindowsDefenderATP returns nothing, Defender for Endpoint has not been provisioned in this tenant yet: complete its setup at https://security.microsoft.com so the service principal is created, then come back. The Graph permissions from step 2 stay as they are.
4. Grant admin consent
Application permissions do nothing until an administrator consents on the tenant's behalf. On the same API permissions page, click Grant admin consent for <tenant>.

Confirm with Yes. All six rows must then show a green Granted for <tenant>, under two group headings, Microsoft Graph and WindowsDefenderATP (4):

Check for two group headings: anyone who missed the second tab sees only the Microsoft Graph group here, and that page looks perfectly healthy. Before consent, the rows read Not granted in the Status column.
If the button is greyed out, the account you are signed in as does not hold consent rights. The application and its permissions are already saved; ask an administrator who does to open the same page and click it.
5. Create a client secret
Go to Certificates & secrets → Client secrets → New client secret. Give it a description you will recognise in two years' time, and choose an expiry.

The drop-down opens on Recommended: 180 days (6 months), and the portal's maximum is 24 months. Pick whatever your credential-rotation policy allows, and write the date down: when the secret expires, collection stops (Maintenance).
Click Add. The new secret appears in the list with its Value shown in full, exactly once.

The Value is readable only until you navigate away; on reload it is masked forever and cannot be recovered. The Secret ID in the next column is not the secret: pasting it into Fluency is the most common cause of a Defender application that installs and then immediately aborts.
6. Record the Tenant ID and Client ID
Go to the application's Overview page. Under Essentials, copy:
- Application (client) ID → Fluency's Client ID
- Directory (tenant) ID → Fluency's Tenant ID

You should now be holding all three values:
| Value | Where it came from |
|---|---|
| Tenant ID | Overview → Directory (tenant) ID |
| Client ID | Overview → Application (client) ID |
| Client Secret | Certificates & secrets → the secret's Value |
Unlike the client secret, the tenant and client IDs are not sensitive and can be read from the portal at any time.
Automated alternative: Azure CLI
The same registration as a script, in the same seven steps. Useful when onboarding several tenants, and the path Fluency's own onboarding tooling takes. Requires Azure CLI and the same consent rights as the portal walkthrough.
# Sign in to the target tenant, then confirm which tenant you are in
az login
az account show --query '{tenant:tenantId, account:user.name}' -o table
# 1. Register the application (single tenant, no redirect URI)
APP_ID=$(az ad app create \
--display-name ingext-defender \
--sign-in-audience AzureADMyOrg \
--query appId -o tsv)
# 2. The two resources. GRAPH is a well-known constant; MDE is WindowsDefenderATP.
GRAPH=00000003-0000-0000-c000-000000000000
MDE=fc780465-2017-40d4-a0c5-307022471b92
# 3. Resolve the application-role IDs at runtime, no hardcoded GUIDs
role() { az ad sp show --id "$1" --query "appRoles[?value=='$2'].id | [0]" -o tsv; }
INCIDENT=$(role $GRAPH SecurityIncident.Read.All)
ALERT=$(role $GRAPH SecurityAlert.Read.All)
MACHINE=$(role $MDE Machine.Read.All)
VULN=$(role $MDE Vulnerability.Read.All)
RECO=$(role $MDE SecurityRecommendation.Read.All)
SCORE=$(role $MDE Score.Read.All)
# 4. Request them as Application permissions (=Role, as opposed to =Scope for delegated).
# One call per API: --api takes a single resource.
az ad app permission add --id $APP_ID --api $GRAPH \
--api-permissions $INCIDENT=Role $ALERT=Role
az ad app permission add --id $APP_ID --api $MDE \
--api-permissions $MACHINE=Role $VULN=Role $RECO=Role $SCORE=Role
# 5. Create the service principal, then grant tenant-wide admin consent
az ad sp create --id $APP_ID
az ad app permission admin-consent --id $APP_ID
# 6. Append a client secret valid for two years, and print it
az ad app credential reset --id $APP_ID \
--display-name ingext-defender --years 2 --append \
--query password -o tsv
# 7. Print the tenant and client IDs
az account show --query tenantId -o tsv
echo $APP_ID
--append is not optionalWithout --append, az ad app credential reset "clears all passwords and keys" before creating the new one. On a fresh application that is harmless; run it against an application already in service and you will revoke the credential that is currently collecting data.
If az ad sp show --id $MDE returns not-found and the four role $MDE ... variables come back empty, Defender for Endpoint has never been provisioned here (step 3). If admin-consent reports that the service principal was not found, that is a replication delay after step 1: wait a few seconds and run it again. The commands are otherwise safe to re-run, but on a retry substitute the existing appId rather than re-running step 1, which would create a second application of the same name.
Confirm consent landed by counting the app-role assignments (six is correct):
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/servicePrincipals(appId='$APP_ID')/appRoleAssignments" \
--query "length(value)"
To see the split by resource, which is what actually catches a missed second tab:
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/servicePrincipals(appId='$APP_ID')/appRoleAssignments" \
--query "value[].resourceDisplayName" -o tsv | sort | uniq -c
Expect 2 Microsoft Graph and 4 WindowsDefenderATP.
Optional: verify the credential before you leave Microsoft
The credential is doing two jobs against two different token audiences (audiences), and only one of them can be exercised with a Graph call.
TENANT=<tenantId>; CLIENT=<clientId>; SECRET=<clientSecret>
# 1. Microsoft Graph: incidents and alerts
GRAPH_TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/$TENANT/oauth2/v2.0/token" \
-d "client_id=$CLIENT" -d "client_secret=$SECRET" \
-d "scope=https://graph.microsoft.com/.default" \
-d "grant_type=client_credentials" | jq -r .access_token)
curl -s -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/security/incidents?\$top=1"
# 2. Defender for Endpoint: the roster. Note the different scope.
MDE_TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/$TENANT/oauth2/v2.0/token" \
-d "client_id=$CLIENT" -d "client_secret=$SECRET" \
-d "scope=https://api.securitycenter.microsoft.com/.default" \
-d "grant_type=client_credentials" | jq -r .access_token)
curl -s -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $MDE_TOKEN" \
"https://api.security.microsoft.com/api/machines?\$top=1"
Two 200s means both halves work. The AADSTS… strings are Microsoft's standard identity-platform error codes.
| Response | What it means |
|---|---|
AADSTS7000215: Invalid client secret provided | The Secret ID instead of the Value, or an expired secret (step 5). |
AADSTS700016: Application with identifier … was not found | Wrong Client ID, or the right one against the wrong tenant (step 6). |
AADSTS500011: The resource principal named https://api.securitycenter.microsoft.com was not found in the tenant | Defender for Endpoint was never provisioned in this tenant (step 3). |
403 Forbidden on both calls | Admin consent was never granted (step 4). |
403 Forbidden on the Defender call only | The four WindowsDefenderATP permissions are missing, or the second token has the wrong scope: it is https://api.securitycenter.microsoft.com/.default, not the host the request goes to. Check the scope first. |
404 Not Found on /api/machines | Authorised, but no devices in the tenant's retention window: Microsoft documents 404 as this endpoint's empty response. |
To check what the application is actually authorised for, decode either token at https://jwt.ms. The Graph token's roles claim should hold SecurityIncident.Read.All and SecurityAlert.Read.All with aud of https://graph.microsoft.com; the Defender token's should hold Machine.Read.All, Vulnerability.Read.All, SecurityRecommendation.Read.All and Score.Read.All with aud of https://api.securitycenter.microsoft.com.
Part 2: Fluency
Install the Application
- v2 interface
- Classic v1 interface
In the navigation rail, open Applications and click Install Application, then choose Microsoft Defender XDR from the Endpoint Management category of the Application Catalog.
Go to Platform → Applications → Install Application From Template and choose Microsoft Defender XDR from the Endpoint Management category.
| Parameter | Notes |
|---|---|
| Tenant ID | Entra's Directory (tenant) ID. |
| Client ID | Entra's Application (client) ID. |
| Client Secret | The secret Value, not the Secret ID. Masked once the application is installed. |
| datalake | Pre-filled managed. |
| datalake index name | Pre-filled MSDefender. Two applications writing to the same index name in the same lake will collide, and the second one aborts, so a second tenant needs its own index name as well as its own instance name. |
Nothing on the form selects streams: what arrives is decided entirely by the permissions granted in Part 1, and a missing permission has no Fluency-side setting to compensate and no Fluency-side symptom.
- v2 interface
- Classic v1 interface
datalake and datalake index name sit in the collapsed Advanced configuration section below Configuration; click its heading to reach them.
Leave Instance name and Display name at default / Default unless you are installing a second instance (collecting from two Defender tenants, for example), in which case give each one a name you will recognise on the applications list.

Click Dry run first to have the platform check the three credentials against Microsoft before anything is installed, then click Install Application. The Applications page opens with the notice Default is launching., and the new application is listed with a green Running badge once the pipeline is up.
datalake and datalake index name sit in the collapsed Advanced Configurations row below the parameters; expand it to reach them.
Leave Name and Display Name at default / Default unless you are installing a second instance (collecting from two Defender tenants, for example), in which case give each one a name you will recognise on the applications list.

Press Install. The application then appears in the Installed Applications view, where its badge reads Running once the pipeline is up.
Confirm it is running
- v2 interface
- Classic v1 interface
The application is listed on Applications as Microsoft Defender XDR, with the display name Default beneath it, and its badge should read Running in green within a few seconds. A red Error badge means the pipeline aborted or reported errors in the last hour: click its row to open the application details page, which shows the error message, the Pipeline, the Parameters (client secret masked) and the Actions the install carried out.
The application appears under Installed Applications as Microsoft Defender XDR: Default, and its badge should read Running in green within a few seconds; Aborted in red means the pipeline stopped on an error. The blue eye button opens the details panel, Viewing MSDefender Application, with the message, the Parameters (client secret masked) and the Actions list of pipeline objects the install created.

Check the roster, not the event count. The first collection reaches back 24 hours and the event streams then poll every five minutes, so a quiet tenant can legitimately produce nothing for a while. MS Defender on the Resources page is the stricter check, because a device roster is never legitimately empty on a tenant that has any devices at all:
- v2 interface
- Classic v1 interface
Open Resources from the navigation rail. MS Defender is listed with its six record sets: AvHealth, Machine, Recommendation, SecureConfig, SecureScore and Vulnerability. Open each one in turn; a record set that has loaded lists its records, and one that has loaded and is genuinely empty reads No data found. A record set that was never loaded is missing from the list.
On SIEM → Resources, the MS Defender card has a button for each of the six record sets:

Click through each of the six buttons. A record set that has loaded shows a Total Records count and populated facets; one that has loaded and is genuinely empty shows Total Records 0 and No data found; one that was never loaded at all shows Resource Load Failed instead of a list. The difference between the last two is usually the difference between a licence gate and a missing permission (see Resources).
To check that events are landing, see Confirm data is arriving.
Once the application reads Running and MS Defender on Resources lists your devices under Machine (v1: Machines), setup is complete.
Maintenance
The client secret expires on the date you chose in step 5, and nothing on the Fluency side warns when it does: collection simply stops. Rotate before that date.
Rotating the client secret
- In Entra, go to the application's Certificates & secrets and add a New client secret. Leave the old one in place for now; an application can hold several.
- Copy the new Value.
- In Fluency, uninstall the Microsoft Defender application and install it again with the new secret: the parameters are read-only after install, so reinstalling is the supported way to change a credential. To uninstall, click Uninstall at the top right of the application's details page (v1: the red Uninstall button at the foot of its details panel on Platform → Applications).
- Once data is flowing again, delete the old secret in Entra.
Rotation does not touch the permission set: the six permissions live on the app registration and survive any number of secrets.
Reviewing the permission set
When the template gains a stream, the app registration needs the new permission, and nothing on the Fluency side reports that it is missing: the symptom is an empty record set on a card that is otherwise full, which reads as "we have no vulnerabilities" rather than as a fault. Re-read the API permissions page against the table in step 3 when a stream you expect is empty, and after any Fluency upgrade that mentions Defender. The appRoleAssignments count in the CLI section answers the same question in one command.
Removing the integration
Uninstall the application in Fluency first, with the Uninstall button at the top right of its details page (v1: the red Uninstall button at the foot of its details panel on Platform → Applications), so the pipeline stops cleanly before its credentials stop working.
To revoke access on the Microsoft side, delete the app registration, or revoke just the consent from Microsoft Entra ID → Enterprise applications, where the application appears as a service principal. Deleting it there removes the tenant's consent without deleting the registration.

Troubleshooting
403 Forbidden means either that consent was never granted or that the token was issued for the wrong audience: if Graph calls succeed and Defender for Endpoint calls do not, it is the audience (audiences).
| Symptom | Likely cause | Fix |
|---|---|---|
| Error (v1: Aborted) immediately after install | The Secret ID was pasted instead of the Value, or the secret has expired | Reinstall with the secret's Value; if it was never captured, create a new secret (step 5). |
Every call returns 403 Forbidden | Admin consent was never granted | Grant it on API permissions until all six rows read Granted for <tenant> (step 4). |
| Incidents and alerts arrive; MS Defender on Resources is missing entirely | None of the four WindowsDefenderATP permissions were added, usually because only the Microsoft APIs tab was used | Add them from APIs my organization uses and consent again (step 3). |
| One record set is empty while the others are full | The permission behind that record set is missing | Add the permission the mapping names for it. |
| Machines and AV Health are full; Vulnerabilities, Secure Config, Recommendations and Secure Score are all empty | Defender Vulnerability Management is not licensed, so the permissions cover data that does not exist | Check Exposure management → Recommendations in the Defender portal; if it is empty too, this is a licence gate, not a fault (licensing). |
WindowsDefenderATP returns nothing on APIs my organization uses | Defender for Endpoint has never been provisioned, so its service principal does not exist | Complete Defender for Endpoint setup at https://security.microsoft.com, then add the permissions. |
A direct call to /api/machines returns 404 Not Found | No devices in the retention window: the documented empty response, not a bad URL | Check Assets → Devices in the Defender portal; if it is empty, nothing is onboarded yet. |
| Incidents arrive but alerts do not, or the reverse | Only one of the two Graph permissions was added or consented | Check that SecurityIncident.Read.All and SecurityAlert.Read.All are both listed and green (step 2). |
| Permissions are listed under Microsoft Threat Protection rather than Microsoft Graph | The app was registered from Microsoft's legacy Defender XDR walkthrough | Add the two Microsoft Graph permissions (step 2) and consent again; the legacy ones can be removed (legacy permissions). |
| Collection worked, then stopped around the six-month mark | The client secret expired; 180 days is the portal's default | Rotate the secret. |
| Running, but no Defender events appear | The tenant has no incidents or alerts in the polled window | Confirm the Incidents queue at https://security.microsoft.com is non-empty, and check the Resources card instead (Confirm it is running). |
Reference
What the streams look like once they land, how the collector reads them, and the reasoning the steps link to, for searches and detection rules written against the MSDefender index and the MS Defender record sets.
Streams, endpoints and permissions
| Stream | API and endpoint | Permission | Contents |
|---|---|---|---|
| Incidents | Microsoft Graph: GET /security/incidents | SecurityIncident.Read.All | Correlated attacks: severity, classification, determination, status, assignee, priority score, and the Defender portal link. |
| Alerts | Microsoft Graph: GET /security/alerts_v2 | SecurityAlert.Read.All | Individual detections: MITRE technique IDs, recommended actions, the detecting service, and an evidence array. |
| Device inventory | Defender for Endpoint: GET /api/machines, GET /api/deviceavinfo | Machine.Read.All | The Machines and AV Health record sets: hostname, OS, last-seen, risk and exposure level, onboarding status, tags, and per-device antivirus engine, platform and signature state. |
| Vulnerabilities | Defender for Endpoint: GET /api/vulnerabilities, GET /api/machines/SecureConfigurationsAssessmentByMachine | Vulnerability.Read.All | The Vulnerabilities and Secure Config record sets: CVEs with CVSS, EPSS and exploit status, and per-device configuration compliance. |
| Security recommendations | Defender for Endpoint: GET /api/recommendations | SecurityRecommendation.Read.All | The Recommendations record set: the prioritised remediation list, with exposed-device counts and exposure impact. |
| Device secure score | Defender for Endpoint: GET /api/configurationScore | Score.Read.All | The Secure Score record set: Microsoft Secure Score for Devices as a tenant-level figure over time. |
Alerts carry the richest event payload: evidence is where device names, user SIDs, process command lines, file hashes and IP addresses live. Every permission above is read-only: Fluency never writes back to Defender.
Record sets: one permission each, and the join to alerts
The install produces an event index and a resource roster, and they behave nothing alike. Incidents and alerts arrive when something happens. The other streams are six record sets holding the current state of your estate, listed under MS Defender on the Resources page:
- v2 interface
- Classic v1 interface
Resources, in the navigation rail, lists MS Defender with one entry per record set, under the record set's own name: AvHealth, Machine, Recommendation, SecureConfig, SecureScore and Vulnerability.

Each record set is backed by a different endpoint, and the endpoints are gated by four different permissions:
| Record set | Endpoint behind it | Permission that buys it |
|---|---|---|
| Machine (v1: Machines) | GET /api/machines | Machine.Read.All |
| AvHealth (v1: AV Health) | GET /api/deviceavinfo | Machine.Read.All |
| Recommendation (v1: Recommendations) | GET /api/recommendations | SecurityRecommendation.Read.All |
| SecureConfig (v1: Secure Config) | GET /api/machines/SecureConfigurationsAssessmentByMachine | Vulnerability.Read.All |
| SecureScore (v1: Secure Score) | GET /api/configurationScore | Score.Read.All |
| Vulnerability (v1: Vulnerabilities) | GET /api/vulnerabilities | Vulnerability.Read.All |
This is where least privilege quietly costs you something. Skip one permission and you lose the record sets it backs, not with a permission error, but with an empty list. An application granted only the two Microsoft Graph permissions collects incidents and alerts perfectly and shows no MS Defender card at all, and nothing about that reads as a failure, because the events are arriving. It stays looking healthy until the first time someone needs to know which devices a CVE is actually on. Grant all four: the narrower sets are only worth considering if a policy forbids them, and the checkbox you skip is the record set you will not have.
The join. Alert evidence identifies its host by Defender's device ID: the 40-character hex string that is also id on a Machines record. Without the roster, a detection can tell you that 1e5bc9d7e413… was involved; with it, the same detection can name the machine, its owner, its risk level and the CVEs open on it.
Endpoint variants. The mapping above follows Microsoft's API reference for the Defender for Endpoint API. Microsoft offers both a paginated JSON form and a bulk file-export form for the secure-configuration and antivirus-health data, and they do not always take the same permission (Vulnerability.Read.All for the export form, Machine.Read.All for the JSON form of deviceavinfo). Which variant backs each record set is recorded in your install's Actions list (what the install creates).
Defender Vulnerability Management licensing
The four Defender for Endpoint permissions reach capabilities licensed separately from incidents and alerts, and a tenant can be fully entitled to one and not the other. Microsoft Defender Vulnerability Management "is available as an add-on for Microsoft Defender for Endpoint Plan 2 or as a standalone subscription", though "Defender for Endpoint Plan 2 includes core vulnerability management capabilities" on its own. Four of the six record sets (Vulnerabilities, Secure Config, Recommendations and Secure Score) depend on it.
The gate does not block the install. A tenant without the entitlement installs the application successfully, collects incidents and alerts, populates Machines and AV Health, and leaves the other four record sets empty, which is why the check belongs before the install rather than a month later in front of an empty card.
Two token audiences, one credential
The single client-credentials pair is exchanged for two different tokens, because the six permissions are split across two resources:
| Microsoft Graph | Defender for Endpoint | |
|---|---|---|
| Entra API name | Microsoft Graph | WindowsDefenderATP |
| Application ID | 00000003-0000-0000-c000-000000000000 | fc780465-2017-40d4-a0c5-307022471b92 |
| Token scope | https://graph.microsoft.com/.default | https://api.securitycenter.microsoft.com/.default |
| Request host | https://graph.microsoft.com/v1.0 | https://api.security.microsoft.com/api |
| Permissions | SecurityIncident.Read.All, SecurityAlert.Read.All | Machine.Read.All, Vulnerability.Read.All, SecurityRecommendation.Read.All, Score.Read.All |
The scope and the host do not match on the Defender for Endpoint side, and that is deliberate on Microsoft's part rather than a documentation error. Microsoft states it twice in its own API reference:
Some Microsoft Defender for Endpoint APIs continue to require access tokens issued for the legacy resource
https://api.securitycenter.microsoft.com. If the token audience doesn't match the resource expected by the API, requests fail with403 Forbidden, even if the API endpoint useshttps://api.security.microsoft.com.
If permission is defined under WindowsDefenderATP, the scope must be set to:
https://api.securitycenter.microsoft.com/.default
So 403 Forbidden does double duty on this integration: it is the honest answer when consent was never granted, and also what Defender for Endpoint returns to a perfectly authorised application that asked for a token against the wrong audience. Both hosts answer, and both are documented, so a wrong-audience token produces an authorisation failure rather than a routing one; there is no combination of hostnames that turns this into a clearer error.
Legacy Microsoft Threat Protection permissions
Microsoft still publishes an older Defender XDR walkthrough, Create an app to access Microsoft Defender XDR without a user. It grants Incident.Read.All and Alert.Read.All on the legacy Microsoft Threat Protection resource (api.security.microsoft.com as an audience), which are different permissions on a different API. Fluency calls Microsoft Graph for incidents and alerts, so those two permissions must come from the Microsoft Graph tile.
Microsoft Threat Protection is also not the same thing as the WindowsDefenderATP tile used in step 3: they are two different resources with two different application IDs, and the four permissions in step 3 belong on WindowsDefenderATP.
A wrongly registered application looks like this; note Microsoft Threat Protection as the API and Incident.Read.All as the permission. Consent is granted and the portal shows no error, which is what makes this one hard to spot:

Legacy Defender API field names
Incidents and alerts come from the Microsoft Graph security API. The Defender XDR endpoints it replaces, https://api.security.microsoft.com/api/incidents and /api/alerts, are deprecated by Microsoft and use different field names, while records from either API carry the same Sourcetype values (microsoftDefender for incidents, microsoftDefenderAlert for alerts). Graph's field names are stored as Microsoft returns them, with no aliases for the legacy ones:
| Legacy Defender API | Microsoft Graph | |
|---|---|---|
| Incident ID | incidentId | id |
| Incident name | incidentName | displayName |
| Created | createdTime | createdDateTime |
| Last updated | lastUpdateTime | lastUpdateDateTime |
A search, detection rule or parser that names a legacy field finds nothing in records collected from Graph: rewrite it to the Graph name. Incidents in your index that carry incidentId were collected from the legacy API. An application registration that still holds the legacy permissions is covered under legacy permissions.
Record sets are state, not events
A vulnerability record carries a status of RemediationRequired, NoActionRequired, UnderException or PartialException, and a recommendation carries Active, Full exception or Partial exception, so a rule that fires on the arrival of a record rather than on its status will fire on the ones Microsoft has already ruled out. Deduplicate vulnerabilities on id (the CVE) and recommendations on id (va-_-microsoft-_-edge_chromium-based and similar); device-scoped rows key on deviceId plus the finding's own identifier.
The vulnerability-management data is a current-state snapshot with no history (Microsoft: "Data that is collected (using either JSON response or via files) is the current snapshot of the current state, and does not contain historic data"), so trend analysis has to come from successive collections stored in Fluency. And its device population is scoped differently from the device inventory's: "Vulnerability management shows devices that were in use within the last 30 days. This is different from device status in Defender for Endpoint, where if a device has Inactive status if it doesn't communicate with the service for more than seven days." A device count taken from Machines and one taken from Vulnerabilities will not agree, and neither is wrong.
Collection behaviour and output
The two event streams poll on a five-minute cadence:
- Incidents:
GET https://graph.microsoft.com/v1.0/security/incidents - Alerts:
GET https://graph.microsoft.com/v1.0/security/alerts_v2
Each maintains an independent watermark (lastPoll for incidents, lastAlertPoll for alerts). On each poll, the filter lastUpdateDateTime ge <watermark> returns everything updated since the last successful run; pagination follows @odata.nextLink. On first run with no state, both watermarks default to 24 hours back.
Auth is OAuth2 client credentials, one token per audience (audiences):
POST https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
scope=https://graph.microsoft.com/.default # incidents and alerts
scope=https://api.securitycenter.microsoft.com/.default # machines, TVM
grant_type=client_credentials
Retry and backoff handle 429/503/504, with Retry-After honoured.
Output. Event output goes to gzip-JSONL files under the plugin's home directory, named msdefender_incident_<ts>.log.gz and msdefender_alert_<ts>.log.gz. Each line is {"@fields": <event>, "@customer": <name>}. Incidents are emitted with Sourcetype / Importsource = microsoftDefender; alerts with microsoftDefenderAlert. The plugin reads three values from its integration config/secret: tenantId, clientId, clientSecret.
API limits
| API | Limit |
|---|---|
GET /api/machines | 100 calls/min, 1,500/hour; $top max 10,000; devices are returned per the tenant's configured retention period; 404 when there are none |
GET /api/vulnerabilities | $top max 8,000 |
GET /api/recommendations | $top max 10,000 |
GET /api/deviceavinfo | 30 calls/min, 1,000/hour; max page size 200,000; default page size 20 |
GET /api/machines/SecureConfigurationsAssessmentByMachine | 30 calls/min, 1,000/hour; max page size 200,000 |
What the install creates
An events-only install creates five objects: an integration, a router, the two data sinks EW-MSDefender-<name> and Behavior-MSDefender-<name>, and a pipe to the router. Three things vary with the release you are running, and the Actions list in the installed application's details is the authoritative record of all three:
- Which endpoint variant backs each record set (endpoint variants).
- The sync cadence and watermarking for the six record sets. They are snapshots rather than event streams, so a watermark may not apply.
- Whether the install creates exactly those five pipeline objects, or an
MSDefenderresource group alongside them.
Related
Microsoft documentation
- Microsoft Graph security API overview: what the unified security API covers
- List incidents: the incidents endpoint and its filterable properties
- List alerts_v2: the alerts endpoint and the evidence schema
- Get access without a user: the canonical client-credentials walkthrough
- Create an app to access Defender for Endpoint without a user: the APIs my organization uses → WindowsDefenderATP path, and the token-audience note
- Supported Defender for Endpoint APIs: the endpoint list and regional hosts
- List machines:
Machine.Read.All, rate limits, and the404-when-empty behaviour - Export device antivirus health:
/api/deviceavinfoand the permission split between its two forms - List all vulnerabilities:
Vulnerability.Read.All - List all recommendations:
SecurityRecommendation.Read.All - Get the device secure score:
Score.Read.Alland/api/configurationScore - Export secure configuration assessment per device: the Secure Config record set
- Microsoft Defender XDR prerequisites: licensing for incidents and alerts
- Defender Vulnerability Management prerequisites: what gates the four Defender for Endpoint streams
- Explore devices in the device inventory: the Assets → Devices check
- Security recommendations: the Exposure management → Recommendations check
- Add and manage app credentials: client secret lifetimes and rotation
Fluency
- Applications: what the Applications page does (v1: Platform → Applications)
- Microsoft Defender XDR install form: the template's fields and defaults (v1: Install Application From Template)
- Resources: the record-set browser the four Defender for Endpoint permissions feed (v1: SIEM → Resources)
- Confirm data is arriving
- Microsoft Defender for Endpoint customer report: enrolment, device and antivirus health, vulnerabilities and alerts, through the daily archive of
Defender_Resource_Report; the device inventory also feeds Security Agent Deployment Status
Other integrations
- Microsoft integrations: the rest of this category