Skip to content

Commit f368453

Browse files
Samirbousshashank-elasticterrancedejesus
authored
[New] First Time Seen User Auth via DeviceCode Protocol (#4153)
* Create credential_access_first_time_seen_device_code_auth.toml * Update credential_access_first_time_seen_device_code_auth.toml * Update credential_access_first_time_seen_device_code_auth.toml * Update rules/integrations/azure/credential_access_first_time_seen_device_code_auth.toml Co-authored-by: Terrance DeJesus <[email protected]> * Update rules/integrations/azure/credential_access_first_time_seen_device_code_auth.toml Co-authored-by: Terrance DeJesus <[email protected]> * Update credential_access_first_time_seen_device_code_auth.toml --------- Co-authored-by: shashank-elastic <[email protected]> Co-authored-by: Terrance DeJesus <[email protected]>
1 parent b66d0e0 commit f368453

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[metadata]
2+
creation_date = "2024/10/14"
3+
integration = ["azure"]
4+
maturity = "production"
5+
updated_date = "2024/10/14"
6+
7+
[rule]
8+
author = ["Elastic", "Matteo Potito Giorgio"]
9+
description = """
10+
Identifies when a user is observed for the first time in the last 14 days authenticating using the deviceCode protocol. The device code authentication flow can be abused by attackers to phish users and steal access tokens to impersonate the victim. By its very nature, device code should only be used when logging in to devices without keyboards, where it is difficult to enter emails and passwords.
11+
"""
12+
from = "now-9m"
13+
index = ["filebeat-*", "logs-azure.signinlogs-*", "logs-azure.activitylogs-*"]
14+
language = "kuery"
15+
license = "Elastic License v2"
16+
name = "First Occurrence of Entra ID Auth via DeviceCode Protocol"
17+
references =[
18+
"https://aadinternals.com/post/phishing/",
19+
"https://www.blackhillsinfosec.com/dynamic-device-code-phishing/"
20+
]
21+
risk_score = 47
22+
rule_id = "af22d970-7106-45b4-b5e3-460d15333727"
23+
setup = """
24+
This rule optionally requires Azure Sign-In logs from the Azure integration. Ensure that the Azure integration is correctly set up and that the required data is being collected.
25+
"""
26+
severity = "medium"
27+
tags = [
28+
"Domain: Cloud",
29+
"Data Source: Azure",
30+
"Data Source: Microsoft Entra ID",
31+
"Use Case: Identity and Access Audit",
32+
"Tactic: Credential Access",
33+
]
34+
timestamp_override = "event.ingested"
35+
type = "new_terms"
36+
37+
query = '''
38+
event.dataset:(azure.activitylogs or azure.signinlogs) and
39+
(azure.signinlogs.properties.authentication_protocol:deviceCode or azure.activitylogs.properties.authentication_protocol:deviceCode) and event.outcome:success
40+
'''
41+
42+
43+
[[rule.threat]]
44+
framework = "MITRE ATT&CK"
45+
[[rule.threat.technique]]
46+
id = "T1528"
47+
name = "Steal Application Access Token"
48+
reference = "https://attack.mitre.org/techniques/T1528/"
49+
50+
51+
[rule.threat.tactic]
52+
id = "TA0006"
53+
name = "Credential Access"
54+
reference = "https://attack.mitre.org/tactics/TA0006/"
55+
56+
57+
[rule.new_terms]
58+
field = "new_terms_fields"
59+
value = ["azure.signinlogs.properties.user_principal_name"]
60+
[[rule.new_terms.history_window_start]]
61+
field = "history_window_start"
62+
value = "now-14d"

0 commit comments

Comments
 (0)