Imports security alerts, incidents, monitored machines, the vulnerabilities present on each device, each device's compliance with the secure configurations, installed software, recommendations, and security scores from your Microsoft 365 Defender tenant.
For the general flow of adding a source, see Connect Data Sources.
To configure the data source, you can use your M365 interface or use the full PowerShell script that we provide.
Active Microsoft Defender for Endpoint Plan 1 or Plan 2 license
Access to the Azure portal with Global Administrator or Privileged Role Administrator role β an Application Administrator can create the App Registration but cannot grant admin consent to Microsoft Graph application permissions
Sign in to portal.azure.com
Search for App registrations β New registration
Fill in:
Field | Value |
|---|---|
Name | HARVEN-Defender |
Supported account types | Accounts in this organizational directory only |
Redirect URI | leave blank |
Click Register, then note the Application (client) ID and Directory (tenant) ID.
Collected data comes from three distinct APIs, each requiring its own permissions.
2a β WindowsDefenderATP API
API permissions β Add a permission β APIs my organization uses β WindowsDefenderATP β Application permissions
Permission | Table |
|---|---|
Alert.Read.All | alerts, investigations |
Machine.Read.All | machines, machine_actions |
Vulnerability.Read.All | machine_vulnerabilities, secure_configuration |
Software.Read.All | software |
SecurityRecommendation.Read.All | recommendations |
File.Read.All | files |
Ti.Read.All | indicators |
2b β Microsoft Threat Protection API
Add a permission β APIs my organization uses β Microsoft Threat Protection β Application permissions
Permission | Table |
|---|---|
Incident.Read.All | incidents |
2c β Microsoft Graph API
Add a permission β Microsoft Graph β Application permissions
Permission | Table |
|---|---|
SecurityEvents.Read.All | secure_scores |
β οΈ Click Grant admin consent to validate all permissions.
Left menu: Certificates & secrets
Client secrets tab β New client secret
Enter a description and choose an expiration period
Click Add
Copy the value immediately β it is only shown once
HARVEN β Workspace β Data Sources β Add β Defender for Endpoint, then fill in the Tenant ID, Client ID, and Client secret.
Field | Where to find it |
|---|---|
Tenant ID | App Registration β Directory (tenant) ID |
Client ID | App Registration β Application (client) ID |
Client secret | Certificates & secrets β Value |
alerts β Security alerts: Identification (alert_id, title, severity, status, classification), Context (description, category, threat_family_name, machine_id, mitre_techniques), Tracking (created_datetime, last_update_datetime, assigned_to, detection_source), Analysis (evidence_count, determination)
incidents β Security incidents: Identification (incident_id, display_name, severity, classification), Tracking (status, created_datetime, last_update_datetime, assigned_to), Detail (alert_count, tags)
machines β Monitored machines: Identification (machine_id, computer_dns_name, os_platform, os_version), Posture (health_status, risk_score, exposure_level, onboarding_status), Detail (ip_addresses, is_aad_joined, agent_version, defender_av_status, tags), Activity (last_seen, first_seen)
machine_vulnerabilities β Vulnerabilities present on each device: Identification (device_id, device_name, cve_id, severity, cvss_score), Exposure (software_name, software_version, exploitability_level, first_seen, security_update_available)
secure_configuration β Compliance of each device with each secure configuration (firewall, Secure Boot, BitLocker, antivirusβ¦): Identification (machine_id, computer_dns_name, os_platform, configuration_id, configuration_name), Compliance (is_compliant, configuration_impact, last_seen)
software β Installed software: Inventory (software_id, software_name, software_vendor, software_version), Risk (weaknesses_count, exposed_machines, end_of_support_status)
recommendations β Security recommendations: Identification (recommendation_id, recommendation_name, recommendation_category), Priority (severity, exposed_machines, impact_score, status, remediation_type)
secure_scores β Security score: Score (current_score, max_score, enabled_services), Context (created_datetime, licensed_user_count, active_user_count)
investigations β Automated investigations
machine_actions β Remediation actions
files β File hash reputation, looked up for the hash given in a file_hash equality filter; without one the table returns no rows
indicators β Threat indicators (IOC)
A data source connected before a table was added gets it when you click Refresh tables on that data source.
Create the App Registration, assign the permissions and generate the secret in one command, with our PowerShell script.
How to run it:
Windows β Right-click the file, Run with PowerShell β or in a terminal:
powershell -ExecutionPolicy Bypass -File .\setup-microsoft-connector.ps1macOS / Linux β Install PowerShell 7 then run the script:
brew install powershell
pwsh ./setup-microsoft-connector.ps1Arguments (optional) β Without any argument, the script is fully interactive.
-Connector <entraid|intune|defender|mdca|azure> β Connector to configure. Omitted: the script asks in a menu.
-AppName <name> β Name of the App Registration to create (default: HARVEN-<connector>).
-SubscriptionId <id> β Required for azure: target subscription for the Reader role.
-IncludeEntraIdWrite β entraid only: adds the remediation permission User.EnableDisableAccount.All.
-Yes β Non-interactive: skips confirmations and installs missing modules automatically.
The script offers to install the missing modules automatically.
Need help? Contact [email protected].