Skip to content

Commit 259f87b

Browse files
committed
addressed acrolinx
1 parent dd154f9 commit 259f87b

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

defender-xdr/api-create-app-web.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ appliesto:
2828
[!INCLUDE [Microsoft Defender XDR rebranding](../includes/microsoft-defender.md)]
2929

3030
> [!IMPORTANT]
31-
> Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
31+
> Some information relates to prereleased product which may be substantially modified before its general availability. Microsoft makes no warranties, express or implied, with respect to the information provided here.
3232
3333
This page describes how to create an application to get programmatic access to Microsoft Defender XDR without a defined user—for example, if you're creating a daemon or background service.
3434

3535
If you need programmatic access to Microsoft Defender XDR on behalf of one or more users, see [Create an app to access Microsoft Defender XDR APIs on behalf of a user](api-create-app-user-context.md) and [Create an app with partner access to Microsoft Defender XDR APIs](api-partner-access.md). If you're not sure which kind of access you need, see [Get started](api-access.md).
3636

3737
Microsoft Defender XDR exposes much of its data and actions through a set of programmatic APIs. Those APIs help you automate workflows and make use of Microsoft Defender XDR's capabilities. This API access requires OAuth2.0 authentication. For more information, see [OAuth 2.0 Authorization Code Flow](/azure/active-directory/develop/active-directory-v2-protocols-oauth-code).
3838

39-
In general, you'll need to take the following steps to use these APIs:
39+
In general, you need to take the following steps to use these APIs:
4040

4141
- Create a Microsoft Entra application.
4242
- Get an access token using this application.
@@ -61,7 +61,7 @@ This article explains how to:
6161
4. On your application page, select **API Permissions** > **Add permission** > **APIs my organization uses** >, type **Microsoft Threat Protection**, and select **Microsoft Threat Protection**. Your app can now access Microsoft Defender XDR.
6262

6363
> [!TIP]
64-
> *Microsoft Threat Protection* is a former name for Microsoft Defender XDR, and will not appear in the original list. You need to start writing its name in the text box to see it appear.
64+
> *Microsoft Threat Protection* is a former name for Microsoft Defender XDR, and doesn't appear in the original list. You need to start writing its name in the text box to see it appear.
6565
6666
:::image type="content" source="/defender/media/apis-in-my-org-tab.PNG" alt-text="The organization's APIs usage tab in the Microsoft Defender portal" lightbox="/defender/media/apis-in-my-org-tab.PNG":::
6767

@@ -70,7 +70,7 @@ This article explains how to:
7070
:::image type="content" source="/defender/media/request-api-permissions.PNG" alt-text="The application permission pane in the Microsoft Defender portal" lightbox="/defender/media/request-api-permissions.PNG":::
7171

7272
> [!NOTE]
73-
> You need to select the relevant permissions for your scenario. *Read all incidents* is just an example. To determine which permission you need, please look at the **Permissions** section in the API you want to call.
73+
> You need to select the relevant permissions for your scenario. *Read all incidents* is just an example. To determine which permission you need, check the **Permissions** section in the API you want to call.
7474
>
7575
> For instance, to [run advanced queries](api-advanced-hunting.md), select the 'Run advanced queries' permission; to [isolate a device](/windows/security/threat-protection/microsoft-defender-atp/isolate-machine), select the 'Isolate machine' permission.
7676
@@ -89,11 +89,11 @@ This article explains how to:
8989

9090
:::image type="content" source="/defender/media/app-and-tenant-ids.png" alt-text="The Overview pane in the Microsoft Defender portal" lightbox="/defender/media/app-and-tenant-ids.png":::
9191

92-
9. **For Microsoft Defender XDR Partners only**: [Follow these instructions](./api-partner-access.md) for partner access through the Microsoft Defender XDR APIs, set your app to be multi-tenant, so it can be available in all tenants once you receive admin consent. Partner access is **required** for third-party apps—for example, if you create an app that is intended to run in multiple customers' tenants. It is **not required** if you create a service that you want to run in your tenant only, such as an application for your own usage that will only interact with your own data. To set your app to be multi-tenant:
92+
9. **For Microsoft Defender XDR Partners only**: [Follow these instructions](./api-partner-access.md) for partner access through the Microsoft Defender XDR APIs, set your app to be multitenant, so it can be available in all tenants once you receive admin consent. Partner access is **required** for third-party apps—for example, if you create an app that is intended to run in multiple customers' tenants. It is **not required** if you create a service that you want to run in your tenant only, like an application for your own use that only interacts with your own data. To set your app to be multitenant:
9393

9494
- Go to **Authentication**, and add https://portal.azure.com as the **Redirect URI**.
9595

96-
- On the bottom of the page, under **Supported account types**, select the **Accounts in any organizational directory** application consent for your multi-tenant app.
96+
- On the bottom of the page, under **Supported account types**, select the **Accounts in any organizational directory** application consent for your multitenant app.
9797

