> ## Documentation Index
> Fetch the complete documentation index at: https://docs.airmdr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Sentinel (Azure Sentinel)

> Microsoft Sentinel is a cloud native security information and event management (SIEM) and security orchestration, automation, and response (SOAR) solution that runs in the Azure cloud.

### Pre-requisites

<Tip>
  User organization must have an active **Azure subscription**.
</Tip>

### Set Up App Registrations in the Azure Portal

App registrations in **Microsoft Entra ID (Azure AD)** allow applications to authenticate and access Microsoft resources securely.

<Steps>
  <Step title="Azure Portal Access">
    1. Log in to your [Azure Portal](https://portal.azure.com/).
    2. Go to **Microsoft Entra ID** (formerly Azure AD).
    3. In the left menu, click **App registrations**.
  </Step>

  <Step title="Register a New Application">
    1. Click **+ New registration**.
    2. Provide the mandatory details: (**Name**: Enter a name for your app (e.g., `airmdr-azure-sentinel-reader`) and **Supported Account Types**: Select ***Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)*** option).

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MDE3.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=4c2565d2535d78e1a84af22dea350797" alt="" width="787" height="393" data-path="images/MDE3.png" />
    3. Click **Register**.

    <Tip>
      **Redirect URI (Optional)**: If your app uses authentication, enter a URL (e.g., `https://myapp.com/auth`).
    </Tip>
  </Step>

  <Step title="Get Application (Client) ID and Tenant ID">
    1. After successful registration, you will see the **App Overview** page.

    <Check>
      Copy **Application (Client) ID** – Identifies your app.
    </Check>

    <Check>
      Copy **Directory (Tenant) ID** – Identifies your Azure AD tenant.
    </Check>
  </Step>

  <Step title="Configure API Permissions">
    1. In the application Overview page left navigation pane, select **Manage** dropdown.
    2. Click **API Permissions**.
    3. Click **+ Add a permission**
    4. In the Request API permissions window pane > Select an API > Microsoft APIs, select "**Azure Service Management**".
    5. Choose **Application permissions**.
    6. In the Select permissions → Permissions
    7. Select **user impersonation** and then click **Add permissions** at the bottom of the page.
    8. Click on Add a permission and select **Microsoft Graph.**
    9. Choose **Application permissions**.
    10. Select the required permissions (`SecurityAlert.Read.All`, `SecurityIncident.Read.All`,`SecurityEvents.Read.All`).
    11. Click **Add a permission**.
    12. Select **Grant admin consent confirmation** and click **Yes** to allow access.

            <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MDE5.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=c7c1942fc2be57baa3d6e9d31cbda08e" alt="" width="810" height="399" data-path="images/MDE5.png" />
  </Step>

  <Step title="Create a Client Secret (For Authentication)">
    1. In the application Overview page left navigation pane, select **Manage** dropdown.
    2. Click **Certificates & secrets**.
    3. Click **+ New client secret**.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MDE6.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=c3d8732152f5e9b62265b292bcf1a6e1" alt="MDE6 Pn" width="874" height="300" data-path="images/MDE6.png" />
    4. Enter a description (e.g., `MySecretKey`) and set expiration.
    5. Click **Add**.

    <Warning>
      Copy and secure the **Value** (**Client Secret**) immediately – (It won’t be shown again!)
    </Warning>
  </Step>

  <Step title="Azure Sentinel params">
    1. Search for the **Log analytics workspace** (which is linked to Azure Sentinel)
    2. In the **Overview** tab.
    3. Copy the required values:
       * **Subscription ID**
       * **Resource Group Name**
       * **WorkspaceID**
       * **Workspace Name**

    <Check>
      Email all the values **Tenant ID**, **Client ID**, **Client Secret Value, Subscription ID, Resource Group Name, Workspace ID** and the **Workspace Name** to AirMDR or self Configure Microsoft Sentinel (Azure Sentinel) in AirMDR Integrations Dashboard.
    </Check>
  </Step>

  <Step title="Add Sentinel Reader permission for above app registration">
    1. Navigate to **Log analytics workspaces**.
    2. Select **Access Control (IAM)**.
    3. In the **+Add** drop-down, select **Add role assignment**.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel3.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=a860aeb4800766d74b14ac287f9c25b9" alt="MS Sentinel3 Pn" width="1250" height="296" data-path="images/MSSentinel3.png" />
    4. In the **Role** page, search and select **Microsoft SentinelReader** roles, click **Next**.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel4.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=9a58c786828932a52b6cf3373e409933" alt="MS Sentinel4 Pn" width="2092" height="594" data-path="images/MSSentinel4.png" />
    5. In the **Members** page, click on **+ Select members**.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel5.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=b6a8a8ef49b6bd3fb0627b4287744876" alt="MS Sentinel5 Pn" width="1914" height="382" data-path="images/MSSentinel5.png" />
    6. Search and double-click on the member (e.g., `airmdr-azure-sentinel-reader`) created earlier, click **Select** at the bottom of the page.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel8.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=47bea148d62d8fdade4c8aaa6eac163c" alt="MS Sentinel8 Pn" width="1090" height="1004" data-path="images/MSSentinel8.png" />
    7. Click on the **Review + assign** bottom at the left bottom of the page.

           <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel7.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=1fa5bc0605c9c8f30a2c5c06d644a7f6" alt="MS Sentinel7 Pn" width="1548" height="1190" data-path="images/MSSentinel7.png" />
  </Step>
</Steps>

