You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-office-365/detect-and-remediate-illicit-consent-grants.md
+15-18Lines changed: 15 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,14 @@ ms.topic: conceptual
10
10
ms.collection:
11
11
- tier2
12
12
- m365-security
13
-
ms.date: 6/14/2023
13
+
ms.date: 02/13/2025
14
14
ms.localizationpriority: medium
15
15
search.appverid:
16
16
- MET150
17
17
description: Learn how to recognize and remediate the illicit consent grants attack in Microsoft 365.
18
18
ms.custom:
19
19
- seo-marvel-apr2020
20
-
- has-azure-ad-ps-ref
21
-
- azure-ad-ref-level-one-done
20
+
- no-azure-ad-ps-ref
22
21
ms.service: defender-office-365
23
22
appliesto:
24
23
- ✅ <a href="https://learn.microsoft.com/defender-office-365/mdo-about#defender-for-office-365-plan-1-vs-plan-2-cheat-sheet" target="_blank">Microsoft Defender for Office 365 Plan 1 and Plan 2</a>
@@ -33,7 +32,7 @@ appliesto:
33
32
34
33
## What is the illicit consent grant attack in Microsoft 365?
35
34
36
-
In an illicit consent grant attack, the attacker creates an Azure-registered application that requests access to data such as contact information, email, or documents. The attacker then tricks an end user into granting that application consent to access their data either through a phishing attack, or by injecting illicit code into a trusted website. After the illicit application is granted consent, it has account-level access to data without the need for an organizational account. Normal remediation steps (for example, resetting passwords or requiring multi-factor authentication (MFA)) aren't effective against this type of attack, because these apps are external to the organization.
35
+
In an illicit consent grant attack, the attacker creates a registered application in Microsoft Entra ID that requests access to data such as contact information, email, or documents. The attacker then tricks an end user into granting that application consent to access their data either through a phishing attack, or by injecting illicit code into a trusted website. After the illicit application is granted consent, it has account-level access to data without the need for an organizational account. Normal remediation steps (for example, resetting passwords or requiring multifactor authentication (MFA)) aren't effective against this type of attack, because these apps are external to the organization.
37
36
38
37
These attacks use an interaction model that presumes the entity calling the information is automation and not a human.
39
38
@@ -42,11 +41,11 @@ These attacks use an interaction model that presumes the entity calling the info
42
41
43
42
## What does an illicit consent grant attack look like in Microsoft 365?
44
43
45
-
You need to search the **audit log** to find signs, also called Indicators of Compromise (IOC) of this attack. For organizations with many Azure-registered applications and a large user base, the best practice is to review your organizations consent grants on a weekly basis.
44
+
You need to search the **audit log** to find signs, also called Indicators of Compromise (IOC) of this attack. For organizations with many applications registered in Microsoft Entra ID and a large user base, you should review your organizations consent grants every week.
46
45
47
46
### Steps for finding signs of this attack
48
47
49
-
1.Open the Microsoft Defender portal at <https://security.microsoft.com> and then select **Audit**. Or, to go directly to the **Audit** page, use <https://security.microsoft.com/auditlogsearch>.
48
+
1.In the Microsoft Defender portal at <https://security.microsoft.com>, select **Audit**. Or, to go directly to the **Audit** page, use <https://security.microsoft.com/auditlogsearch>.
50
49
51
50
2. On the **Audit** page, verify that the **Search** tab is selected, and then configure the following settings:
52
51
-**Date and time range**
@@ -62,25 +61,25 @@ You need to search the **audit log** to find signs, also called Indicators of Co
62
61
>
63
62
> It can take from 30 minutes up to 24 hours for the corresponding audit log entry to be displayed in the search results after an event occurs.
64
63
>
65
-
> The length of time that an audit record is retained and searchable in the audit log depends on your Microsoft 365 subscription, and specifically the type of the license that is assigned to a specific user. For more information, see [Audit log](/purview/audit-log-search).
64
+
> The length of time that an audit record is retained and searchable in the audit log depends on your Microsoft 365 subscription. Specifically, the licenses assigned to specific users. For more information, see [Audit log](/purview/audit-log-search).
66
65
>
67
-
> The value is true indicates that someone with Global Administrator access might have granted broad access to data. If this value is unexpected, take steps to [confirm an attack](#how-to-confirm-an-attack).
66
+
> The value True indicates that someone with Global Administrator access might have granted broad access to data. If this value is unexpected, take steps to [confirm an attack](#how-to-confirm-an-attack).
68
67
69
68
## How to confirm an attack
70
69
71
70
If you have one or more instances of the IOCs previously listed, you need to do further investigation to positively confirm that the attack occurred. You can use any of these three methods to confirm the attack:
72
71
73
-
- Inventory applications and their permissions using the Microsoft Entra admin center. This method is thorough, but you can only check one user at a time that can be very time consuming if you have many users to check.
74
-
- Inventory applications and their permissions using PowerShell. This is the fastest and most thorough method, with the least amount of overhead.
75
-
- Have your users individually check their apps and permissions and report the results back to the administrators for remediation.
72
+
- Inventory applications and their permissions using the Microsoft Entra admin center. This method is thorough, but you can only check one user at a time. This method can be very time consuming if you have many users to check.
73
+
- Inventory applications and their permissions using PowerShell. This method is the fastest, most method, and has the least amount of overhead.
74
+
- Have users individually check their apps and permissions and report the results back to the admins for remediation.
76
75
77
76
## Inventory apps with access in your organization
78
77
79
78
You have the following options to inventory apps for your users:
80
79
81
80
- The Microsoft Entra admin center.
82
81
- PowerShell.
83
-
- Have your users individually enumerate their own application access.
82
+
- Have users individually enumerate their own application access.
84
83
85
84
### Steps for using the Microsoft Entra admin center
86
85
@@ -98,21 +97,19 @@ Have your users go to <https://myapps.microsoft.com> and review their own applic
98
97
99
98
### Steps in PowerShell
100
99
101
-
The simplest way to verify the Illicit Consent Grant attack is to run [Get-AzureADPSPermissions.ps1](https://gist.github.com/psignoret/41793f8c6211d2df5051d77ca3728c09), which dumps all the OAuth consent grants and OAuth apps for all users in your tenancy into one .csv file.
100
+
The simplest way to verify the Illicit Consent Grant attack is to run [the Get-AzureADPSPermissions.ps1 script](https://gist.github.com/psignoret/41793f8c6211d2df5051d77ca3728c09), which dumps all the OAuth consent grants and OAuth apps for all users in your tenancy into one .csv file.
102
101
103
102
#### Prerequisites
104
103
105
-
- The Azure AD PowerShell library installed.
104
+
- The [Microsoft Graph PowerShell SDK is installed](/powershell/microsoftgraph/installation).
106
105
- Global Administrator permissions in the organization where the script is run.
107
106
- Local Administrator permissions on the computer where you run the scripts.
108
107
109
108
> [!IMPORTANT]
110
-
> We ***highly recommend*** that you require multi-factor authentication on your admin account. This script supports MFA authentication.
109
+
> We ***highly recommend*** that you require multifactor authentication on your admin account. This script supports MFA authentication.
111
110
>
112
111
> Microsoft recommends that you use roles with the fewest permissions. Using lower permissioned accounts helps improve security for your organization. Global Administrator is a highly privileged role that should be limited to emergency scenarios when you can't use an existing role.
113
112
114
-
[!INCLUDE [Azure AD PowerShell deprecation note](../includes/aad-powershell-deprecation-note.md)]
115
-
116
113
1. Sign in to the computer where you want to run the scripts with local administrator rights.
117
114
118
115
2. Download or copy the [Get-AzureADPSPermissions.ps1](https://gist.github.com/psignoret/41793f8c6211d2df5051d77ca3728c09) script from GitHub to a folder that's easy to find and remember. This folder is also where you need to write the "permissions.csv" output file is written.
@@ -142,7 +139,7 @@ The script produces one file named Permissions.csv. Follow these steps to look f
142
139
After you finished inventorying application access, review the **audit log** to determine the full scope of the breach. Search on the affected users, the time frames that the illicit application had access to your organization, and the permissions the app had. You can search the **audit log** in the [Microsoft Defender portal](audit-log-search-defender-portal.md).
143
140
144
141
> [!IMPORTANT]
145
-
> [Mailbox auditing](/purview/audit-mailboxes) and [Activity auditing for admins and users](/purview/audit-log-enable-disable)must have been enabled prior to the attack for you to get this information.
142
+
> Getting this information requires [Mailbox auditing](/purview/audit-mailboxes) and [Activity auditing for admins and users](/purview/audit-log-enable-disable)to be turned on before the attack.
146
143
147
144
## How to stop and remediate an illicit consent grant attack
0 commit comments