Detect Domain or Tenant Policy Modification in Elastic Security
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/
Elastic Detection Query
any where
// GPO object creation, modification, and deletion via AD Directory Services audit
(
event.code in ("5136", "5137", "5141") and
event.provider == "Microsoft-Windows-Security-Auditing" and
(
winlog.event_data.ObjectClass == "groupPolicyContainer" or
winlog.event_data.ObjectDN like "*CN=Policies*"
)
) or
// Domain and forest trust configuration changes
(
event.code in ("4706", "4707", "4716", "4865", "4866", "4867") and
event.provider == "Microsoft-Windows-Security-Auditing"
) or
// PowerShell-based GPO and AD policy manipulation
(
event.category == "process" and
event.type == "start" and
(process.name like~ "powershell.exe" or process.name like~ "pwsh.exe") and
(
process.command_line like~ "*New-GPO*" or
process.command_line like~ "*Set-GPLink*" or
process.command_line like~ "*Set-GPPermission*" or
process.command_line like~ "*Set-GPRegistryValue*" or
process.command_line like~ "*Import-GPO*" or
process.command_line like~ "*Restore-GPO*" or
process.command_line like~ "*Copy-GPO*" or
process.command_line like~ "*LDAP://CN=Policies*" or
process.command_line like~ "*Set-ADObject*" or
process.command_line like~ "*gpupdate*"
)
) Detects T1484 Domain or Tenant Policy Modification across three vectors: (1) Windows Security audit events 5136/5137/5141 for GPO container changes in Active Directory DS Access auditing, (2) events 4706/4707/4716/4865-4867 for domain and forest trust creation, modification, and removal, and (3) Elastic Endpoint process events capturing PowerShell invocations of Group Policy management cmdlets. Requires AD DS auditing enabled for Directory Service Changes, and either Winlogbeat or Elastic Agent with the Windows integration deployed on domain controllers.
Data Sources
Required Tables
False Positives & Tuning
- Scheduled Group Policy administrative changes performed by domain admins during approved change windows — gpupdate.exe runs periodically on all joined systems and New-GPLink is used in routine Tier 0 AD management
- Active Directory migration tooling (ADMT, Quest Migration Manager, Semperis DSP) that programmatically modifies GPO structures and establishes cross-forest trusts during M&A onboarding or domain consolidation projects
- Azure AD Connect writeback configuration and AD FS certificate rotation that triggers federation-related domain setting changes on a scheduled basis without adversarial intent
- Privileged identity management platforms such as CyberArk Privileged Cloud or BeyondTrust that automate GPO permission delegation and may emit 5136 events during session provisioning
- Automated baseline hardening scripts (CIS benchmark automation, LGPO.exe deployments) that create or modify GPOs in bulk during OS image updates or quarterly security reviews
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.