### Configure Microsoft Sentinel (Azure Sentinel) in AirMDR Integrations Dashboard

1. Navigate to [AirMDR](https://app.airmdr.com/auth/login), provide the credentials and click **Login.**

   <img src="https://mintcdn.com/airmdr/wnBXbVlE7mmN9W6R/images/Datadog11.png?fit=max&auto=format&n=wnBXbVlE7mmN9W6R&q=85&s=94afec6835b90abcec516831e584184f" alt="" width="443" height="568" data-path="images/Datadog11.png" />
2. Navigate to the AirMDR Integrations Dashboard in the left navigation pane and select **Integrations.**

   <img src="https://mintcdn.com/airmdr/wnBXbVlE7mmN9W6R/images/Datadog9.png?fit=max&auto=format&n=wnBXbVlE7mmN9W6R&q=85&s=314cbc6e406f70453a592159150f36e2" alt="" width="311" height="473" data-path="images/Datadog9.png" />
3. Use the search option, enter the keyword "**Azure Sentinel**", select the **Connections** tab, and click the **+ Create** icon.

   <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel1.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=eaf94435d3d8e9de7419254cc9e01c36" alt="MS Sentinel1 Pn" width="2968" height="826" data-path="images/MSSentinel1.png" />
4. Enter the generated **Tenant ID**, **Client ID**, **Client Secret, Subscription ID, Resource Group, Workspace ID** and the **Workspace Name** in the Authentication Details field params, and click **Create.**

   <img src="https://mintcdn.com/airmdr/wb8NOGyN5Zdemkpe/images/MSSentinel2.png?fit=max&auto=format&n=wb8NOGyN5Zdemkpe&q=85&s=d98c0fdd5740bfee8cb910d29e854551" alt="MS Sentinel2 Pn" width="1430" height="1568" data-path="images/MSSentinel2.png" />

### Evaluate Microsoft Sentinel (Azure Sentinel)

### Pre-requisites

<Check>
  **Azure App Registration** with API permissions for **Azure Sentinel**.
</Check>

<Check>
  **Client ID, Tenant ID, and Client Secret**.
</Check>

<Steps>
  <Step title="Obtain an Access Token">
    Open **cURL** and run the following command to check if your API Access is working:

    Azure Sentinel uses **OAuth 2.0 authentication**. First, request an access token from **Microsoft Entra ID (Azure AD)**:

    ```

    curl -X POST https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "grant_type=client_credentials" \
      -d "client_id=<CLIENT_ID>" \
      -d "client_secret=<CLIENT_SECRET>" \
      -d "scope=https://api.loganalytics.io/.default"
    ```

    **Replace:**

    * `<tenant_id>` – Your Azure Directory (Tenant) ID.
    * `<client_id>` – Your App Registration **Client ID**.
    * `<client_secret>` – Your App Registration **Client Secret**.

    **Expected Response (Success)**:

    ```json theme={null}

    {
      "token_type": "Bearer",
      "expires_in": 3599,
      "access_token": "eyJ0eXAiOiJKV1QiLCJhb..."
    }
    ```

    * This verifies if the user can retrieve **device information** based on the assigned scope.
  </Step>

  <Step title="Step 2">
    **Test API Access with MDE**

    Once you have the `access_token`, use it in API calls.

    * **To Get Device List**

    ```

    curl -X GET "https://api.security.microsoft.com/api/machines" \
         -H "Authorization: Bearer <access_token>" \
         -H "Content-Type: application/json"
    ```

    **Expected Response:**
    A JSON list of devices onboarded to Defender for Endpoint.

    * **To Get Alerts**

    ```

    curl -X GET "https://api.security.microsoft.com/api/alerts" \
         -H "Authorization: Bearer <access_token>" \
         -H "Content-Type: application/json"
    ```

    **Expected Response:**

    A list of security alerts detected by Microsoft Sentinel (Azure Sentinel).

    **Authentication and Authorization Errors**

    | Error Code / Message  | Cause                                                     | Fix                                                      |
    | --------------------- | --------------------------------------------------------- | -------------------------------------------------------- |
    | `invalid_client`      | Wrong client ID or secret                                 | Double-check values, regenerate secret if needed         |
    | `unauthorized_client` | App doesn't have correct permissions                      | Assign proper API permissions + grant admin consent      |
    | `invalid_grant`       | Wrong `grant_type` or malformed request                   | Use `grant_type=client_credentials`, validate all fields |
    | `AADSTS700016`        | App not found                                             | Check client ID, ensure app exists in AAD                |
    | `AADSTS7000215`       | Invalid client secret                                     | Recreate secret in App Registration                      |
    | `AADSTS700011`        | Redirect URI mismatch (usually not for Sentinel)          | Applicable in interactive auth, not client creds flow    |
    | `403 Forbidden`       | Token works, but app doesn’t have access to the workspace | Assign `Log Analytics Reader`/`Contributor` role to app  |

    **Troubleshooting Authentication Issues**

    | Error Code                  | Possible Issue               | Solution                               |
    | --------------------------- | ---------------------------- | -------------------------------------- |
    | `401 Unauthorized`          | Invalid token                | Regenerate token, check credentials    |
    | `403 Forbidden`             | Insufficient API permissions | Grant admin consent in Azure Portal    |
    | `400 BAD REQUEST`           | Incorrect request format     | Verify API endpoint and headers        |
    | `500 Internal Server Error` | Service issue                | Retry later, check the Defender status |
  </Step>
</Steps>
