Detect Additional Cloud Roles in Microsoft Sentinel
An adversary may add additional roles or permissions to an adversary-controlled cloud account to maintain persistent access to a tenant. For example, adversaries may update IAM policies in cloud-based environments or add a new global administrator in Office 365 environments. With sufficient permissions, a compromised account can gain almost unlimited access to data and settings, including the ability to reset the passwords of other admins. This account modification may immediately follow account creation or other malicious account activity. Adversaries may also modify existing valid accounts that they have compromised, potentially leading to privilege escalation and lateral movement to additional accounts. In some cases, adversaries may add roles to adversary-controlled accounts outside the victim cloud tenant, allowing external accounts to perform actions inside the victim tenant. Threat groups such as Scattered Spider, LAPSUS$, and Storm-0501 have used this technique to gain persistent administrative access to cloud environments.
MITRE ATT&CK
- Tactic
- Persistence Privilege Escalation
- Technique
- T1098 Account Manipulation
- Sub-technique
- T1098.003 Additional Cloud Roles
- Canonical reference
- https://attack.mitre.org/techniques/T1098/003/
KQL Detection Query
// T1098.003 - Additional Cloud Roles Detection
// Covers Azure AD / Entra ID, Azure RBAC, and Office 365 role assignments
let HighPrivilegeRoles = dynamic([
"Global Administrator", "Company Administrator",
"Privileged Role Administrator", "Security Administrator",
"Exchange Administrator", "SharePoint Administrator",
"Hybrid Identity Administrator", "Application Administrator",
"Cloud Application Administrator", "Authentication Administrator",
"User Access Administrator", "Owner", "Contributor",
"Privileged Authentication Administrator"
]);
let SensitiveOperations = dynamic([
"Add member to role",
"Add eligible member to role",
"Add member to role in PIM requested",
"Add member to role completed (PIM activation)",
"Assign directory role to user",
"Microsoft.Authorization/roleAssignments/write",
"Microsoft.Authorization/elevateAccess/action"
]);
union
(
// Azure AD / Entra ID role assignments via AuditLogs
AuditLogs
| where TimeGenerated > ago(24h)
| where OperationName has_any (SensitiveOperations)
| extend TargetUser = tostring(TargetResources[0].userPrincipalName)
| extend TargetObjectId = tostring(TargetResources[0].id)
| extend RoleName = tostring(TargetResources[0].modifiedProperties[0].newValue)
| extend InitiatedByUser = tostring(InitiatedBy.user.userPrincipalName)
| extend InitiatedByApp = tostring(InitiatedBy.app.displayName)
| extend InitiatedByIPAddress = tostring(InitiatedBy.user.ipAddress)
| extend IsHighPrivilege = RoleName has_any (HighPrivilegeRoles)
| project
TimeGenerated,
OperationName,
TargetUser,
TargetObjectId,
RoleName,
InitiatedByUser,
InitiatedByApp,
InitiatedByIPAddress,
IsHighPrivilege,
Result,
CorrelationId,
Category,
Source = "AuditLogs"
),
(
// Azure Activity Log - RBAC role assignments at subscription/resource level
AzureActivity
| where TimeGenerated > ago(24h)
| where OperationNameValue in~ (
"Microsoft.Authorization/roleAssignments/write",
"Microsoft.Authorization/elevateAccess/action",
"Microsoft.Authorization/roleDefinitions/write"
)
| where ActivityStatusValue == "Success"
| extend InitiatedByUser = tostring(Caller)
| extend TargetResource = ResourceId
| extend SubscriptionId = tostring(SubscriptionId)
| project
TimeGenerated,
OperationNameValue,
InitiatedByUser,
TargetResource,
SubscriptionId,
ResourceGroup,
CallerIpAddress,
ActivityStatusValue,
Source = "AzureActivity"
)
| sort by TimeGenerated desc Detects additional cloud role assignments in Azure AD / Entra ID and Azure RBAC environments. The query unions AuditLogs (for directory role assignments, PIM activations, and app role grants) with AzureActivity (for subscription-level RBAC role assignment writes and elevateAccess actions). Flags high-privilege roles including Global Administrator, Privileged Role Administrator, User Access Administrator, and Owner. Maps to Scattered Spider, LAPSUS$, and Storm-0501 TTPs documented in the wild.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate IT administrators assigning roles as part of onboarding new employees or service accounts during approved change windows
- Privileged Identity Management (PIM) activations by authorized users performing time-bound role elevations for maintenance tasks
- Automated infrastructure provisioning pipelines (Terraform, Bicep, ARM templates) that assign roles as part of resource deployment
- Help desk or identity governance processes granting temporary access to resolve user issues under a ticketed change request
- Azure AD Connect or other hybrid identity synchronization services that periodically update role memberships
Other platforms for T1098.003
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 1Assign Global Administrator Role to User via Azure AD PowerShell
Expected signal: Azure AD AuditLogs: OperationName 'Add member to role' with TargetResources containing the target UPN and RoleName 'Global Administrator'. InitiatedBy will show the executing account's UPN and IP address. Event appears in AuditLogs within 5-15 minutes. Unified Audit Log: RecordType 8, Operation 'Add member to role.' with similar details.
- Test 2Assign Azure Subscription Owner Role via Az PowerShell (RBAC Escalation)
Expected signal: AzureActivity log: OperationNameValue 'Microsoft.Authorization/roleAssignments/write' with ActivityStatusValue 'Success', Caller set to the executing account, ResourceId containing the subscription scope and roleAssignment GUID. Event appears in AzureActivity within 2-5 minutes.
- Test 3Use elevateAccess API to Gain User Access Administrator at Root Scope
Expected signal: AzureActivity log: OperationNameValue 'Microsoft.Authorization/elevateAccess/action' with ActivityStatusValue 'Success', Caller set to the Global Admin account. A second event 'Microsoft.Authorization/roleAssignments/write' at scope '/' will also appear as the role is auto-assigned.
- Test 4Add External Guest Account to Privileged Role via Microsoft Graph API
Expected signal: Azure AD AuditLogs: OperationName 'Add member to role' with TargetResources showing the guest account UPN (ending in #EXT# or external domain) and RoleName 'Security Administrator'. InitiatedBy shows the account that executed the Graph API call with its IP address. Graph API calls appear as 'Microsoft Graph' in the InitiatedBy.app field when authenticated via service principal.
References (14)
- https://attack.mitre.org/techniques/T1098/003/
- https://docs.microsoft.com/en-us/office365/admin/add-users/about-admin-roles?view=o365-worldwide
- https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
- https://cloud.google.com/iam/docs/policies
- https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/
- https://expel.com/blog/incident-report-from-cli-to-console-chasing-an-attacker-in-aws/
- https://www.microsoft.com/security/blog/2022/03/22/dev-0537-criminal-actor-targeting-organizations-for-data-exfiltration-and-destruction/
- https://www.microsoft.com/security/blog/2023/10/25/octo-tempest-crosses-boundaries-to-facilitate-extortion-encryption-and-destruction/
- https://www.invictus-ir.com/news/the-curious-case-of-dangerdev-protonmail-me
- https://learn.microsoft.com/en-us/azure/active-directory/roles/security-planning
- https://learn.microsoft.com/en-us/azure/role-based-access-control/elevate-access-global-admin
- https://learn.microsoft.com/en-us/azure/active-directory/privileged-identity-management/pim-configure
- https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log
- https://learn.microsoft.com/en-us/microsoft-365/compliance/search-the-audit-log-in-security-and-compliance
Unlock Pro Content
Get the full detection package for T1098.003 including response playbook, investigation guide, and atomic red team tests.