-
Notifications
You must be signed in to change notification settings - Fork 4
Get MDE (Microsoft Defender for Endpoint) API credentials
Important
Requirements: Microsoft Defender for Endpoint is a paid service, you must have a tenant to get API keys.
You will need an Azure Global Admin to help you.
To interact with the Microsoft Defender for Endpoint API, you need to obtain the following credentials:
- Tenant ID (
mde_tenant_id
insecrets.json
) - Client ID (
mde_client_id
insecrets.json
) - Client Secret (
mde_client_secret
insecrets.json
)
Additionally, you need to assign the appropriate API permissions to your application to check IP addresses, hashes, domains, and URLs.
- Go to the Azure Portal.
- Navigate to Entra ID > App registrations.
- Click New registration.
- Enter a name for your application.
- Select the supported account types.
- Click Register.
- After registering the application, you will be redirected to the application's overview page.
- Copy the Application (client) ID. This is your Client ID.
- Copy the Directory (tenant) ID. This is your Tenant ID.
- In the application's overview page, navigate to Certificates & secrets.
- Under Client secrets, click New client secret.
- Add a description and set an expiration period.
- Click Add.
- Copy the value of the client secret. This is your Client Secret. Note: Make sure to copy it now as it will not be shown again.
- In the application's overview page, navigate to API permissions.
- Click Add a permission.
- Select APIs my organization uses.
- Search for Microsoft Defender for Endpoint.
- Select Application permissions.
- Add the following permissions:
File.Read.All
Ip.Read.All
Url.Read.All
Note
Ensure that these permissions are added under the Application permissions section, not Delegated permissions.
- Click Add permissions.
- After adding the permissions, click Grant admin consent for [Your Organization].
- Confirm by clicking Yes.
You now have the Tenant ID, Client ID, and Client Secret required to authenticate with the Microsoft Defender for Endpoint API. Additionally, you have assigned the necessary permissions to check IP addresses, hashes, domains, and URLs.
For more information, consult the official documentation: https://learn.microsoft.com/en-us/defender-endpoint/api/exposed-apis-create-app-webapp