Skip to content

Commit 7392b87

Browse files
adding investigation fields to specific aws rules
1 parent d2502c7 commit 7392b87

19 files changed

+325
-36
lines changed

detection_rules/etc/non-ecs-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"aws.cloudtrail.flattened.request_parameters.fromPort": "keyword",
153153
"aws.cloudtrail.flattened.request_parameters.roleArn": "keyword",
154154
"aws.cloudtrail.flattened.request_parameters.roleName": "keyword",
155-
"aws.cloudtrail.flattened.request_paramters.policyArn": "keyword",
155+
"aws.cloudtrail.flattened.request_parameters.policyArn": "keyword",
156156
"aws.cloudtrail.flattened.request_parameters.serialNumber": "keyword"
157157
},
158158
"logs-azure.signinlogs-*": {

rules/cross-platform/execution_aws_ssm_sendcommand_with_command_parameters.toml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2022/09/03"
33
integration = ["endpoint", "auditd_manager"]
44
maturity = "production"
5-
updated_date = "2024/09/23"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
@@ -87,6 +89,25 @@ and process.args: (
8789
)
8890
'''
8991

92+
[rule.investigation_fields]
93+
field_names = [
94+
"@timestamp",
95+
"cloud.region",
96+
"event.type",
97+
"host.os.type",
98+
"host.os.kernel",
99+
"process.entry_leader.executable",
100+
"process.entry_leader.group.name",
101+
"process.entry_leader.real_user.name",
102+
"process.entry_leader.working_directory",
103+
"process.parent.executable",
104+
"process.executable",
105+
"process.hash.sha256",
106+
"process.parent.command_line",
107+
"process.command_line",
108+
"process.args",
109+
"process.user.name"
110+
]
90111

91112
[[rule.threat]]
92113
framework = "MITRE ATT&CK"

rules/integrations/aws/defense_evasion_cloudtrail_logging_deleted.toml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2020/05/26"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/05/21"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
@@ -86,9 +88,26 @@ timestamp_override = "event.ingested"
8688
type = "query"
8789

8890
query = '''
89-
event.dataset:aws.cloudtrail and event.provider:cloudtrail.amazonaws.com and event.action:DeleteTrail and event.outcome:success
91+
event.dataset:aws.cloudtrail
92+
and event.provider:cloudtrail.amazonaws.com
93+
and event.action:DeleteTrail
94+
and event.outcome:success
9095
'''
9196

97+
[rule.investigation_fields]
98+
field_names = [
99+
"event.action",
100+
"event.outcome",
101+
"cloud.region",
102+
"user_agent.original",
103+
"user.name",
104+
"related.user",
105+
"source.address",
106+
"aws.cloudtrail.request_parameters",
107+
"aws.cloudtrail.flattened.request_parameters.name",
108+
"aws.cloudtrail.user_identity.type",
109+
"aws.cloudtrail.user_identity.arn"
110+
]
92111

93112
[[rule.threat]]
94113
framework = "MITRE ATT&CK"

rules/integrations/aws/discovery_ec2_multi_region_describe_instances.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2024/08/26"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/11/05"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
@@ -107,6 +109,13 @@ from logs-aws.cloudtrail-*
107109
| sort target_time_window desc
108110
'''
109111

112+
[rule.investigation_fields]
113+
field_names = [
114+
"region_count",
115+
"window_count",
116+
"target_time_window",
117+
"aws.cloudtrail.user_identity.arn"
118+
]
110119

111120
[[rule.threat]]
112121
framework = "MITRE ATT&CK"

rules/integrations/aws/discovery_ec2_multiple_discovery_api_calls_via_cli.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ integration = ["aws"]
44
maturity = "production"
55
min_stack_comments = "ES|QL rule type is still in technical preview as of 8.13, however this rule was tested successfully"
66
min_stack_version = "8.13.0"
7-
updated_date = "2024/11/04"
7+
updated_date = "2024/11/07"
88

99
[rule]
1010
author = ["Elastic"]
@@ -133,6 +133,12 @@ from logs-aws.cloudtrail*
133133
| sort unique_api_count desc
134134
'''
135135

136+
[rule.investigation_fields]
137+
field_names = [
138+
"time_window",
139+
"aws.cloudtrail.user_identity.arn",
140+
"unique_api_count"
141+
]
136142

137143
[[rule.threat]]
138144
framework = "MITRE ATT&CK"

rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
creation_date = "2024/05/24"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/09/30"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
911
description = """
10-
An adversary with access to a set of compromised credentials may attempt to verify that the credentials are valid and
11-
determine what account they are using. This rule looks for the first time an identity has called the
12-
STS `GetCallerIdentity` API operation in the last 15 days, which may be an indicator of compromised credentials.
12+
An adversary with access to a set of compromised credentials may attempt to verify that the credentials are valid and
13+
determine what account they are using. This rule looks for the first time an identity has called the
14+
STS `GetCallerIdentity` API operation in the last 15 days, which may be an indicator of compromised credentials.
1315
A legitimate user would not need to call this operation as they should know the account they are using.
1416
"""
1517
false_positives = [
1618
"""
17-
Verify whether the user identity should be using the STS `GetCallerIdentity` API operation.
19+
Verify whether the user identity should be using the STS `GetCallerIdentity` API operation.
1820
If known behavior is causing false positives, it can be exempted from the rule.
1921
""",
2022
]
@@ -29,7 +31,7 @@ note = """## Triage and analysis
2931
### Investigating AWS GetCallerIdentity API Called for the First Time
3032
3133
AWS Security Token Service (AWS STS) is a service that enables you to request temporary, limited-privilege credentials for users.
32-
The `GetCallerIdentity` function returns details about the IAM user or role owning the credentials used to call the operation.
34+
The `GetCallerIdentity` function returns details about the IAM user or role owning the credentials used to call the operation.
3335
No permissions are required to run this operation and the same information is returned even when access is denied.
3436
This rule looks for use of the `GetCallerIdentity` operation. This is a [New Terms](https://www.elastic.co/guide/en/security/master/rules-ui-create.html#create-new-terms-rule) rule indicating this is the first time a specific user identity has called this operation within the last 15 days.
3537
@@ -93,10 +95,23 @@ timestamp_override = "event.ingested"
9395
type = "new_terms"
9496

9597
query = '''
96-
event.dataset: "aws.cloudtrail" and event.provider: "sts.amazonaws.com" and event.action: "GetCallerIdentity"
97-
and not aws.cloudtrail.user_identity.type: "AssumedRole"
98+
event.dataset: "aws.cloudtrail"
99+
and event.provider: "sts.amazonaws.com"
100+
and event.action: "GetCallerIdentity"
101+
and event.outcome: "success"
102+
and not aws.cloudtrail.user_identity.type: "AssumedRole"
98103
'''
99104

105+
[rule.investigation_fields]
106+
field_names = [
107+
"event.action",
108+
"event.outcome",
109+
"cloud.region",
110+
"user_agent.original",
111+
"user.name",
112+
"aws.cloudtrail.user_identity.type",
113+
"aws.cloudtrail.user_identity.arn"
114+
]
100115

101116
[[rule.threat]]
102117
framework = "MITRE ATT&CK"

rules/integrations/aws/execution_ssm_command_document_created_by_rare_user.toml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,29 @@
22
creation_date = "2024/11/01"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/11/01"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
911
description = """
10-
Identifies when an AWS Systems Manager (SSM) command document is created by a user who does not typically perform this action. Adversaries may create SSM command documents to execute commands on managed instances, potentially leading to unauthorized access, command and control, data exfiltration and more.
12+
Identifies when an AWS Systems Manager (SSM) command document is created by a user who does not typically perform this
13+
action. Adversaries may create SSM command documents to execute commands on managed instances, potentially leading to
14+
unauthorized access, command and control, data exfiltration and more.
1115
"""
1216
false_positives = [
1317
"""
14-
Legitimate users may create SSM command documents for legitimate purposes. Ensure that the document is authorized and the user is known before taking action.
18+
Legitimate users may create SSM command documents for legitimate purposes. Ensure that the document is authorized
19+
and the user is known before taking action.
1520
""",
1621
]
1722
from = "now-9m"
1823
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
1924
language = "kuery"
2025
license = "Elastic License v2"
2126
name = "AWS SSM Command Document Created by Rare User"
22-
note = """
23-
## Triage and Analysis
27+
note = """## Triage and Analysis
2428
2529
### Investigating AWS SSM Command Document Created by Rare User
2630
@@ -55,7 +59,7 @@ For further guidance on managing and securing AWS Systems Manager in your enviro
5559
"""
5660
references = [
5761
"https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateDocument.html",
58-
"https://docs.aws.amazon.com/systems-manager/latest/userguide/documents.html"
62+
"https://docs.aws.amazon.com/systems-manager/latest/userguide/documents.html",
5963
]
6064
risk_score = 21
6165
rule_id = "50a2bdea-9876-11ef-89db-f661ea17fbcd"
@@ -68,7 +72,7 @@ tags = [
6872
"Data Source: AWS Systems Manager",
6973
"Resources: Investigation Guide",
7074
"Use Case: Threat Detection",
71-
"Tactic: Execution"
75+
"Tactic: Execution",
7276
]
7377
timestamp_override = "event.ingested"
7478
type = "new_terms"
@@ -81,6 +85,20 @@ event.dataset: "aws.cloudtrail"
8185
and aws.cloudtrail.response_elements: *documentType=Command*
8286
'''
8387

88+
[rule.investigation_fields]
89+
field_names = [
90+
"event.action",
91+
"event.outcome",
92+
"cloud.region",
93+
"related.user",
94+
"user.name",
95+
"user_agent.original",
96+
"aws.cloudtrail.request_parameters",
97+
"aws.cloudtrail.response_elements",
98+
"aws.cloudtrail.user_identity.arn",
99+
"aws.cloudtrail.user_identity.type"
100+
]
101+
84102
[[rule.threat]]
85103
framework = "MITRE ATT&CK"
86104

rules/integrations/aws/exfiltration_sns_email_subscription_by_rare_user.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2024/11/01"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/11/01"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic"]
@@ -81,6 +83,20 @@ event.dataset: "aws.cloudtrail"
8183
and aws.cloudtrail.request_parameters: *protocol=email*
8284
'''
8385

86+
[rule.investigation_fields]
87+
field_names = [
88+
"event.action",
89+
"event.outcome",
90+
"cloud.region",
91+
"user_agent.original",
92+
"user.name",
93+
"aws.cloudtrail.request_parameters",
94+
"aws.cloudtrail.flattened.request_parameters.protocol",
95+
"aws.cloudtrail.flattened.request_parameters.topicArn",
96+
"aws.cloudtrail.flattened.response_elements.subscriptionArn",
97+
"aws.cloudtrail.user_identity.type",
98+
"aws.cloudtrail.user_identity.arn"
99+
]
84100

85101
[[rule.threat]]
86102
framework = "MITRE ATT&CK"

rules/integrations/aws/impact_aws_s3_bucket_enumeration_or_brute_force.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
creation_date = "2024/05/01"
33
maturity = "production"
4-
updated_date = "2024/10/09"
4+
updated_date = "2024/11/07"
55
min_stack_comments = "ES|QL rule type is still in technical preview as of 8.13, however this rule was tested successfully"
66
min_stack_version = "8.13.0"
77

@@ -97,6 +97,13 @@ from logs-aws.cloudtrail*
9797
| where failed_requests > 40
9898
'''
9999

100+
[rule.investigation_fields]
101+
field_names = [
102+
"failed_requests",
103+
"tls.client.server_name",
104+
"source.address",
105+
"cloud.account.id"
106+
]
100107

101108
[[rule.threat]]
102109
framework = "MITRE ATT&CK"

rules/integrations/aws/persistence_ec2_security_group_configuration_change_detection.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2021/05/05"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2024/11/05"
5+
updated_date = "2024/11/07"
6+
min_stack_comments = "New fields added: investigation_fields"
7+
min_stack_version = "8.11.0"
68

79
[rule]
810
author = ["Elastic", "Austin Songer"]
@@ -100,6 +102,23 @@ event.dataset: "aws.cloudtrail"
100102
and event.outcome: "success"
101103
'''
102104

105+
[rule.investigation_fields]
106+
field_names = [
107+
"@timestamp",
108+
"cloud.region",
109+
"event.provider",
110+
"event.action",
111+
"event.outcome",
112+
"related.user",
113+
"user_agent.original",
114+
"user.name",
115+
"aws.cloudtrail.request_parameters",
116+
"aws.cloudtrail.response_elements",
117+
"aws.cloudtrail.flattened.request_parameters.instanceId",
118+
"aws.cloudtrail.user_identity.arn",
119+
"aws.cloudtrail.user_identity.type"
120+
]
121+
103122

104123
[[rule.threat]]
105124
framework = "MITRE ATT&CK"

0 commit comments

Comments
 (0)