Skip to content

[New] Microsoft Entra ID Protection Alert and Device Registration #4688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2ce13d2
[New] Device Registration via OAuth Code Authentication
Samirbous Apr 30, 2025
bd6dbd3
Update credential_access_antra_id_device_reg_via_oauth_redirection.toml
Samirbous Apr 30, 2025
1cb0383
Create persistence_identity_protect_alert_followed_by_device_reg.toml
Samirbous Apr 30, 2025
76c7cef
Update credential_access_antra_id_device_reg_via_oauth_redirection.toml
Samirbous Apr 30, 2025
ce45512
Create initial_access_multi_azure_identity_protection_alerts.toml
Samirbous Apr 30, 2025
693aa2f
changed from KQL to EQL
terrancedejesus Apr 30, 2025
0007117
updated rules; query logic changes; investigation guides; schema
terrancedejesus May 1, 2025
63179f3
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 1, 2025
3da71ad
updating patch version
terrancedejesus May 1, 2025
34ba87d
Update pyproject.toml
Samirbous May 1, 2025
c81bfdb
++
Samirbous May 1, 2025
00caf73
Merge branch 'azure-oauth-phish' of https://github.com/elastic/detect…
Samirbous May 1, 2025
01fc324
Update non-ecs-schema.json
Samirbous May 1, 2025
d7d4401
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 2, 2025
1da33ef
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 2, 2025
7e2f735
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 2, 2025
4a1d8be
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 2, 2025
1d882ac
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 5, 2025
e1173e3
Merge branch 'main' into azure-oauth-phish
terrancedejesus May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[metadata]
creation_date = "2025/04/30"
integration = ["azure"]
maturity = "production"
updated_date = "2025/04/30"

[rule]
author = ["Elastic"]
description = """
Identifies sequence of events where a Microsoft Entra ID protection alert is followed by an attempt to register a new device by the same user principal. This behavior may indicate an adversary using a compromised account to register a device, potentially leading to unauthorized access to resources or persistence in the environment.
"""
from = "now-9m"
index = ["filebeat-*", "logs-azure*"]
language = "eql"
license = "Elastic License v2"
name = "Microsoft Entra ID Protection Alert and Device Registration"
note = """## Triage and analysis

### Investigating Microsoft Entra ID Identity Protection Alert and Device Registration

#### Possible investigation steps

- Identify the Risk Detection that triggered the event. A list with descriptions can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/concept-identity-protection-risks#risk-types-and-detection).
- Identify the user account involved and validate whether the suspicious activity is normal for that user.
- Consider the source IP address and geolocation for the involved user account. Do they look normal?
- Consider the device used to sign in. Is it registered and compliant?
- Investigate other alerts associated with the user account during the past 48 hours.
- Contact the account owner and confirm whether they are aware of this activity.
- Check if this operation was approved and performed according to the organization's change management policy.
- 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 rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and device conditions.
- Consider the context of the user account and whether the activity is expected. For example, if the user is a developer or administrator, they may have legitimate reasons for accessing resources from various locations or devices.
- A Microsoft Entra ID Protection alert may be triggered by legitimate activities such as password resets, MFA changes, or device registrations. If the user is known to perform these actions regularly, it may not indicate a compromise.

### 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.
- Consider enabling multi-factor authentication for users.
- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) 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)."""
references = [
"https://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema",
"https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/overview-identity-protection",
"https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk",
"https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/howto-identity-protection-investigate-risk#investigation-framework",
]
risk_score = 73
rule_id = "a6d4e070-b9b9-4294-b028-d9e21ad47413"
severity = "high"
tags = [
"Domain: Cloud",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Protection Logs",
"Data Source: Microsoft Entra ID Audit Logs",
"Use Case: Identity and Access Audit",
"Resources: Investigation Guide",
"Tactic: Persistence",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence with maxspan=30m
[any where event.dataset == "azure.identity_protection"] by azure.identityprotection.properties.user_principal_name
[any where event.dataset == "azure.auditlogs" and event.action == "Register device"] by azure.auditlogs.properties.initiated_by.user.userPrincipalName
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1098"
name = "Account Manipulation"
reference = "https://attack.mitre.org/techniques/T1098/"

[[rule.threat.technique.subtechnique]]
id = "T1098.005"
name = "Device Registration"
reference = "https://attack.mitre.org/techniques/T1098/005/"


[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
Loading