Skip to content

Commit 7590bf6

Browse files
tuned 'AWS EC2 Instance Interaction with IAM Service' to be BBR
1 parent 5895235 commit 7590bf6

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

rules/integrations/aws/persistence_ec2_instance_request_to_iam_service.toml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
[metadata]
2+
bypass_bbr_timing = true
23
creation_date = "2024/07/24"
34
integration = ["aws"]
45
maturity = "production"
5-
updated_date = "2024/07/24"
6+
updated_date = "2024/11/05"
67

78
[rule]
89
author = ["Elastic"]
10+
building_block_type = "default"
911
description = """
1012
Identifies when an EC2 instance interacts with the AWS IAM service via an assumed role. This is uncommon behavior and could indicate an attacker using compromised credentials to further exploit an environment. For example, an assumed role could be used to create new users for persistence or add permissions for privilege escalation. An EC2 instance assumes a role using their EC2 ID as the session name. This rule looks for the pattern "i-" which is the beginning pattern for assumed role sessions started by an EC2 instance.
13+
14+
This is a [building block](https://www.elastic.co/guide/en/security/current/building-block-rule.html) rule and does not generate alerts on its own. It is meant to be used for correlation with other rules to detect suspicious activity.
1115
"""
1216
false_positives = ["Administrators may use EC2 instances to interact with IAM services as part of an automation workflow, ensure validity of the triggered event and include exceptions where necessary."]
1317
from = "now-6m"
@@ -18,9 +22,9 @@ name = "AWS EC2 Instance Interaction with IAM Service"
1822
references = [
1923
"https://redcanary.com/blog/aws-sts/",
2024
]
21-
risk_score = 47
25+
risk_score = 21
2226
rule_id = "a44bcb58-5109-4870-a7c6-11f5fe7dd4b1"
23-
severity = "medium"
27+
severity = "low"
2428
tags = [
2529
"Domain: Cloud",
2630
"Data Source: AWS",
@@ -35,10 +39,22 @@ timestamp_override = "event.ingested"
3539
type = "eql"
3640

3741
query = '''
38-
any where event.dataset == "aws.cloudtrail"
39-
and event.provider == "iam.amazonaws.com"
40-
and aws.cloudtrail.user_identity.type == "AssumedRole"
41-
and stringContains (user.id, ":i-")
42+
event.dataset == "aws.cloudtrail"
43+
and event.provider == "iam.amazonaws.com"
44+
and aws.cloudtrail.user_identity.type == "AssumedRole"
45+
and stringContains(user.id, ":i-")
46+
and (
47+
startsWith(event.action, "Update")
48+
or startsWith(event.action, "Attach")
49+
or startsWith(event.action, "Detach")
50+
or startsWith(event.action, "Create")
51+
or startsWith(event.action, "Delete")
52+
or startsWith(event.action, "Add")
53+
or startsWith(event.action, "Remove")
54+
or startsWith(event.action, "Put")
55+
or startsWith(event.action, "Tag")
56+
)
57+
4258
'''
4359

4460

0 commit comments

Comments
 (0)