Detect Trust Modification in Sumo Logic CSE
Adversaries may add new domain trusts, modify the properties of existing domain trusts, or otherwise change the configuration of trust relationships between domains and tenants to evade defenses and/or elevate privileges. In Microsoft Azure AD / Entra ID environments this includes converting a managed domain to federated authentication and injecting a backdoor signing certificate to forge SAML tokens (Golden SAML) without compromising the original cert. Adversaries may also add entirely new federated identity providers to Okta, AWS IAM Identity Center, or other identity tenants, enabling them to authenticate as any user in the tenant. On-premises Active Directory trust manipulation generates Windows Security Event IDs 4706/4707/4716. Threat actors observed using this technique include Scattered Spider (adding federated IdPs to SSO tenants with automatic account linking), Storm-0501 (creating new federated domains in Microsoft Entra for persistent backdoor), and AADInternals tooling which automates federated domain backdoor creation.
MITRE ATT&CK
- Sub-technique
- T1484.002 Trust Modification
- Canonical reference
- https://attack.mitre.org/techniques/T1484/002/
Sumo Detection Query
(_sourceCategory=*azure*audit* OR _sourceCategory=*windows*security*)
| where operationName in ("Set domain authentication","Set federation settings on domain","Set DomainFederationSettings","Add domain to company","Add trusted CA for certificate-based auth","Update federation settings on domain","Add identity provider to organization","Set company information")
OR EventID in ("4706","4707","4716")
| if (isNull(EventID), "AzureAD", "OnPremAD") as Source
| if (Source="AzureAD", operationName,
if (EventID="4706", "New Domain Trust Created",
if (EventID="4707", "Domain Trust Removed",
if (EventID="4716", "Trusted Domain Information Modified", "Unknown")))) as EventType
| if (Source="AzureAD",
if (!isNull(initiatedBy_user_userPrincipalName), initiatedBy_user_userPrincipalName,
if (!isNull(initiatedBy_app_displayName), initiatedBy_app_displayName, "Unknown")),
SubjectUserName) as Actor
| if (Source="AzureAD", initiatedBy_user_ipAddress, "N/A") as ActorIP
| if (Source="AzureAD", targetResources_0_displayName, Computer) as TargetResource
| eval RiskScore = if(EventType="New Domain Trust Created", 80,
if(EventType="Trusted Domain Information Modified", 70,
if(EventType="Domain Trust Removed", 60,
if(Source="AzureAD", 75, 50))))
| fields _messageTime, Source, EventType, Actor, ActorIP, TargetResource, RiskScore
| sort by _messageTime desc Sumo Logic query detecting T1484.002 across Azure AD audit log and Windows Security event sources using Sumo Logic collector sourcecategory conventions. Normalises events from both source types into a unified view covering federation changes, on-premises trust creation/modification/removal, and calculates a risk score consistent with the reference SPL. Requires Sumo Logic Azure integration for JSON field extraction and a Windows collector for Security event forwarding.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate cloud identity migration projects converting managed domains to federated authentication using ADFS, Okta, or another IdP under an approved project plan
- Enterprise IT performing routine trust configuration updates between Active Directory forests for business units that share resources, tracked via ITSM change tickets
- Authorized red team or purple team exercises specifically testing AADInternals-based federation backdoor techniques with written scope approval
Other platforms for T1484.002
Testing Methodology
Validate this detection against 4 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 1Enumerate Current Federation Settings via MSOnline
Expected signal: Azure AD AuditLogs: OperationName='Get domain federation settings' or similar read operation, initiatedBy showing the authenticated UPN. PowerShell ScriptBlock Log Event ID 4104 capturing the Get-MsolDomainFederationSettings command with domain parameter. Sysmon Event ID 1 showing powershell.exe process with MSOnline module loaded.
- Test 2Convert Domain to Federated Authentication via Set-MsolDomainAuthentication
Expected signal: Azure AD AuditLogs: OperationName='Set domain authentication' with Category='DirectoryManagement', Result='success', InitiatedBy.user.userPrincipalName showing the test account, TargetResources[0].displayName='testlab.onmicrosoft.com', modifiedProperties showing oldValue containing 'Managed' and newValue containing 'Federated' along with the adversary IssuerUri. PowerShell ScriptBlock Log Event ID 4104 capturing the full Set-MsolDomainAuthentication command.
- Test 3Create New On-Premises AD Domain Trust (netdom)
Expected signal: Windows Security Event ID 4706 on all domain controllers: SubjectUserName=DomainAdmin, SubjectDomainName=VICTIMCORP, TdoType=2 (External), TdoDomainName=adversarydomain.local, TdoSid showing the SID of the adversary domain, SidFilteringEnabled=Yes (if default). Also generates replication events across the domain.
- Test 4Add Federated Identity Provider to Azure AD via Microsoft Graph API
Expected signal: Azure AD AuditLogs: OperationName='Add identity provider to organization' or 'Create identity provider', Category='DirectoryManagement', Result='success', InitiatedBy showing the authenticating application or user, TargetResources containing the new federation configuration details including the adversary IssuerUri and signing certificate.
References (10)
- https://attack.mitre.org/techniques/T1484/002/
- https://o365blog.com/post/federation-vulnerability/
- https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AuditLogs/ADFSDomainTrustMods.yaml
- https://us-cert.cisa.gov/ncas/alerts/aa21-008a
- https://docs.microsoft.com/en-us/azure/active-directory/hybrid/whatis-fed
- https://sec.okta.com/articles/2023/08/cross-tenant-impersonation-prevention-and-detection
- https://www.sygnia.co/threat-reports-and-advisories/golden-saml-attack/
- https://reinforce.awsevents.com/content/dam/reinforce/2024/slides/TDR432_New-tactics-and-techniques-for-proactive-threat-detection.pdf
- https://docs.microsoft.com/en-us/office365/troubleshoot/active-directory/update-federated-domain-office-365
- https://learn.microsoft.com/en-us/graph/api/resources/federationconfigurations-overview
Unlock Pro Content
Get the full detection package for T1484.002 including response playbook, investigation guide, and atomic red team tests.