> 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-aip.md).

# Microsoft AIP

Microsoft Azure Information Protection (AIP) is part of Microsoft Purview Information Protection. OctoXLabs reads users from Microsoft Graph and adds their sensitivity labels and threat assessment requests to the user inventory.

## Use cases

* List the users that the AIP adapter returns.

```
Adapters = microsoft-aip
```

* Find AIP users who have not signed in for 90 days.

```
Adapters = microsoft-aip AND NOT LastLogOnTime 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    |

### Required permissions

| Scope or role                                 | Permission | Needed for                            |
| --------------------------------------------- | ---------- | ------------------------------------- |
| Audit.Read.All (Microsoft Graph, application) | Read       | Required by the frontend instructions |

The connector also calls user, sensitivity label and threat assessment endpoints. Which Graph permissions those need is not stated in the sources.

## Create credentials in Microsoft AIP

{% stepper %}
{% step %}

### Register an application

In Microsoft Entra ID, register an application for OctoXLabs.
{% endstep %}

{% step %}

### Grant the permission

Add the Audit.Read.All application permission and grant admin consent.
{% endstep %}

{% step %}

### Create a client secret

Under Certificates & Secrets, select New client secret and copy the value.
{% endstep %}

{% step %}

### Copy the IDs

On the application overview page, copy the Application (client) ID and the Tenant ID.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                       | Required | Type    | Default | Description                              |
| ------------------------------- | -------- | ------- | ------- | ---------------------------------------- |
| Tenant ID (`tenant_id`)         | Yes      | String  |         | Tenant ID of the registered application. |
| Client ID (`client_id`)         | Yes      | String  |         | Application (client) ID.                 |
| Client Secret (`client_secret`) | Yes      | String  |         | Client secret value.                     |
| Is Secure (`is_secure`)         | No       | Boolean | True    | Use HTTPS for the token request.         |
| Timeout (`timeout`)             | No       | Integer | 30      | Seconds to wait for API responses.       |

## Troubleshooting

| Error message | Cause | Fix                                    |
| ------------- | ----- | -------------------------------------- |
| Not verified  |       | No adapter-specific error text in code |

## Change history
