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

# Microsoft 365 Integration

This guide walks you through enabling Microsoft 365 API access in ThreatDefence SIEM.

> **Requirements:**
>
> * Access to Microsoft 365 services (Microsoft 365 Compliance Center, Azure Active Directory)
> * Any O365 licensing tier is supported.

***

## Step 1: Enable Auditing in Microsoft 365

To enable auditing, follow standard procedures to [turn auditing on or off](https://learn.microsoft.com/en-us/purview/audit-log-enable-disable).

***

## Step 2: Register an Application in Entra ID

1. Download ThreatDefence's EntraID Integration Certificate: [Download Certificate](https://assets.threatdefence.io/integrations/td-entraid-integration-20240627.pem)
2. Sign in to the [Entra ID portal](https://portal.azure.com).
3. Navigate to **Microsoft Entra ID**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-871ec8d2623a2ce7fb89f89508a16a74d1bc00a9%2Fentrawelcome.png?alt=media)
4. Select **App registrations** and click **New registration**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-7dc8f268766154c19629cf79ebb83446a0710350%2Fregistration.png?alt=media)
5. Fill in the required information and click **Register**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-bf0fc010ead14b6f158b7d36d14a0eeeda0eb5c9%2Frequiredinfo.png?alt=media)
6. Make note of the Application (client) ID and Directory (tenant) ID for later use.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-5d4f54aff7510e7e7395fadbc5cc96aaa402d834%2FclientID.png?alt=media)
7. Navigate to **Certificates & secrets**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-020e79c20f322a95bed5ab3a152375ffe9bad697%2Fcertssecs.png?alt=media)
8. Click **Upload Certificate**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-99b61867c2c37cb37a49abdfae927e0631e0c156%2Fuploadcert.png?alt=media)
9. Upload the certificate downloaded in step 1 and press **Add**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-abeff6e8509d7ffa12e87cd8aca9f2675e88d228%2Fuploadcertdialog.png?alt=media)

***

## Step 3: Grant API Permissions

1. After creating the application ID and secret, grant permissions to access the Office 365 Management APIs.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-06871825da4c1795b9b04c0972733e8b13bc1c1a%2Fgrantapi.png?alt=media)
2. Navigate to **API permissions** and select **Office 365 Management APIs**.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-2e9fbd1a5103312af744b30ba27853506a2ead4c%2Fapiperms.png?alt=media)
3. Select **Application permissions** and enable the following:

```
ActivityFeed.Read
ActivityFeed.ReadDlp
```

4. Click **Grant admin consent** and confirm.

   ![](https://4191868192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlFHF8fl339QOw3Og8L7%2Fuploads%2Fgit-blob-2d6123b69bb14b2116265e1cf0760699d56d67b0%2Fgrantconsent.png?alt=media)

***

## Step 4: Configure ThreatDefence SIEM

1. Log in to the **ThreatDefence SIEM Portal**.
2. Go to **Deployments > Integrations**.
3. Click **Add** and select **Microsoft 365**.

***

## Step 5: Add Microsoft Graph Integration

For advanced security auditing, Defender event ingestion, and user isolation features, complete the [Microsoft Graph API Integration](/microsoft-365/ms-graph.md).

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.threatdefence.com/microsoft-365/microsoft-365.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
