Skip to content
Connector

Microsoft 365 Defender v2

Triage Microsoft 365 Defender incidents and contain endpoints

Reads and updates Defender incidents, alerts, devices and indicators; isolates, scans or collects evidence from endpoints.

@ftnt-dspilleMaintainer v3.0.2 Published Nov 28, 2026
Download .tgz · 21 KB

microsoft-365-defender-v2_3.0.2.tgz

sha256:c6daf37012224e3644c363fc264002b0ea0c755226d2ee8f7d4a7612d29f8791

Community code that runs on your platform. A maintainer reviewed this exact source; the download is rebuilt from it. Follow the to install it.

Connects FortiSOAR to Microsoft 365 Defender to triage incidents and contain endpoints. It lists and reads Defender incidents, alerts, devices, files and threat indicators; updates an incident or alert's status, owner, classification, tags or comment; submits, lists and deletes custom file, IP, domain and URL indicators; isolates and releases devices; runs antivirus scans; collects investigation packages and gets their download link; restricts and unrestricts application execution; stops and quarantines files; runs read-only advanced hunting queries; and sends a generic request to any other Defender API path. Every operation validates its parameters before it calls Defender, and machine actions are followed to completion.

Live-tested on FortiSOAR 8.0.1 against a Microsoft 365 lab tenant.

Authentication: the connector needs an app registration in Microsoft Entra ID with these application permissions, granted with admin consent. Defender for Endpoint: Machine.Read.All, Machine.ReadWrite.All, Machine.Isolate, Machine.Scan, Machine.RestrictExecution, Machine.CollectForensics, Alert.Read.All, Alert.ReadWrite.All, Ip.Read.All, Url.Read.All, File.Read.All, Ti.Read.All, Ti.ReadWrite.All. Microsoft Graph: ThreatHunting.Read.All (advanced hunting). Microsoft Threat Protection: Incident.Read.All, Incident.ReadWrite.All (incidents). The tested mode is "Without a User - Application Permission". Delegated (on behalf of a user) sign-in is refused for the machine, alert, indicator and file operations.

Known issues

  • Restrict App Execution can apply on the device while the Defender action status reports Failed (0x802A0001). After a restrict, run Unrestrict App Execution to verify and clear it, even when the API reports Failed. Not live-tested
  • Run Antivirus Scan operation: the playbook branch completed, but Defender refused the scan on the device (device-side action failure), so a finished scan was not seen.
  • Stop And Quarantine File operation: the test file's hash was not on the one lab device, so Defender returned not found.
  • Respond to Defender Endpoint Incident, "Close Not Onboarded" branch: the lab tenant has one onboarded device, so no device that is not onboarded could be produced.
  • Triage Defender Incident to Response, approve paths (user path and no-user path): the approval step was never answered. The Teams approval listener was stopped in the lab, so no approval card could be answered.
  • Triage Defender Incident to Response, reject path: same reason as the approve paths; no card could be answered.

Configuration · 2 fields

  • Get Access Token auth_type select required

    Select the method using which you will get authentication tokens used to access the Microsoft 365 Defender APIs. You can choose between On behalf of User - Delegate Permission or Without a User - Application Permission. For more information, see the Getting Access Tokens section.

    Options On behalf of User - Delegated PermissionWithout a User - Application Permission

    When Get Access Token is Without a User - Application Permission

    • Server URL resource text required

      The service-based URL to which you will connect and perform the automated operations.

      Default https://api.security.microsoft.com

    • Directory (tenant) ID tenant_id text required

      The ID of the tenant that you have been provided for your Azure Network Security Group instance.

    • Application (client) ID client_id text required

      Unique ID of the Azure Network Security Group application that is used to create an authentication token required to access the API.

    • Application (Client) Secret client_secret password required

      Unique Client Secret of the Azure Network Security Group application that is used to create an authentication token required to access the API. For information on how to get the secret key, see https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.

    When Get Access Token is On behalf of User - Delegated Permission

    • Server URL resource text required

      The service-based URL to which you will connect and perform the automated operations.

      Default https://api.security.microsoft.com

    • Directory (tenant) ID tenant_id text required

      The ID of the tenant that you have been provided for your Azure Network Security Group instance.

    • Application (client) ID client_id text required

      Unique ID of the Azure Network Security Group application that is used to create an authentication token required to access the API.

    • Application (Client) Secret client_secret password required

      Unique Client Secret of the Azure Network Security Group application that is used to create an authentication token required to access the API. For information on how to get the secret key, see https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.

    • Authorization Code code password required

      (Only Applicable to On behalf of User - Delegate Permission) The authorization code that you acquired during the authorization step. For more information, see the Getting Access Tokens using the On behalf of the user - Delegate Permission method section.

    • Redirect URI redirect_url text

      (Only Applicable to On behalf of User - Delegate Permission) The redirect_uri of your app, where authentication responses can be sent and received by your app. The redirect URL that you specify here must exactly match one of the redirect_uri's you have registered in your app registration portal.

  • Verify SSL verify_ssl checkbox

    Specifies whether the SSL certificate for the server is to be verified or not. By default, this option is set as True.

    Default true

