# Microsoft O365

In this guide, you will set up a trusted relationship between Radiant and your Microsoft account to allow Radiant to retrieve user and group data related to your organization, including authentication activity and audit activity events.

At the end of this configuration, you will provide Radiant Security with these values:

* **Application (client) ID**
* **Directory (tenant) ID**
* **Client Secret Value**&#x20;
* **Azure Subscription ID (only needed for the Azure Activities feed)**

<details>

<summary><i class="fa-bolt-lightning">:bolt-lightning:</i> <mark style="color:red;">Available actions</mark></summary>

The following actions are available after you set up the Microsoft O365 data connector. Keep in mind, additional permissions are required.

* Find and hard delete emails
* Block files
* Block domains
* Isolate device
* Disable users and terminate active sessions
* Terminate active sessions
* Disable all forward rules
* Delete external email forward rules
* Enable User
* Block IP address (Identity)
* Block IP address (Endpoint)
* Release devices from isolation

</details>

### Prerequisites

* [ ] **Administrator** of the O365 account

### Register the application with Microsoft Entra ID

In this step, you'll register a new application with Microsoft Entra ID. The application will pull user and group data on a semi-regular basis.

{% hint style="info" %}
**Note**: Make sure to save the **Application (client) ID** and **Directory (tenant) ID** values. You will need to provide them to Radiant Security at the end of the configuration.
{% endhint %}

