T1484 Microsoft Sentinel · KQL

Detect Domain or Tenant Policy Modification in Microsoft Sentinel

Adversaries may modify the configuration settings of a domain or identity tenant to evade defenses and/or escalate privileges in centrally managed environments. This includes altering Group Policy Objects (GPOs) in Active Directory to push malicious configurations to domain-joined endpoints, modifying domain trust relationships to allow adversary-controlled domains to forge access tokens accepted by victim resources, and adding rogue federated identity providers to cloud tenants (Azure AD, Okta) to authenticate as any managed user. Nation-state actors including those behind the SolarWinds (SUNBURST) campaign abused federation trust settings to achieve persistent, stealthy access across cloud environments. Attackers may temporarily modify policy, complete their objective, and revert changes to remove indicators.

MITRE ATT&CK

Tactic
Defense Evasion Privilege Escalation
Technique
T1484 Domain or Tenant Policy Modification
Canonical reference
https://attack.mitre.org/techniques/T1484/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
// T1484 — Domain or Tenant Policy Modification
// Covers: GPO creation/modification, domain trust changes, Azure AD federation abuse
let GPOModificationEvents = SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID in (5136, 5137, 5141)
| extend ObjectClass_ = tostring(EventData.ObjectClass)
| extend ObjectDN_ = tostring(EventData.ObjectDN)
| extend AttributeName_ = tostring(EventData.AttributeLDAPDisplayName)
| extend AttributeValue_ = tostring(EventData.AttributeValue)
| extend SubjectAccount = tostring(EventData.SubjectUserName)
| extend SubjectDomain = tostring(EventData.SubjectDomainName)
| where ObjectClass_ =~ "groupPolicyContainer" or ObjectDN_ has "Policies"
| extend EventType = case(
    EventID == 5137, "GPO Created",
    EventID == 5136, "GPO Modified",
    EventID == 5141, "GPO Deleted",
    "Unknown"
  )
| project TimeGenerated, EventID, EventType, SubjectAccount, SubjectDomain,
          ObjectDN_, ObjectClass_, AttributeName_, AttributeValue_, Computer;
let DomainTrustEvents = SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID in (4706, 4707, 4716, 4865, 4866, 4867)
| extend TargetDomain_ = tostring(EventData.TargetDomainName)
| extend TrustType_ = tostring(EventData.TrustType)
| extend TrustDirection_ = tostring(EventData.TrustDirection)
| extend TrustAttributes_ = tostring(EventData.TrustAttributes)
| extend SubjectAccount = tostring(EventData.SubjectUserName)
| extend SubjectDomain = tostring(EventData.SubjectDomainName)
| extend EventType = case(
    EventID == 4706, "Trust Created",
    EventID == 4707, "Trust Removed",
    EventID == 4716, "Trust Modified",
    EventID == 4865, "Forest Trust Entry Added",
    EventID == 4866, "Forest Trust Entry Removed",
    EventID == 4867, "Forest Trust Entry Modified",
    "Unknown"
  )
| project TimeGenerated, EventID, EventType, SubjectAccount, SubjectDomain,
          TargetDomain_, TrustType_, TrustDirection_, TrustAttributes_, Computer;
let AzureADFederationEvents = AuditLogs
| where TimeGenerated > ago(24h)
| where Category in ("Policy", "Application", "DirectoryManagement")
| where OperationName in (
    "Set federation settings on domain",
    "Set domain authentication",
    "Add unverified domain to company",
    "Add verified domain to company",
    "Remove verified domain from company",
    "Update domain",
    "Set company information",
    "Add policy to service principal",
    "Delete policy from service principal",
    "Update policy"
  )
| extend ActorUPN = tostring(InitiatedBy.user.userPrincipalName)
| extend ActorApp = tostring(InitiatedBy.app.displayName)
| extend ActorIP = tostring(InitiatedBy.user.ipAddress)
| extend TargetResource = tostring(TargetResources[0].displayName)
| extend EventType = strcat("Azure AD: ", OperationName)
| project TimeGenerated, OperationName, EventType, Result, ActorUPN, ActorApp,
          ActorIP, TargetResource, CorrelationId;
// GPO Modification via PowerShell (process-based detection)
let GPOPowerShellEvents = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "powershell.exe" or FileName =~ "pwsh.exe"
| where ProcessCommandLine has_any (
    "New-GPO", "Set-GPLink", "Set-GPPermission", "Set-GPRegistryValue",
    "Import-GPO", "Copy-GPO", "Restore-GPO", "New-GPLink",
    "Set-ADObject", "New-ADObject",
    "gpupdate", "gpscript",
    "LDAP://CN=Policies"
  )
