Imports users, groups, devices, sign-in logs, privileged accounts, conditional-access policies and Entra ID Protection risks from your Microsoft directory via the Microsoft Graph API.
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.
Azure account 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
An active Microsoft Entra ID tenant
Entra ID P1 for signin, signin_service_principal, conditional_access_policy, named_location and the sign-in dates in user; Entra ID P2 for risky_user and risk_detection (empty without the licence) and for the PIM roles in privileged_account (without the licence every active assignment shows as permanent); Entra ID P2 / Governance for access_review
Sign in to portal.azure.com
Search for App registrations β New registration
Name: HARVEN, type: Single tenant
Click Register
Note the Application (client) ID and Directory (tenant) ID
API permissions β Add a permission β Microsoft Graph β Application permissions
Permission | Purpose |
|---|---|
User.Read.All | Users |
Group.Read.All | Groups |
Device.Read.All | Devices |
AuditLog.Read.All | Sign-in logs |
Directory.Read.All | Directory roles |
AccessReview.Read.All | Access reviews (guest-account coverage) |
Policy.Read.All | Conditional-access policies, named locations and tenant policies; policies applied to sign-ins |
RoleManagement.Read.Directory | PIM eligible and activated roles (P2 licence) |
IdentityRiskyUser.Read.All | Risky users (P2 licence) |
IdentityRiskEvent.Read.All | Risk detections (P2 licence) |
β οΈ Click Grant admin consent to activate permissions.
Connector created before a permission joined this list? Add it and click Grant admin consent again (or re-run the PowerShell script). Meanwhile, only the tables and columns that need the missing permission are unavailable.
Left menu: Certificates & secrets
New client secret β choose a duration (24 months recommended)
Copy the value immediately β it is only shown once
Only required for HARVEN to act on accounts itself, from the Actions or Remediation pages. Add the Graph permission (Application) of each action you want, then Grant admin consent:
Suspend / Reactivate a user (accountEnabled) β User.EnableDisableAccount.All (or User.ReadWrite.All)
Force a password change at next sign-in β User-PasswordProfile.ReadWrite.All (or User.ReadWrite.All)
Require MFA (per-user MFA) β Policy.ReadWrite.AuthenticationMethod
Without the permission, HARVEN shows the steps to grant it when you launch the action. The PowerShell script's -IncludeEntraIdWrite option adds only the Suspend / Reactivate permission: add the other two by hand.
Field | Where to find it |
|---|---|
Tenant | App Registration β Directory (tenant) ID |
Client ID | App Registration β Application (client) ID |
Client secret | Certificates & secrets β Value |
user β Entra ID users: Identity (userid, name, email), Security (directory_roles: direct roles only, see privileged_account) (user_type, account_enabled, directory_roles, password_policies), Activity (sign-in dates: Entra ID P1 licence) (last_successful_signin, last_interactive_signin, last_non_interactive_signin, last_password_change), Organization (department, job_title, company_name, groups)
device β Registered devices: Hardware (name, manufacturer, model, os, osversion), Compliance (is_compliant, is_managed, trust_type)
signin β Sign-in logs: Connection (status, date, application, ip_address), Security (risk_level, risk_state, conditional_access_status, applied_conditional_access_policies)
group β Groups: Identity (id, name, type, description, mail), Kind (visibility, is_m365, is_dynamic, has_team, security_enabled, mail_enabled), Governance (0 owners = orphaned group) (is_assignable_to_role, owner_count, guest_member_count), Lifecycle (created_datetime, renewed_datetime, expiration_datetime, assigned_labels)
access_review β Entra ID access reviews (guest-account coverage). Requires an Entra ID P2 / Governance licence: Review (review_id, review_name, instance_status), Decision (reviewed_user_id, decision, decision_applied_date)
registration β User MFA registration details (Graph userRegistrationDetails report): MFA (is_mfa_registered, is_mfa_capable, methods_registered), Methods (is_passwordless_capable, is_sspr_registered, default_mfa_method)
directory_role β Activated directory (admin) roles: Role (id, name, description)
group_role_assignment β Directory roles assigned to groups; join to user groups for inherited rights: Assignment (group_id, role_id, role_name, scope)
privileged_account β Reference definition of an administrator: direct roles, roles inherited from a group, and PIM roles. For standing administrators, filter on assignment_type = permanent: Account (principal_id, principal_type, principal_name, user_principal_name), Role (role_id, role_name, scope), Origin (direct, group, registration) (assignment_path, via_group_id, via_group_name), PIM: permanent, activated or eligible (empty without RoleManagement.Read.Directory) (assignment_type, start_datetime, end_datetime)
conditional_access_policy β Conditional-access policies: how MFA is enforced. Requires Policy.Read.All and Entra ID P1: Policy (policy_id, display_name, state, is_enforced, is_report_only), Targets and exclusions (JSON) (include_users, exclude_users, include_groups, include_roles, include_applications, include_locations), Controls (grant_controls, session_controls, authentication_strength_name), Summary (requires_mfa, blocks_access, targets_all_users, targets_legacy_authentication)
named_location β Named locations referenced by conditional-access policies. Requires Policy.Read.All and Entra ID P1 (empty without the licence): Location (location_id, display_name, location_type, is_trusted), Scope (ip_ranges, countries, include_unknown_countries)
tenant_policy β Tenant security defaults and authentication methods policy. Requires Policy.Read.All: Security defaults (exclusive of conditional access) (security_defaults_enabled), Methods (JSON) (authentication_methods, enabled_authentication_methods), Authenticator registration campaign (registration_campaign_state, registration_campaign_snooze_days)
risky_user β Risky users (Entra ID Protection). Open risk: risk_state = atRisk or confirmedCompromised. Requires IdentityRiskyUser.Read.All and Entra ID P2: User (user_id, user_principal_name, user_display_name), Risk (risk_level, risk_state, risk_detail, risk_last_updated_datetime)
risk_detection β Risk detections, including offline ones (leaked credentialsβ¦). Requires IdentityRiskEvent.Read.All and Entra ID P2: Detection (detection_id, user_id, user_principal_name), Risk (risk_event_type, risk_level, risk_state, source, activity), Context (ip_address, location_country, activity_datetime, detected_datetime)
signin_service_principal β Preview (Graph beta API): sign-ins of applications authenticating as themselves, absent from signin. Requires Entra ID P1/P2: Application (service_principal_id, service_principal_name, app_id), Sign-in (date, status, error_code, client_credential_type), Context (resource_display_name, ip_address, location_country)
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].