9898
Since your application interacts with Microsoft Defender XDR on behalf of your users, it needs be approved for every tenant on which you intend to use it.
9999

@@ -107,7 +107,7 @@ This article explains how to:
107107
108108
The digits `00000000-0000-0000-0000-000000000000` should be replaced with your Application ID.
109109
110-
**Done!** You've successfully registered an application! See examples below for token acquisition and validation.
110+
**Done!** You've successfully registered an application! See the following examples for token acquisition and validation.
111111
112112
## Get an access token
113113
@@ -149,7 +149,7 @@ return $token
149149
> The following code was tested with Nuget Microsoft.Identity.Client 3.19.8.
150150
151151
> [!IMPORTANT]
152-
> 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.
152+
> The [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory) NuGet package and Azure AD Authentication Library (ADAL) were deprecated. No new features were added since June 30, 2020. We strongly encourage you to upgrade, see the [migration guide](/azure/active-directory/develop/msal-migration) for more details.
153153
154154
1. Create a new console application.
155155

@@ -227,7 +227,7 @@ aadToken = jsonResponse["access_token"]
227227
curl -i -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "grant_type=client_credentials" -d "client_id=%CLIENT_ID%" -d "scope=https://api.security.microsoft.com/.default" -d "client_secret=%CLIENT_SECRET%" "https://login.microsoftonline.com/%TENANT_ID%/oauth2/v2.0/token" -k
228228
```
229229

230-
A successful response will look like this:
230+
A successful response looks like this:
231231

232232
```bash
233233
{"token_type":"Bearer","expires_in":3599,"ext_expires_in":0,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIn <truncated> aWReH7P0s0tjTBX8wGWqJUdDA"}
@@ -249,9 +249,9 @@ aadToken = jsonResponse["access_token"]
249249

250250
1. Choose the API you want to use (incidents, or advanced hunting). For more information, see [Supported Microsoft Defender XDR APIs](api-supported.md).
251251

252-
2. In the http request you are about to send, set the authorization header to `"Bearer" <token>`, *Bearer* being the authorization scheme, and *token* being your validated token.
252+
2. In the HTTP-based request you're about to send, set the authorization header to `"Bearer" <token>`, *Bearer* being the authorization scheme, and *token* being your validated token.
253253

254-
3. The token will expire within one hour. You can send more than one request during this time with the same token.
254+
3. The token expires within one hour. You can send more than one request during this time with the same token.
255255

256256
The following example shows how to send a request to get a list of incidents **using C#**.
257257

@@ -270,7 +270,7 @@ The following example shows how to send a request to get a list of incidents **u
270270
- [Access the Microsoft Defender XDR APIs](api-access.md)
271271
- [Create a 'Hello world' application](api-hello-world.md)
272272
- [Create an app to access Microsoft Defender XDR APIs on behalf of a user](api-create-app-user-context.md)
273-
- [Create an app with multi-tenant partner access to Microsoft Defender XDR APIs](api-partner-access.md)
273+
- [Create an app with multitenant partner access to Microsoft Defender XDR APIs](api-partner-access.md)
274274
- [Learn about API limits and licensing](/legal/microsoft-365/api-terms)
275275
- [Understand error codes](api-error-codes.md)
276276
- [Manage secrets in your server apps with Azure Key Vault](/training/modules/manage-secrets-with-azure-key-vault/)

defender-xdr/api-hello-world.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ appliesto:
2828
[!INCLUDE [Microsoft Defender XDR rebranding](../includes/microsoft-defender.md)]
2929

3030
> [!IMPORTANT]
31-
> Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
31+
> Some information relates to prereleased product which may be substantially modified before its general availability. Microsoft makes no warranties, express or implied, with respect to the information provided here.
3232
3333
## Get incidents using a simple PowerShell script
3434

@@ -44,12 +44,12 @@ It should take 5 to 10 minutes to complete this project. This time estimate incl
4444

4545
:::image type="content" source="/defender/media/atp-azure-new-app2.png" alt-text="The New registration section in the Microsoft Defender portal" lightbox="/defender/media/atp-azure-new-app2.png":::
4646

47-
3. In the registration form, choose a name for your application, then select **Register**. Selecting a redirect URI is optional. You won't need one to complete this example.
47+
3. In the registration form, choose a name for your application, then select **Register**. Selecting a redirect URI is optional. You don't need one to complete this example.
4848

4949
4. On your application page, select **API Permissions** > **Add permission** > **APIs my organization uses** >, type **Microsoft Threat Protection**, and select **Microsoft Threat Protection**. Your app can now access Microsoft Defender XDR.
5050

5151
> [!TIP]
52-
> *Microsoft Threat Protection* is a former name for Microsoft Defender XDR, and will not appear in the original list. You need to start writing its name in the text box to see it appear.
52+
> *Microsoft Threat Protection* is a former name for Microsoft Defender XDR, and doesn't appear in the original list. You need to start writing its name in the text box to see it appear.
5353
:::image type="content" source="/defender/media/apis-in-my-org-tab.PNG" alt-text="The section of APIs usage in the Microsoft Defender portal" lightbox="/defender/media/apis-in-my-org-tab.PNG":::
5454

5555
- Choose **Application permissions** > **Incident.Read.All** and select **Add permissions**.
@@ -77,11 +77,11 @@ It should take 5 to 10 minutes to complete this project. This time estimate incl
7777
For more information on Microsoft Entra tokens, see the [Microsoft Entra tutorial](/azure/active-directory/develop/active-directory-v2-protocols-oauth-client-creds).
7878

7979
> [!IMPORTANT]
80-
> Although the example in this demo app encourage you to paste in your secret value for testing purposes, you should **never hardcode secrets** into an application running in production. A third party could use your secret to access resources. You can help keep your app's secrets secure by using [Azure Key Vault](/azure/key-vault/general/about-keys-secrets-certificates). For a practical example of how you can protect your app, see [Manage secrets in your server apps with Azure Key Vault](/training/modules/manage-secrets-with-azure-key-vault/).
80+
> Although the example in this demo app encourages you to paste in your secret value for testing purposes, you should **never hardcode secrets** into an application running in production. A third party could use your secret to access resources. You can help keep your app's secrets secure by using [Azure Key Vault](/azure/key-vault/general/about-keys-secrets-certificates). For a practical example of how you can protect your app, see [Manage secrets in your server apps with Azure Key Vault](/training/modules/manage-secrets-with-azure-key-vault/).
8181
82-
1. Copy the script below and paste it into your favorite text editor. Save as **Get-Token.ps1**. You can also run the code as-is in PowerShell ISE, but you should save it, because we'll need to run it again when we use the incident-fetching script in the next section.
82+
1. Copy the following script and paste it into your favorite text editor. Save as **Get-Token.ps1**. You can also run the code as-is in PowerShell ISE, but you need save it because we need to run it again when we use the incident-fetching script in the next section.
8383

84-
This script will generate a token and save it in the working folder under the name, *Latest-token.txt*.
84+
This script generates a token and save it in the working folder under the name, *Latest-token.txt*.
8585

8686
```PowerShell
8787
# This script gets the app context token and saves it to a file named "Latest-token.txt" under the current directory.
@@ -108,15 +108,15 @@ For more information on Microsoft Entra tokens, see the [Microsoft Entra tutoria
108108
#### Validate the token
109109
110110
1. Copy and paste the token you received into [JWT](https://jwt.ms) to decode it.
111-
1. *JWT* stands for *JSON Web Token*. The decoded token will contain a number of JSON-formatted items or claims. Make sure that the *roles* claim within the decoded token contains the desired permissions.
111+
1. *JWT* stands for *JSON Web Token*. The decoded token contains several of JSON-formatted items or claims. Make sure that the *roles* claim within the decoded token contains the desired permissions.
112112
113113
In the following image, you can see a decoded token acquired from an app, with ```Incidents.Read.All```, ```Incidents.ReadWrite.All```, and ```AdvancedHunting.Read.All``` permissions:
114114
115115
:::image type="content" source="/defender/media/api-jwt-ms.png" alt-text="The Decoded Token section in the Microsoft Defender portal" lightbox="/defender/media/api-jwt-ms.png":::
116116
117117
### Get a list of recent incidents
118118
119-
The script below will use **Get-Token.ps1** to access the API. It then retrieves a list of incidents that were last updated within the past 48 hours, and saves the list as a JSON file.
119+
The following script uses **Get-Token.ps1** to access the API. It then retrieves a list of incidents that were last updated within the past 48 hours, and saves the list as a JSON file.
120120
121121
> [!IMPORTANT]
122122
> Save this script in the same folder you saved **Get-Token.ps1**.
@@ -171,7 +171,7 @@ You're all done! You've successfully:
171171
- [Access the Microsoft Defender XDR APIs](api-access.md)
172172
- [Create an app to access Microsoft Defender XDR without a user](api-create-app-web.md)
173173
- [Create an app to access Microsoft Defender XDR APIs on behalf of a user](api-create-app-user-context.md)
174-
- [Create an app with multi-tenant partner access to Microsoft Defender XDR APIs](api-partner-access.md)
174+
- [Create an app with multitenant partner access to Microsoft Defender XDR APIs](api-partner-access.md)
175175
- [Manage secrets in your server apps with Azure Key Vault](/training/modules/manage-secrets-with-azure-key-vault/)
176176
- [OAuth 2.0 Authorization for user sign in and API access](/azure/active-directory/develop/active-directory-v2-protocols-oauth-code)
177177
[!INCLUDE [Microsoft Defender XDR rebranding](../includes/defender-m3d-techcommunity.md)]

0 commit comments

Comments
 (0)