Imports entities, alerts, IP ranges, discovery report streams and discovered apps from Microsoft Defender for Cloud Apps.
For the general flow of adding a source, see Connect Data Sources.
Before you start
To configure the data source, you can use your M365 interface or use the full PowerShell script that we provide.
Prerequisites
A Microsoft Defender for Cloud Apps tenant
Permission to create a Microsoft Entra application and grant tenant-wide admin consent
A client secret stored securely
Setup
Step 1 ā Create an App Registration
Sign in to the Microsoft Entra admin center.
Open App registrations ā New registration.
Name it HARVEN-MDCA, select single tenant, and leave Redirect URI blank.
Click Register, then note the Application (client) ID and Directory (tenant) ID.
Step 2 ā Configure API permissions
API permissions ā Add a permission ā APIs my organization uses ā Microsoft Cloud App Security ā Application permissions
Permission | Purpose |
|---|---|
Investigation.Read | Read entities, alerts and IP ranges |
Discovery.Read | Read continuous discovery reports |
API permissions ā Add a permission ā Microsoft Graph ā Application permissions
Permission | Purpose |
|---|---|
CloudApp-Discovery.Read.All | Read discovered SaaS apps (discovered_apps table, preview); without it only this table returns a 403 |
ā ļø Click Grant admin consent for all three permissions.
Step 3 ā Create a Client Secret
Open Certificates & secrets.
Under Client secrets, click New client secret.
Choose a description and expiration period, then click Add.
Copy the Value immediately; it is shown only once.
Step 4 ā Configure the connector in HARVEN
In the Microsoft Defender portal, open Settings.
Select Cloud Apps, then under System select About.
On the About screen, copy the API URL shown for your tenant and append /api if it is not already present. The final value must look like https://<tenant>.<region>.portal.cloudappsecurity.com/api.
In HARVEN, open Workspace ā Data Sources ā Add ā Microsoft Defender for Cloud Apps.
Enter the API URL, Tenant ID, Client ID and Client Secret.
Fields to fill in HARVEN
Field | Where to find it |
|---|---|
API URL | Microsoft Defender portal ā Settings ā Cloud Apps ā System ā About; append /api if needed |
Tenant ID | Entra admin center ā Overview |
Client ID | Entra admin center ā App registrations |
Client secret | App registration ā Certificates & secrets |
Collected data
entities ā Users, devices and other cloud entities: Identity (entity_id, display_name, type), Account posture (email, status, is_admin)
alerts ā Security alerts and their resolution state: Alert (alert_id, title, severity), Handling (status, resolution_status, resolution_date)
ip_ranges ā Configured IP address ranges: Network range (subnet_id, name, subnets)
discovery_reports ā Continuous discovery report streams: Discovery stream (display_name, stream_type, last_data_received)
discovered_apps ā SaaS apps seen in use by Cloud Discovery, one row per app, discovery stream and report window (preview, Microsoft Graph beta API): App (app_id, display_name, category, risk_score, tags, domains), Usage (user_count, transaction_count, upload_bytes, download_bytes, last_seen), Report stream and window ā 7, 30 or 90 days, 30 by default (stream_name, period_days)
PowerShell script
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.
Official documentation
Need help? Contact [email protected].
