Azure Privilege Identity Management Role Modified
Azure Active Directory (AD) Privileged Identity Management (PIM) is a service that enables you to manage, control, and monitor access to important resources in an organization. PIM can be used to manage the built-in Azure resource roles such as Global Administrator and Application Administrator. An adversary may add a user to a PIM role in order to maintain persistence in their target's environment or modify a PIM role to weaken their target's security controls.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/09/01"
3integration = ["azure"]
4maturity = "production"
5updated_date = "2024/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Azure Active Directory (AD) Privileged Identity Management (PIM) is a service that enables you to manage, control, and
11monitor access to important resources in an organization. PIM can be used to manage the built-in Azure resource roles
12such as Global Administrator and Application Administrator. An adversary may add a user to a PIM role in order to
13maintain persistence in their target's environment or modify a PIM role to weaken their target's security controls.
14"""
15from = "now-25m"
16index = ["filebeat-*", "logs-azure*"]
17language = "kuery"
18license = "Elastic License v2"
19name = "Azure Privilege Identity Management Role Modified"
20note = """## Triage and analysis
21
22### Investigating Azure Privilege Identity Management Role Modified
23
24Azure Active Directory (AD) Privileged Identity Management (PIM) is a service that enables you to manage, control, and monitor access to important resources in an organization. PIM can be used to manage the built-in Azure resource roles such as Global Administrator and Application Administrator.
25
26This rule identifies the update of PIM role settings, which can indicate that an attacker has already gained enough access to modify role assignment settings.
27
28#### Possible investigation steps
29
30- Identify the user account that performed the action and whether it should perform this kind of action.
31- Investigate other alerts associated with the user account during the past 48 hours.
32- Consider the source IP address and geolocation for the user who issued the command. Do they look normal for the user?
33- Consider the time of day. If the user is a human, not a program or script, did the activity take place during a normal time of day?
34- Check if this operation was approved and performed according to the organization's change management policy.
35- Contact the account owner and confirm whether they are aware of this activity.
36- Examine the account's commands, API calls, and data management actions in the last 24 hours.
37- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.
38
39### False positive analysis
40
41- If this activity didn't follow your organization's change management policies, it should be reviewed by the security team.
42
43### Response and remediation
44
45- Initiate the incident response process based on the outcome of the triage.
46- Disable or limit the account during the investigation and response.
47- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
48 - Identify the account role in the cloud environment.
49 - Assess the criticality of affected services and servers.
50 - Work with your IT team to identify and minimize the impact on users.
51 - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
52 - Identify any regulatory or legal ramifications related to this activity.
53- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
54- Check if unauthorized new users were created, remove unauthorized new accounts, and request password resets for other IAM users.
55- Restore the PIM roles to the desired state.
56- Consider enabling multi-factor authentication for users.
57- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) by Microsoft.
58- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
59- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
60
61## Setup
62
63The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
64references = [
65 "https://docs.microsoft.com/en-us/azure/active-directory/privileged-identity-management/pim-resource-roles-assign-roles",
66 "https://docs.microsoft.com/en-us/azure/active-directory/privileged-identity-management/pim-configure",
67]
68risk_score = 47
69rule_id = "7882cebf-6cf1-4de3-9662-213aa13e8b80"
70severity = "medium"
71tags = [
72 "Domain: Cloud",
73 "Data Source: Azure",
74 "Use Case: Identity and Access Audit",
75 "Resources: Investigation Guide",
76 "Tactic: Persistence",
77]
78timestamp_override = "event.ingested"
79type = "query"
80
81query = '''
82event.dataset:azure.auditlogs and azure.auditlogs.operation_name:"Update role setting in PIM" and event.outcome:(Success or success)
83'''
84
85
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88[[rule.threat.technique]]
89id = "T1078"
90name = "Valid Accounts"
91reference = "https://attack.mitre.org/techniques/T1078/"
92
93
94[rule.threat.tactic]
95id = "TA0003"
96name = "Persistence"
97reference = "https://attack.mitre.org/tactics/TA0003/"
98[[rule.threat]]
99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1078"
102name = "Valid Accounts"
103reference = "https://attack.mitre.org/techniques/T1078/"
104
105
106[rule.threat.tactic]
107id = "TA0005"
108name = "Defense Evasion"
109reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Azure Privilege Identity Management Role Modified
Azure Active Directory (AD) Privileged Identity Management (PIM) is a service that enables you to manage, control, and monitor access to important resources in an organization. PIM can be used to manage the built-in Azure resource roles such as Global Administrator and Application Administrator.
This rule identifies the update of PIM role settings, which can indicate that an attacker has already gained enough access to modify role assignment settings.
Possible investigation steps
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user account during the past 48 hours.
- Consider the source IP address and geolocation for the user who issued the command. Do they look normal for the user?
- Consider the time of day. If the user is a human, not a program or script, did the activity take place during a normal time of day?
- Check if this operation was approved and performed according to the organization's change management policy.
- Contact the account owner and confirm whether they are aware of this activity.
- Examine the account's commands, API calls, and data management actions in the last 24 hours.
- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.
False positive analysis
- If this activity didn't follow your organization's change management policies, it should be reviewed by the security team.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
- Identify the account role in the cloud environment.
- Assess the criticality of affected services and servers.
- Work with your IT team to identify and minimize the impact on users.
- Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
- Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Check if unauthorized new users were created, remove unauthorized new accounts, and request password resets for other IAM users.
- Restore the PIM roles to the desired state.
- Consider enabling multi-factor authentication for users.
- Follow security best practices outlined by Microsoft.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
Setup
The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
References
Related rules
- Multi-Factor Authentication Disabled for an Azure User
- AWS IAM User Addition to Group
- Azure AD Global Administrator Role Assigned
- Azure Active Directory High Risk Sign-in
- Azure Active Directory High Risk User Sign-in Heuristic