Detect Domain or Tenant Policy Modification in Sumo Logic CSE
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
- Canonical reference
- https://attack.mitre.org/techniques/T1484/
Sumo Detection Query
_sourceCategory=*windows*security* OR _sourceCategory=*wineventlog* OR _sourceCategory=*WinEventLog*
| where num(EventCode) in (5136, 5137, 5141, 4706, 4707, 4716, 4865, 4866, 4867)
| parse regex "(?:Object\s+Class|ObjectClass):\s*(?<ObjectClass>[^\r\n]+)" nodrop
| parse regex "(?:Object\s+DN|ObjectDN):\s*(?<ObjectDN>[^\r\n]+)" nodrop
| parse regex "(?:Attribute\s+LDAP\s+Display\s+Name|AttributeLDAPDisplayName):\s*(?<LDAPAttribute>[^\r\n]+)" nodrop
| parse regex "(?:Target\s+Domain\s+Name|TargetDomainName):\s*(?<TargetDomainName>[^\r\n]+)" nodrop
| parse regex "(?:Subject\s+Account\s+Name|SubjectAccountName):\s*(?<Actor>[^\r\n]+)" nodrop
| parse regex "(?:Trust\s+Type|TrustType):\s*(?<TrustType>[^\r\n]+)" nodrop
| where num(EventCode) in (4706, 4707, 4716, 4865, 4866, 4867)
OR (num(EventCode) in (5136, 5137, 5141)
AND (ObjectClass = "groupPolicyContainer" OR ObjectDN matches "*CN=Policies*"))
| eval EventType = if(num(EventCode) = 5137, "GPO Created",
if(num(EventCode) = 5136, "GPO Modified",
if(num(EventCode) = 5141, "GPO Deleted",
if(num(EventCode) = 4706, "Domain Trust Created",
if(num(EventCode) = 4707, "Domain Trust Removed",
if(num(EventCode) = 4716, "Domain Trust Modified",
if(num(EventCode) = 4865, "Forest Trust Entry Added",
if(num(EventCode) = 4866, "Forest Trust Entry Removed",
if(num(EventCode) = 4867, "Forest Trust Entry Modified", "Unknown")))))))))
| eval RiskScore = if(num(EventCode) in (4706, 4865), 90,
if(num(EventCode) in (5141, 4707, 4716, 4866, 4867), 80,
if(num(EventCode) = 5137, 70,
if(num(EventCode) = 5136, 60, 50))))
| where RiskScore >= 60
| fields _messageTime, _sourceHost, EventCode, EventType, Actor, ObjectDN, ObjectClass, LDAPAttribute, TargetDomainName, TrustType, RiskScore
| sort by RiskScore desc, _messageTime desc Detects T1484 Domain or Tenant Policy Modification in Sumo Logic by parsing Windows Security event fields from raw log data. Uses num() conversion for reliable EventCode comparisons and regex-based field extraction to surface GPO container details and trust relationship metadata. Covers GPO lifecycle events (5136/5137/5141) scoped to groupPolicyContainer objects and domain/forest trust events (4706/4707/4716/4865-4867). Risk scores range from 60 (GPO modification) to 90 (new domain trust or forest trust entry creation). Requires Windows Security events ingested via Sumo Logic Installed Collector with a Windows Event Log source.
Data Sources
Required Tables
False Positives & Tuning
- Group Policy Object creation during monthly Windows security baseline rollouts using LGPO.exe or PolicyAnalyzer — these emit 5137 events for each new GPO applied to the domain controllers OU
- Domain trust establishment when onboarding acquired subsidiaries into the corporate AD forest as part of M&A integration, which produces clustered 4706 and 4865 events from domain admin accounts over a short window
- Automated certificate authority renewal workflows that modify GPO-deployed certificate templates and autoenrollment settings, generating a burst of 5136 events against the Default Domain Policy
- DevOps pipeline automation (Ansible, DSC, Puppet) that manages GPO state declaratively and triggers modification events on every convergence run even when no net change occurs
- Active Directory health check tools (ADtidy, PingCastle, Bloodhound enterprise scanners) that enumerate and in some cases remediate GPO permission inconsistencies
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.
- 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.
- 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.
- 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.
- 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.
- 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.
References (13)
- https://attack.mitre.org/techniques/T1484/
- https://adsecurity.org/?p=2716
- https://wald0.com/?p=179
- https://blog.harmj0y.net/redteaming/abusing-gpo-permissions/
- https://msrc-blog.microsoft.com/2020/12/13/customer-guidance-on-recent-nation-state-cyber-attacks/
- https://www.microsoft.com/security/blog/2020/12/28/using-microsoft-365-defender-to-coordinate-protection-against-solorigate/
- https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ADFSDomainTrustMods.yaml
- https://docs.microsoft.com/en-us/office365/troubleshoot/active-directory/update-federated-domain-office-365
- https://sec.okta.com/articles/2023/08/cross-tenant-impersonation-prevention-and-detection
- https://us-cert.cisa.gov/ncas/alerts/aa21-008a
- https://www.sygnia.co/threat-reports-and-advisories/golden-saml-attack/
- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-audit-activities
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1484.001/T1484.001.md
Unlock Pro Content
Get the full detection package for T1484 including response playbook, investigation guide, and atomic red team tests.