# Ensure users installing Outlook add-ins is not allowed

Ensure users installing Outlook add-ins is not allowed. A Maester check for Exchange Online, Outlook.

Source: https://maester.dev/docs/tests/MT.1041

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/weycc81" title="Stefan Wey · Original author"><img src="https://github.com/weyCC81.png" alt="Stefan Wey" width="28" height="28" loading="lazy" decoding="async" /></a><a class="test-byline-avatar" href="/contributors/bastienperez" title="Bastien Perez · Co-contributor"><img src="https://github.com/bastienperez.png" alt="Bastien Perez" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/weycc81">Stefan Wey</a> with <a href="/contributors/bastienperez">Bastien Perez</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/maester">Maester</a> · Exchange Online · Outlook · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId MT.1041
```

## Overview

Users SHOULD NOT be allowed to install Outlook add-ins

Rationale: When users can install their own Outlook add-ins, it creates security risks. Malicious add-ins could access email content, exploit vulnerabilities, or facilitate data exfiltration through legitimate-looking add-ins.

#### Remediation action

1. Connect to Exchange Online:

```powershell
Connect-ExchangeOnline
```

1. Get the current role assignment policy:

```powershell
Get-RoleAssignmentPolicy | Where-Object { $_.IsDefault }
```

1. Check which app-related roles are assigned:

```powershell
Get-ManagementRoleAssignment -RoleAssignee "Default Role Assignment Policy" | Where-Object { $_.Role -like "My*Apps" }
```

1. Remove the app installation permissions from the default policy:

```powershell
Get-ManagementRoleAssignment -RoleAssignee "Default Role Assignment Policy" | Where-Object { $_.Role -like "My*Apps" } | Remove-ManagementRoleAssignment -Confirm:$false
```

1. Verify the changes:

```powershell
Get-ManagementRoleAssignment -RoleAssignee "Default Role Assignment Policy" | Where-Object { $_.Role -like "My*Apps" }
```

The result should return no assignments.

#### Related links

* [Role-based access control in Exchange Online](https://learn.microsoft.com/exchange/permissions-exo/permissions-exo)
* [CIS Microsoft 365 Benchmark - 1.3.4 (L1) Ensure 'User owned apps and services' is restricted](https://www.cisecurity.org/benchmark/microsoft_365)
* [Microsoft Secure Score - Restrict user consent to applications](https://security.microsoft.com/securescore)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | MT.1041 |
| Severity | Medium |
| Suite | Maester |
| Product | Exchange Online |
| Feature | Outlook |
| Area | Applications and workload identities |
| Resource type | Policy |
| User impact | Medium |
| Implementation cost | Low |
| MITRE ATT&CK | T1137.006 Add-ins, T1114.002 Remote Email Collection |
| Supports controls | nist-800-53-r5:CM-7, nist-800-53-r5:CM-11 |
| PowerShell test | [Test-MtExoOutlookAddin](https://github.com/maester365/maester/blob/main/tests/maester/exchange/Test.MT.1041.ps1) |
| Services | ExchangeOnline |

</details>

## Source

- Test: [`tests/maester/exchange/Test.MT.1041.ps1`](https://github.com/maester365/maester/blob/main/tests/maester/exchange/Test.MT.1041.ps1)
- Documentation: [`tests/maester/exchange/Test.MT.1041.md`](https://github.com/maester365/maester/blob/main/tests/maester/exchange/Test.MT.1041.md)
