Skip to content

Commit 3325357

Browse files
imays11github-actions[bot]
authored andcommitted
[New Rule] AWS STS AssumeRole with New MFA Device [Rule Tuning] AWS IAM Deactivation of MFA Device (#4210)
* [New Rule] [Rule Tuning] AWS STS AssumeRole with New MFA Device, AWS IAM Deactivation of MFA Device New terms rule for new MFA device with AssumeRole action. Rule tuning to add MITRE technique to "AWS IAM Deactivation of MFA Device" * add serialNumber to non-ecs schema file * fixed misspelled toml file name * Update rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml Co-authored-by: Ruben Groenewoud <[email protected]> --------- Co-authored-by: Ruben Groenewoud <[email protected]> (cherry picked from commit 09ea35f)
1 parent b586c73 commit 3325357

File tree

3 files changed

+125
-2
lines changed

3 files changed

+125
-2
lines changed

detection_rules/etc/non-ecs-schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@
150150
"logs-aws.cloudtrail-*": {
151151
"aws.cloudtrail.flattened.request_parameters.cidrIp": "keyword",
152152
"aws.cloudtrail.flattened.request_parameters.fromPort": "keyword",
153-
"aws.cloudtrail.flattened.request_parameters.roleArn": "keyword"
153+
"aws.cloudtrail.flattened.request_parameters.roleArn": "keyword",
154+
"aws.cloudtrail.flattened.request_parameters.serialNumber": "keyword"
154155
},
155156
"logs-azure.signinlogs-*": {
156157
"azure.signinlogs.properties.conditional_access_audiences.application_id": "keyword"

rules/integrations/aws/impact_iam_deactivate_mfa_device.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/05/26"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/05/21"
5+
updated_date = "2024/10/25"
66

77
[rule]
88
author = ["Elastic", "Austin Songer"]
@@ -80,6 +80,7 @@ tags = [
8080
"Data Source: AWS IAM",
8181
"Resources: Investigation Guide",
8282
"Tactic: Impact",
83+
"Tactic: Persistence",
8384
]
8485
timestamp_override = "event.ingested"
8586
type = "query"
@@ -101,4 +102,19 @@ reference = "https://attack.mitre.org/techniques/T1531/"
101102
id = "TA0040"
102103
name = "Impact"
103104
reference = "https://attack.mitre.org/tactics/TA0040/"
105+
[[rule.threat]]
106+
framework = "MITRE ATT&CK"
107+
[[rule.threat.technique]]
108+
id = "T1556"
109+
name = "Modify Authentication Process"
110+
reference = "https://attack.mitre.org/techniques/T1556/"
111+
[[rule.threat.technique.subtechnique]]
112+
id = "T1556.006"
113+
name = "Multi-Factor Authentication"
114+
reference = "https://attack.mitre.org/techniques/T1556/006/"
104115

116+
117+
[rule.threat.tactic]
118+
id = "TA0003"
119+
name = "Persistence"
120+
reference = "https://attack.mitre.org/tactics/TA0003/"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
[metadata]
2+
creation_date = "2024/10/25"
3+
integration = ["aws"]
4+
maturity = "production"
5+
updated_date = "2024/10/25"
6+
7+
8+
[rule]
9+
author = ["Elastic"]
10+
description = """
11+
Identifies when a user has assumed a role using a new MFA device. Users can assume a role to obtain temporary credentials and access AWS resources using the AssumeRole API of AWS Security Token Service (STS).
12+
While a new MFA device is not always indicative of malicious behavior it should be verified as adversaries can use this technique for persistence and privilege escalation.
13+
"""
14+
false_positives = [
15+
"AWS administrators or automated processes might regularly assume roles for legitimate administrative purposes and to perform periodic tasks such as data backups, updates, or deployments.",
16+
]
17+
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
18+
language = "kuery"
19+
license = "Elastic License v2"
20+
name = "AWS STS AssumeRole with New MFA Device"
21+
note = """## Setup
22+
23+
The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
24+
references = [
25+
"https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html",
26+
"https://github.com/RhinoSecurityLabs/cloudgoat/blob/d5863b80afd082d853f2e8df1955c6393695a4da/scenarios/iam_privesc_by_key_rotation/README.md",
27+
]
28+
risk_score = 21
29+
rule_id = "a22f566b-5b23-4412-880d-c6c957acd321"
30+
severity = "low"
31+
tags = [
32+
"Domain: Cloud",
33+
"Data Source: AWS",
34+
"Data Source: Amazon Web Services",
35+
"Data Source: AWS STS",
36+
"Use Case: Identity and Access Audit",
37+
"Tactic: Privilege Escalation",
38+
"Tactic: Persistence",
39+
"Tactic: Lateral Movement",
40+
]
41+
timestamp_override = "event.ingested"
42+
type = "new_terms"
43+
44+
query = '''
45+
event.dataset:aws.cloudtrail
46+
and event.provider:sts.amazonaws.com
47+
and event.action:(AssumeRole or AssumeRoleWithSAML or AssumeRoleWithWebIdentity)
48+
and event.outcome:success
49+
and user.id:*
50+
and aws.cloudtrail.flattened.request_parameters.serialNumber:*
51+
'''
52+
53+
54+
[[rule.threat]]
55+
framework = "MITRE ATT&CK"
56+
[[rule.threat.technique]]
57+
id = "T1556"
58+
name = "Modify Authentication Process"
59+
reference = "https://attack.mitre.org/techniques/T1556/"
60+
[[rule.threat.technique.subtechnique]]
61+
id = "T1556.006"
62+
name = "Multi-Factor Authentication"
63+
reference = "https://attack.mitre.org/techniques/T1556/006/"
64+
65+
66+
[rule.threat.tactic]
67+
id = "TA0003"
68+
name = "Persistence"
69+
reference = "https://attack.mitre.org/tactics/TA0003/"
70+
[[rule.threat]]
71+
framework = "MITRE ATT&CK"
72+
[[rule.threat.technique]]
73+
id = "T1548"
74+
name = "Abuse Elevation Control Mechanism"
75+
reference = "https://attack.mitre.org/techniques/T1548/"
76+
77+
78+
[rule.threat.tactic]
79+
id = "TA0004"
80+
name = "Privilege Escalation"
81+
reference = "https://attack.mitre.org/tactics/TA0004/"
82+
[[rule.threat]]
83+
framework = "MITRE ATT&CK"
84+
[[rule.threat.technique]]
85+
id = "T1550"
86+
name = "Use Alternate Authentication Material"
87+
reference = "https://attack.mitre.org/techniques/T1550/"
88+
[[rule.threat.technique.subtechnique]]
89+
id = "T1550.001"
90+
name = "Application Access Token"
91+
reference = "https://attack.mitre.org/techniques/T1550/001/"
92+
93+
94+
[rule.threat.tactic]
95+
id = "TA0008"
96+
name = "Lateral Movement"
97+
reference = "https://attack.mitre.org/tactics/TA0008/"
98+
99+
[rule.new_terms]
100+
field = "new_terms_fields"
101+
value = ["user.id", "aws.cloudtrail.flattened.request_parameters.serialNumber"]
102+
[[rule.new_terms.history_window_start]]
103+
field = "history_window_start"
104+
value = "now-10d"
105+
106+

0 commit comments

Comments
 (0)