> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/microsoft-azure-entra.md).

# Microsoft Azure Entra

Microsoft Entra ID is the cloud identity service of Microsoft. OctoXLabs reads the registered devices and the users of your tenant through Microsoft Graph, with sign-in activity and optional enrichment.

## Use cases

* **Find Entra devices that your EDR does not cover.**

```
Adapters = azure-entra AND NOT Adapters = falcon-crowdstrike
```

* **Find Entra users with no directory account.** How accounts are matched depends on your user merge settings.

```
Adapters = azure-entra AND NOT Adapters = active-directory
```

* **Review devices that have not signed in recently.**

```
Adapters = azure-entra AND NOT LastSeen last now-90d/d
```

## Before you begin

### Network

| Source              | Destination               | Port | Protocol |
| ------------------- | ------------------------- | ---- | -------- |
| OctoXLabs connector | login.microsoftonline.com | 443  | HTTPS    |
| OctoXLabs connector | graph.microsoft.com       | 443  | HTTPS    |

If a proxy is set, requests go through it.

### Required permissions

| Scope or role                 | Permission                    | Needed for                      |
| ----------------------------- | ----------------------------- | ------------------------------- |
| Microsoft Graph (Application) | User.Read.All                 | Users                           |
| Microsoft Graph (Application) | Device.Read.All               | Devices                         |
| Microsoft Graph (Application) | Directory.Read.All            | Directory data                  |
| Microsoft Graph (Application) | AuditLog.Read.All             | Sign-in activity and audit logs |
| Microsoft Graph (Application) | RoleManagement.Read.Directory | Users Enrichment                |
| Microsoft Graph (Application) | DeviceManagementApps.Read.All | Users Enrichment                |
| Microsoft Graph (Application) | User.ReadBasic.All            | Users Enrichment                |

The baseline lists User.Read.All, Device.Read.All and Directory.Read.All as the base permissions. For Users Enrichment it lists AuditLog.Read.All, RoleManagement.Read.Directory, DeviceManagementApps.Read.All, User.ReadBasic.All and Directory.Read.All. The code also reads sign-in activity for users on every run (it calls `signInActivity`), which Microsoft documents as requiring AuditLog.Read.All.

## Create credentials in Microsoft Entra

{% stepper %}
{% step %}

### Open the app registration

In the Azure portal, open **App registrations** and select the application for Graph access, or create one.
{% endstep %}

{% step %}

### Add permissions

Under **API permissions**, click **Add a permission**, choose **Microsoft Graph > Application permissions** and add the permissions listed above.
{% endstep %}

{% step %}

### Grant admin consent

Grant admin consent for the permissions.
{% endstep %}

{% step %}

### Create a client secret

Create a client secret and copy its value.
{% endstep %}

{% step %}

### Note the IDs

Copy the Application (client) ID and the Directory (tenant) ID from the application overview page.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter        | Required | Type    | Default | Description                                                              |
| ---------------- | -------- | ------- | ------- | ------------------------------------------------------------------------ |
| Client ID        | Yes      | String  | None    | Application (client) ID.                                                 |
| Client Secret    | Yes      | String  | None    | Client secret value.                                                     |
| Tenant ID        | Yes      | String  | None    | Directory (tenant) ID.                                                   |
| Proxy URL        | No       | String  | None    | Proxy address, used as `http://<value>` for HTTP and HTTPS.              |
| Timeout          | No       | Integer | 30      | Seconds to wait for an API response.                                     |
| Users Enrichment | No       | Boolean | False   | Adds audit logs, licenses and group memberships (memberOf) to each user. |

## Troubleshooting

| Error message                                                  | Cause                                                                                  | Fix                                                                    |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Status Code: `, followed by URL, Method and the response body` | Microsoft answered with an unexpected status. This is the shared REST connector error. | Check the tenant ID, client ID, secret, permissions and admin consent. |

## Change history