| project Timestamp, DeviceName, AccountName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          EventType = "GPO PowerShell Activity";
union isfuzzy=true
    (GPOModificationEvents | extend Source = "Windows Security Log"),
    (DomainTrustEvents | extend Source = "Windows Security Log - Trust"),
    (AzureADFederationEvents | extend Source = "Azure AD Audit Log"),
    (GPOPowerShellEvents | extend Source = "MDE Process Events")
| sort by TimeGenerated desc
high severity high confidence

Detects domain and tenant policy modifications across four signal sources: (1) Windows Security Event IDs 5136/5137/5141 for Group Policy Object creation, modification, and deletion in Active Directory; (2) Windows Security Event IDs 4706/4707/4716/4865-4867 for domain and forest trust relationship changes; (3) Azure AD AuditLogs for federation trust configuration changes including 'Set federation settings on domain' and identity provider additions; (4) Microsoft Defender for Endpoint DeviceProcessEvents for PowerShell cmdlets that modify Group Policy (New-GPO, Set-GPLink, Import-GPO). The union of all four sources provides broad coverage of on-premises AD and cloud identity policy abuse.

Data Sources

Active Directory: Active Directory Object ModificationActive Directory: Active Directory Object CreationActive Directory: Active Directory Object DeletionCloud Service: Cloud Service ModificationProcess: Process CreationCommand: Command ExecutionWindows Security Event LogAzure Active Directory Audit Logs

Required Tables

SecurityEventAuditLogsDeviceProcessEvents

False Positives & Tuning

  • Legitimate Group Policy administration by IT staff using GPMC or Group Policy PowerShell module during scheduled maintenance windows
  • Domain controllers joining or leaving forests creating legitimate trust modification events (4706/4716) during infrastructure changes
  • Azure AD Connect or ADFS deployment/reconfiguration generating federation settings events during sanctioned identity synchronization projects
  • Automated configuration management tools (Desired State Configuration, Ansible, PingCastle) that enumerate or validate GPO settings as part of compliance checking
  • Domain trust events generated during disaster recovery exercises, domain migrations, or AD restructuring projects authorized by IT leadership
Download portable Sigma rule (.yml)

Other platforms for T1484


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Create and Link a Malicious GPO via PowerShell

    Expected signal: Windows Security Event ID 5137 on the domain controller: Directory Service Object Created, ObjectClass=groupPolicyContainer, ObjectDN=CN={<GUID>},CN=Policies,CN=System,DC=<domain>. Security Event ID 5136: gPCFileSysPath attribute set to \\<domain>\SYSVOL\<domain>\Policies\{<GUID>}. Sysmon Event ID 1 on the initiating workstation: powershell.exe with 'New-GPO' and 'New-GPLink' in CommandLine. PowerShell ScriptBlock Event ID 4104 with full cmdlet execution.

  2. Test 2Modify GPO to Deploy a Scheduled Task via XML Injection

    Expected signal: Sysmon Event ID 11 (File Create) on the DC or management host: ScheduledTasks.xml created in SYSVOL path. Windows Security Event ID 5136 on DC: gPCFileSysPath or versionNumber attribute of the groupPolicyContainer modified, SubjectAccountName=<modifying account>. Event ID 4104 (ScriptBlock) capturing Set-GPRegistryValue invocation. On domain clients, Sysmon Event ID 1 for schtasks.exe or Task Scheduler Event 106/200 for task registration/execution.

  3. Test 3Create New Domain Trust (Simulated via Set-ADObject)

    Expected signal: Windows Security Event ID 4706 on domain controllers: A new trust was created to a domain. SubjectAccountName=<admin account>, TargetDomainName=df00tech-test.local, TrustType=2 (Windows), TrustDirection=1 (Inbound), TrustAttributes=8. Active Directory Event ID 5137: trustedDomain object created in CN=System. Replication events (4928/4929) as the new object replicates to other DCs.

  4. Test 4Azure AD Federation Settings Modification via PowerShell

    Expected signal: Azure AD AuditLogs entry: OperationName='Set federation settings on domain', Category='Policy', Result='success', TargetResources=[{DisplayName: <domain>}], InitiatedBy.user.userPrincipalName=<admin UPN>, InitiatedBy.user.ipAddress=<source IP>. The modified IssuerUri appears in the ModifiedProperties array of the audit event. Azure AD Sign-in Logs may show subsequent authentication attempts using the modified federation settings.

  5. Test 5Enumerate and Identify Vulnerable GPO Permissions (Pre-Attack Reconnaissance)

    Expected signal: Sysmon Event ID 1: powershell.exe with 'Get-GPPermission' and 'Get-ACL' in CommandLine. PowerShell ScriptBlock Event ID 4104 capturing the enumeration loop. Sysmon Event ID 5 (Process Terminated) when enumeration completes. LDAP query telemetry visible in network captures — the GroupPolicy module issues LDAP searches for groupPolicyContainer objects against the domain controller.

Unlock Pro Content

Get the full detection package for T1484 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections