You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-endpoint/api/exposed-apis-create-app-webapp.md
+35-22Lines changed: 35 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,9 +51,12 @@ In general, you'll need to take the following steps to use the APIs:
51
51
52
52
This article explains how to create a Microsoft Entra application, get an access token to Microsoft Defender for Endpoint, and validate the token.
53
53
54
+
> [!IMPORTANT]
55
+
> Microsoft recommends that you use roles with the fewest permissions. This helps improve security for your organization. Global Administrator is a highly privileged role that should be limited to emergency scenarios when you can't use an existing role.
56
+
54
57
## Create an app
55
58
56
-
1.Log on to [Azure](https://portal.azure.com) with a user that has the **Global Administrator** role.
59
+
1.Sign in to the [Azure portal](https://portal.azure.com) with a user that has the Global Administrator role.
57
60
58
61
2. Navigate to **Microsoft Entra ID**\>**App registrations**\>**New registration**.
59
62
@@ -64,55 +67,55 @@ This article explains how to create a Microsoft Entra application, get an access
64
67
4. To enable your app to access Defender for Endpoint and assign it **'Read all alerts'** permission, on your application page, select **API Permissions**\>**Add permission**\>**APIs my organization uses** >, type **WindowsDefenderATP**, and then select **WindowsDefenderATP**.
65
68
66
69
> [!NOTE]
67
-
> *WindowsDefenderATP* does not appear in the original list. Start writing its name in the text box to see it appear.
70
+
> `WindowsDefenderATP` does not appear in the original list. Start writing its name in the text box to see it appear.
68
71
69
72
:::image type="content" source="../media/add-permission.png" alt-text="The API permissions pane" lightbox="../media/add-permission.png":::
70
73
71
74
Select **Application permissions**\>**Alert.Read.All**, and then select **Add permissions**.
72
75
73
76
:::image type="content" source="../media/application-permissions.png" alt-text="The application permission information pane" lightbox="../media/application-permissions.png":::
74
77
75
-
You need to select the relevant permissions. 'Read All Alerts' is only an example. For example:
78
+
5. Select appropriate permissions. `Read All Alerts` is only an example. Here are some examples:
76
79
77
-
- To [run advanced queries](run-advanced-query-api.md), select the 'Run advanced queries' permission.
78
-
- To [isolate a device](isolate-machine.md), select the 'Isolate machine' permission.
79
-
- To determine which permission you need, look at the **Permissions** section in the API you are interested to call.
80
+
- To [run advanced queries](run-advanced-query-api.md), select the `Run advanced queries` permission.
81
+
- To [isolate a device](isolate-machine.md), select the `Isolate machine` permission.
82
+
- To determine which permission you need, look at the **Permissions** section in the API you are interested to call.
80
83
81
84
5. Select **Grant consent**.
82
85
83
-
> [!NOTE]
84
-
> Every time you add a permission, you must select **Grant consent** for the new permission to take effect.
86
+
> [!NOTE]
87
+
> Every time you add a permission, you must select **Grant consent** for the new permission to take effect.
85
88
86
-
:::image type="content" source="../media/grant-consent.png" alt-text="The grant permissions page" lightbox="../media/grant-consent.png":::
89
+
:::image type="content" source="../media/grant-consent.png" alt-text="The grant permissions page" lightbox="../media/grant-consent.png":::
87
90
88
91
6. To add a secret to the application, select **Certificates & secrets**, add a description to the secret, and then select **Add**.
89
92
90
-
> [!NOTE]
91
-
> After you select **Add**, select **copy the generated secret value**. You won't be able to retrieve this value after you leave.
93
+
> [!NOTE]
94
+
> After you select **Add**, select **copy the generated secret value**. You won't be able to retrieve this value after you leave.
7. Write down your application ID and your tenant ID. On your application page, go to **Overview** and copy the following.
96
99
97
100
:::image type="content" source="../media/app-and-tenant-ids.png" alt-text="The created app and tenant IDs" lightbox="../media/app-and-tenant-ids.png":::
98
101
99
-
8.**For Microsoft Defender for Endpoint Partners only**. Set your app to be multi-tenanted (available in all tenants after consent). This is **required** for third-party apps (for example, if you create an app that is intended to run in multiple customers' tenant). This is **not required** if you create a service that you want to run in your tenant only (for example, if you create an application for your own usage that will only interact with your own data). To set your app to be multi-tenanted:
102
+
8.**For Microsoft Defender for Endpoint Partners only**. Set your app to be multi-tenanted (available in all tenants after consent). This is **required** for third-party apps (for example, if you create an app that is intended to run in multiple customers' tenant). This is **not required** if you create a service that you want to run in your tenant only (for example, if you create an application for your own usage that will only interact with your own data). To set your app to be multi-tenanted, follow these steps:
100
103
101
-
- Go to **Authentication**, and add `https://portal.azure.com` as the **Redirect URI**.
104
+
1. Go to **Authentication**, and add `https://portal.azure.com` as the **Redirect URI**.
102
105
103
-
- On the bottom of the page, under **Supported account types**, select the **Accounts in any organizational directory** application consent for your multi-tenant app.
106
+
2. On the bottom of the page, under **Supported account types**, select the **Accounts in any organizational directory** application consent for your multi-tenant app.
104
107
105
-
You need your application to be approved in each tenant where you intend to use it. This is because your application interacts Defender for Endpoint on behalf of your customer.
108
+
You need your application to be approved in each tenant where you intend to use it. This is because your application interacts Defender for Endpoint on behalf of your customer.
106
109
107
-
You (or your customer if you are writing a third-party app) need to select the consent link and approve your app. The consent should be done with a user who has administrative privileges in Active Directory.
110
+
You (or your customer if you are writing a third-party app) need to select the consent link and approve your app. The consent should be done with a user who has administrative privileges in Active Directory.
Where 00000000-0000-0000-0000-000000000000 is replaced with your application ID.
118
+
Where `00000000-0000-0000-0000-000000000000` is replaced with your application ID.
116
119
117
120
118
121
**Done!** You have successfully registered an application! See examples below for token acquisition and validation.
@@ -152,7 +155,9 @@ The following code was tested with NuGet Microsoft.Identity.Client 3.19.8.
152
155
> The [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory) NuGet package and Azure AD Authentication Library (ADAL) have been deprecated. No new features have been added since June 30, 2020. We strongly encourage you to upgrade, see the [migration guide](/azure/active-directory/develop/msal-migration) for more details.
0 commit comments