Integrating with Defender
This section outlines the steps required to integrate delivr.to with Microsoft 365 Defender, via the Graph API.
For this, you will need to create an App Registration
in Azure, assign it the necessary privileges, and then provide delivr.to with the credentials. Let’s set this app up first.
Creating the Azure application
- Head to the
App registrations
portal in Azure AD here and clickNew registration
- Give it a sensible name such as
delivr.to Defender Integration
, leave the rest default and clickRegister
- Go to
API Permissions
and clickAdd permission
- Select
Microsoft Graph
and chooseApplication permissions
- In the search bar, enter
ThreatHunting.Read.All
, check the tickbox and clickAdd permissions
- Click
Grant admin consent for <YOUR TENANT>
and thenYes
on the confirmation box - Go to
Certificates & secrets
, clickNew client secret
, give it a sensible description and then clickAdd
- Take a note of the
Value
as it won’t be displayed again. This is yourClient Secret
- Click
Overview
and take a note of theApplication (client) ID
andDirectory (tenant) ID
, this is yourClient ID
andTenant ID
respectively
delivr.to asks for the OAuth scope ThreatHunting.Read.All
, which is the least amount of privilege required to retrieve detailed information about an email-based anti-malware event. Only two KQL queries will ever be executed, one during integration to confirm the privilege is correctly set, and one each time the status of an email is checked.
- KQL executed during integration:
EmailEvents | where Subject contains "delivr.to"
- KQL executed during email status checking:
EmailEvents | where Subject contains "<CAMPAIGN ID>" | where RecipientEmailAddress == "<RECIPIENT ADDRESS>"
Adding the integration
- Head to the Settings portal and navigate to the
Security Tool Integrations
section - Select the mailbox you wish to associate with this integration from the dropdown and click
Integrate with Defender 365
- Populate the fields with the
Tenant ID
,Client ID
, andClient Secret
that you generated in the previous section - Click
Add
If successful, you should see this message, and your new integration will appear in the table.
You’re all set! You should now be able to send your campaigns and automatically see what has been delivered!