1. Log in to the [Microsoft Azure Portal](https://portal.azure.com/#home).
2. From the left side menu, navigate to **Microsoft Entra ID**.
3. From the left menu, navigate to **App Registrations**.
4. Click **+** **New Registration**.\
   &#x20;

   <figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FogEMv9rPR6Q1q9XIIP9c%2FMicrosoft%20O365_01.png?alt=media&#x26;token=312e87d3-4569-4e22-9f40-0a5a0dd9531c" alt=""><figcaption></figcaption></figure>
5. Update the application **Name** to `radiantsecurity-connector` and leave all default settings unchanged.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FanLQ7LdB4iO6rIZFH243%2FMicrosoft%20O365_02.png?alt=media&#x26;token=3113ced1-ee53-4bef-ae97-43b155d2d251" alt="" width="375"><figcaption></figcaption></figure></div>
6. Click **Register** to save the changes.
7. On the newly registered application page, copy the following values:

   * **Application (client) ID**
   * **Directory (tenant) ID**

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FSh73eCenCkQ2aQwunJEE%2FMicrosoft%20O365_03.png?alt=media&#x26;token=dbaf7dff-8641-4e93-8d52-f957d6288c35" alt="" width="563"><figcaption></figcaption></figure></div>
8. On the same page, click the link for **Add a certificate or secret**.&#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2F6tUi4cRYlGdVqDdn3hB8%2FMicrosoft%20O365_04.png?alt=media&#x26;token=893100fc-4653-42ef-a09a-109d52917d03" alt="" width="552"><figcaption></figcaption></figure></div>
9. In the **Add a client** window, click **+ New Client Secret**.
10. Set the client secret as:
    * **Description**: `Radiant Security Connector`
    * **Expires**: `12 months`

<div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2F8v5mIQGBicCjRTmszymO%2FMicrosoft%20O365_05.png?alt=media&#x26;token=e6c5a82e-efb5-4aa1-afb3-96d1ab6a1939" alt="" width="563"><figcaption></figcaption></figure></div>

11. Click **Add**.
12. The client secrets page will automatically open.
13. Copy the **Value** (not the **Secret ID** field).\
    &#x20;

    <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FXPY8ww8cDTmYlHcq1xHr%2FMicrosoft%20O365_06.png?alt=media&#x26;token=5b629d99-2dcb-4e70-a638-7e7d1f8ecbc2" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
**Important note**: Ensure you copy the **Client secret** value now as you won't be able to look it up again later. You will need to provide it to Radiant Security at the end of the configuration.
{% endhint %}

### Grant the newly registered application the appropriate permissions

1. On the left sidebar menu, click **API Permissions**.
2. Click + **Add a permission**.
3. From the pop-out menu, select **Microsoft Graph APIs**.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FhmzEQJRxkyc5kJkl8dz0%2FMicrosoft%20O365_07.png?alt=media&#x26;token=57e116ad-c8e2-4107-a38c-7ce2239d2973" alt="" width="563"><figcaption></figcaption></figure></div>
4. Then click **Application permissions** to open the permission list.&#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2F4Ppp3n5dQTIpvBzv2UZy%2FMicrosoft%20O365_08.png?alt=media&#x26;token=15561fdc-23ee-4910-8acc-3482c00f3081" alt=""><figcaption></figcaption></figure></div>
5. Select the following permissions:

{% hint style="danger" %}
**Important Note:** Before proceeding with the permissions below, if you plan on onboarding the Email use case, please follow [this Microsoft documentation](https://learn.microsoft.com/en-us/exchange/monitoring/trace-an-email-message/graph-api-message-trace) to provision a service principal before granting the **ExchangeMessageTrace.Read.All** permission.
{% endhint %}

| **API / Service**            | **Permission name**                               | **Required for Data Ingestion?** | **Use Case**                           | **Details**                                                                                                                                                    |
| ---------------------------- | ------------------------------------------------- | -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Microsoft Graph              | Application.Read.All                              | Yes                              | Email, Identity, Endpoint              | **Task**: Block IP Address                                                                                                                                     |
| Microsoft Graph              | AuditLog.Read.All                                 | Yes                              | Email, Identity                        | Collect user authentication events for investigating abnormal authentication to applications                                                                   |
| Microsoft Graph              | Directory.Read.All                                | Yes                              | All                                    | Permission to read users’ profiles                                                                                                                             |
| Microsoft Graph              | IdentityRiskEvent.Read.All                        | Yes                              | Identity                               | Collect identity-based risks/alerts Entra ID Identity Protection                                                                                               |
| Microsoft Graph              | IdentityRiskyUser.Read.All                        | Yes                              | Identity                               | Collect identity-based risks/alerts Entra ID Identity Protection                                                                                               |
| Microsoft Graph              | Mail.ReadWrite                                    | No                               | Email                                  | **Task**: Find & Delete Emails                                                                                                                                 |
| Microsoft Graph              | MailboxSettings.Read                              | No                               | Identity                               | Collect the out-of-office status of the user from Microsoft to help influence identity alert triage outcomes                                                   |
| Microsoft Graph              | MailboxSettings.ReadWrite                         | No                               | Email                                  | **Task**: Disable all email forward rules, Delete external email forward rules                                                                                 |
| Microsoft Graph              | Policy.Read.All                                   | No                               | Identity, Endpoint                     | **Task**: Block IP Address                                                                                                                                     |
| Microsoft Graph              | Policy.ReadWrite.ConditionalAccess                | No                               | Identity, Endpoint                     | **Task**: Block IP Address                                                                                                                                     |
| Microsoft Graph              | User.Read.All                                     | Yes                              | All                                    | Permissions to read users’ profiles                                                                                                                            |
| Microsoft Graph              | SecurityAlert.Read.All                            | Yes                              | Microsoft Defender for Cloud feed      | Permissions to read security alerts                                                                                                                            |
| Microsoft Graph              | User.ManageIdentities.All                         | No                               | Email, Identity, Endpoint              | **Tasks**: Reset User Password, Disable User                                                                                                                   |
| Microsoft Graph              | User.EnableDisableAccount.All                     | No                               | Email, Identity, Endpoint              | **Tasks**: Reset User Password, Disable User, Enable User                                                                                                      |
| Microsoft Graph              | Directory.AccessAsUser.All (delegated permission) | No                               | Email, Identity, Endpoint              | **Tasks**: Reset User Password, Disable User                                                                                                                   |
| Microsoft Graph              | ExchangeMessageTrace.Read.All                     | Yes                              | Email                                  | Collect [exchangeMessageTrace](https://learn.microsoft.com/en-us/graph/api/resources/exchangemessagetrace?view=graph-rest-1.0) objects to triage email reports |
| Microsoft Cloud App Security | Investigation.Read                                | Yes                              | Microsoft Defender for Cloud Apps feed | Permissions to read the Cloud Apps alerts and the related events                                                                                               |

1. Click **Add permissions** to save the changes.
2. Click **+ Add a permission** and select the tab **APIs my organization uses,** then select the **Office 365 Exchange Online** option.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FE0Moigz3m3Y4Tu2g4LLx%2FMicrosoft%20O365_09.png?alt=media&#x26;token=91ed42c2-072a-4ed8-b170-ffae6d8b868b" alt=""><figcaption></figcaption></figure></div>
3. Select **Application permissions** and add the permissions outlined in the table below:

   | **API / Service**                                      | **Permission name**          | **Required for Data Ingestion?** | **Use Case**       | **Details**                                                                                                                                                 |
   | ------------------------------------------------------ | ---------------------------- | -------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Office 365 Exchange Online (APIs my organization uses) | Exchange.ManageAsApp         | Yes                              | Email              | <p><strong>Tasks</strong>: Block Sender, Block URL - required for actions that can only be done over PowerShell<br><strong>Data</strong>: Email traces.</p> |
   | Office 365 Exchange Online                             | User.RevokeSessions.All      | No                               | Email and Identity | Task: Terminate Active Sessions                                                                                                                             |
   | (APIs my organization uses)                            | ReportingWebService.Read.All | Yes                              | Email              | Permission to enrich message trace events                                                                                                                   |
4. Click **Add permissions** to save the changes.
5. Click on **+ Add a permission** again, on the Microsoft APIs tab, select **Office 365 Microsoft Management API**.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2F9BPa8bUZAHFwk2GdyUbX%2FMicrosoft%20O365_10.png?alt=media&#x26;token=915fc801-3150-49dc-ab87-202267f869c7" alt="" width="563"><figcaption></figcaption></figure></div>
6. Select **Application permissions** and add the permissions outlined in the table below:

   | **API / Service**          | **Permission name**  | **Required for Data Ingestion?** | **Use Case**    | **Details**                                                                                                     |
   | -------------------------- | -------------------- | -------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------- |
   | Office 365 Management APIs | ActivityFeed.Read    | Yes                              | Email, Identity | Collect user authentication events for investigating abnormal authentication to applications                    |
   | Office 365 Management APIs | ActivityFeed.ReadDlp | Yes                              | Email           | Permission to identify impacted users with inbox rules that were newly created or modified to exfiltrate emails |
7. Click **Add permissions** to save the changes.

### Add permissions in Azure <a href="#add-permissions-in-azure" id="add-permissions-in-azure"></a>

Follow [these](https://help.radiantsecurity.ai/radiant-connectors/data-connectors/azure-activities) instructions only if you have Azure enabled in your environment.

### Add assigned role

In this step, you will assign the newly registered application with the necessary roles.

1. On the left sidebar menu, click **Roles and Administrators**.
2. On the roles and Administrators page, click **here**.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2Fan8ljwMTxXzyW2RYN3ut%2FMicrosoft%20O365_16.webp?alt=media&#x26;token=b3e6cca1-21b8-4b7f-a87f-5d57449ce0d9" alt="" width="563"><figcaption></figcaption></figure></div>
3. From the search bar, search for `global reader` and select the row (do not select the checkbox).&#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FDD1Y26VtO3xbhdu4TS1h%2FMicrosoft%20O365_17.png?alt=media&#x26;token=29b2120a-3a1d-4129-920c-265e44edf01d" alt=""><figcaption></figcaption></figure></div>
4. On the active assignments page, click **+ Add assignment**.
5. On the **Add assignments** page, under **Select member(s)**, click on **No member selected** and add `radiantsecurity-connector` on the side panel.\
   &#x20;

   <div align="left"><figure><img src="https://2439665791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsFulb2ZOtSPcRSc2rXE%2Fuploads%2FSZvceCj2gHp9cMmS31KB%2FMicrosoft%20O365_18.png?alt=media&#x26;token=fb492d57-e830-4e52-89cb-2785b1e1a373" alt="" width="270"><figcaption></figcaption></figure></div>
6. Click **Next** and under **Enter justification** type the justification in the text box: `Grant Radiant Security access to message trace events`
7. Click **Assign** to save the changes.
8. Repeat steps 1-7 for the **Exchange Administrator role** and for the **Privileged Authentication Administrator role** or **Authentication Administrator role.**

   1. The **Privileged Authentication Administrator role** allows the application to run actions such as reset user password on all user accounts in the environment, no matter their groups or roles.
   2. The **Authentication Administrator role** allows the application to run the same actions as the **Privileged** version, but it limits the scope of access so that the application can't run actions against user accounts with high privilege levels such as **Global Admins**, **Group Admins** or even users who own or are members of role-assignable group.

   For more information about the two roles, refer to <https://learn.microsoft.com/en-us/graph/api/resources/users?view=graph-rest-1.0#who-can-reset-passwords>

### Specific configurations

Some data feeds require additional configuration before adding the connector to Radiant Security. Please refer to the following articles if applicable:

* Add Microsoft Defender Permissions
* Microsoft Safe Links
* Onboarding Hosts to Defender

### Add the data connector in Radiant Security

1. Log in to [Radiant Security](https://app.radiantsecurity.ai/).
2. From the navigation menu, click **Settings** > **Data Connectors** and click **+ Add Connector**.
3. Search for and select the **Microsoft O365** option and then click **Data Feeds**.
4. Add the following values you saved from the previous steps:
   * **Application (client) ID**
   * **Directory (tenant) ID**
   * **Client Secret Value**

{% hint style="warning" %}
**Important Note:** For the **Azure Activites data connector**, add a comma-separated list of the subscription IDs that must be monitored.
{% endhint %}

5. Click **Add Connector** to save the connector configuration.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.radiantsecurity.ai/radiant-connectors/data-connectors/microsoft-o365.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