Operations · 29

  • List Incidents 8 params
    list_incidents

    Lists Microsoft 365 Defender incidents, with status, assignee and time filters, all pages on request.

    • Last Update Time lastUpdateTime text

      Only incidents updated at or after this time (UTC, ISO 8601, for example 2026-01-15T08:00:00Z).

    • Created Time createdTime text

      Only incidents created at or after this time (UTC, ISO 8601, for example 2026-01-15T08:00:00Z).

    • Status status select

      status

      Options ActiveResolvedIn ProgressRedirected
    • Assigned To assignedTo text

      The owner as a user principal name or email. Leave empty to keep the current owner.

    • Query query text

      Extra OData filter clause, combined with the other filters.

    • Skip skip number

      skip

    • Top top number

      Maximum number of results to return.

    • Get All Records get_all_records checkbox

      Follow every page of results (ignores Skip and Top).

      Default false

  • Get Incident 1 param
    get_incident

    Fetches one Defender incident with its alerts, devices and comments.

    • ID id select required

      Pick from the list or enter the ID.

  • Update Incident 6 params
    update_incident

    Updates the status, owner, classification, tags or comment of a Defender incident.

    • ID id select required

      Pick from the list or enter the ID.

    • Status status select

      status

      Options ActiveResolvedIn ProgressRedirected
    • Assigned To assignedTo text

      The owner as a user principal name or email. Leave empty to keep the current owner.

    • Classification classification select

      classification

      Options TruePositiveInformational, expected activityFalsePositive
    • Tags tags text

      Comma-separated tags to add to the incident.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Run Advanced Hunting Query 1 param
    advanced_hunting

    Runs a KQL advanced hunting query through Microsoft Graph v1.0 runHuntingQuery (ThreatHunting.Read.All, app-only).

    • Query Query text required

      KQL advanced hunting query. Runs through Microsoft Graph runHuntingQuery.

  • List Machines 2 params
    list_machines

    Lists onboarded devices (machines) in Defender, with an optional OData filter.

    • Filter filter text

      OData $filter expression, for example healthStatus eq 'Active'.

    • Top top number

      Maximum number of results to return.

  • Get Machine 1 param
    get_machine

    Fetches one device by its 40-character machine ID.

    • ID id select required

      Pick from the list or enter the ID.

  • Isolate Machine 3 params
    isolate_machine

    Network-isolates a device (Full or Selective).

    • ID id select required

      Pick from the list or enter the ID.

    • Isolation Type isolation_type select

      Full cuts all network access except Defender. Selective keeps Outlook and Teams.

      Default Full

      Options FullSelective
    • Comment comment text

      Free text recorded with the action in Defender.

  • Release Machine From Isolation 2 params
    unisolate_machine

    Releases a device from network isolation.

    • ID id select required

      Pick from the list or enter the ID.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Run Antivirus Scan 3 params
    run_av_scan

    Starts a Quick or Full antivirus scan on a device.

    • ID id select required

      Pick from the list or enter the ID.

    • Scan Type scan_type select

      Quick scans the usual malware locations. Full scans every file.

      Default Quick

      Options QuickFull
    • Comment comment text

      Free text recorded with the action in Defender.

  • Collect Investigation Package 2 params
    collect_investigation_package

    Starts collection of an investigation package on a device.

    • ID id select required

      Pick from the list or enter the ID.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Restrict App Execution 2 params
    restrict_app_execution

    Restricts code execution on a device to Microsoft-signed code.

    • ID id select required

      Pick from the list or enter the ID.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Remove App Execution Restriction 2 params
    unrestrict_app_execution

    Removes the code-execution restriction from a device.

    • ID id select required

      Pick from the list or enter the ID.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Get Machine Action 1 param
    get_machine_action

    Fetches a machine action by ID, to poll it to completion.

    • ID id text required

      Pick from the list or enter the ID.

  • Cancel Machine Action 2 params
    cancel_machine_action

    Cancels a machine action that has not reached a final state.

    • ID id text required

      Pick from the list or enter the ID.

    • Comment comment text

      Free text recorded with the action in Defender.

  • Stop And Quarantine File 3 params
    stop_and_quarantine_file

    Stops a file (by SHA-1) on a device and quarantines it.

    • ID id select required

      Pick from the list or enter the ID.

    • SHA-1 sha1 text required

      SHA-1 hash of the file (40 hex characters).

    • Comment comment text

      Free text recorded with the action in Defender.

  • Get Investigation Package SAS URI 1 param
    get_investigation_package_sas_uri

    Returns the short-lived download link for a completed investigation package.

    • ID id text required

      Pick from the list or enter the ID.

  • List Alerts 3 params
    list_alerts

    Lists Defender for Endpoint alerts, with an OData filter and optional evidence.

    • Filter filter text

      OData $filter expression, for example healthStatus eq 'Active'.

    • Top top number

      Maximum number of results to return.

    • Expand Evidence expand_evidence checkbox

      Include the evidence list for each alert (slower).

      Default false

  • Get Alert 1 param
    get_alert

    Fetches one Defender for Endpoint alert by ID.

    • ID id select required

      Pick from the list or enter the ID.

  • Update Alert 6 params
    update_alert

    Updates the status, owner, classification, determination or comment of an alert.

    • ID id select required

      Pick from the list or enter the ID.

    • Status status select

      status

      Options NewInProgressResolved
    • Assigned To assignedTo text

      The owner as a user principal name or email. Leave empty to keep the current owner.

    • Classification classification select

      classification

      Options TruePositiveInformationalExpectedActivityFalsePositive
    • Determination determination select

      determination

      Options Multistage attackMalicious user activityCompromised accountMalwarePhishingUnwanted softwareOtherSecurity testLine-of-business applicationConfirmed activityNot maliciousNot enough data to validate
    • Comment comment text

      Free text recorded with the action in Defender.

  • Submit Indicator 9 params
    submit_indicator

    Creates a custom threat indicator (file hash, IP, domain or URL) with an allow, audit or block action. Requires Ti.ReadWrite.All.

    • Indicator Value indicatorValue text required

      The hash, IP address, domain or URL to match.

    • Indicator Type indicatorType select required

      indicatorType

      Options FileSha1FileSha256IpAddressDomainNameUrlCertificateThumbprint
    • action action select required

      action

      Options AllowedAuditBlockAlertAlertAndBlockBlockAndRemediate
    • title title text required

      title

    • description description text required

      description

    • severity severity select

      severity

      Default Medium

      Options InformationalLowMediumHigh
    • Expiration Time expirationTime text

      When the indicator expires (UTC, ISO 8601). Leave empty for no expiry.

    • Recommended Actions recommendedActions text

      recommendedActions

    • Generate Alert generateAlert checkbox

      Raise an alert when the indicator matches. Required for the Audit action.

      Default true

  • List Indicators
    list_indicators

    Lists custom threat indicators. Requires Ti.Read.All or Ti.ReadWrite.All.

    No parameters.

  • Delete Indicator 1 param
    delete_indicator

    Deletes a custom threat indicator by ID.

    • ID id text required

      Pick from the list or enter the ID.

  • Get File Info 1 param
    get_file_info

    Returns Defender's file profile for a SHA-1 hash.

    • SHA-1 sha1 text required

      SHA-1 hash of the file (40 hex characters).

  • Get File Related Machines 1 param
    get_file_related_machines

    Lists the devices that have seen a file (SHA-1).

    • SHA-1 sha1 text required

      SHA-1 hash of the file (40 hex characters).

  • Get File Related Alerts 1 param
    get_file_related_alerts

    Lists the alerts that reference a file (SHA-1).

    • SHA-1 sha1 text required

      SHA-1 hash of the file (40 hex characters).

  • Execute Defender API Request 4 params
    execute_api_request

    Calls any Defender XDR API path under /api/ with the connector's authentication. Use for endpoints that have no dedicated operation.

    • Method method select

      method

      Default GET

      Options GETPOSTPATCHPUTDELETE
    • Endpoint endpoint text required

      Defender API path under /api/, for example /api/machines.

    • Query Parameters params textarea

      Query parameters as a JSON object, for example {"$top": "5"}.

    • Body body textarea

      Request body as JSON.

  • Get Machine Options
    get_machine_options

    Lists up to 200 onboarded devices as "name [machine ID]" choices for the Machine dropdowns.

    No parameters.

  • Get Alert Options
    get_alert_options

    Lists up to 200 Defender for Endpoint alerts, newest first, as "title [alert ID]" choices.

    No parameters.

  • Get Incident Options
    get_incident_options

    Lists up to 200 Defender incidents as "name [incident ID]" choices.

    No parameters.

Something wrong with this item? Sign in to report

Report a problem

Sensitive data, copied content, broken imports, anything that shouldn't be here.

At least 10 characters. Please don't paste the sensitive value itself.0/1000