Skip to content

Commit 74b9892

Browse files
authored
Merge branch 'main' into 3rd_party_edr_4
2 parents 056e631 + 0fbf57c commit 74b9892

23 files changed

+348
-172
lines changed

rules/integrations/aws/credential_access_new_terms_secretsmanager_getsecretvalue.toml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/07/06"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/02/03"
5+
updated_date = "2025/08/18"
66

77
[rule]
88
author = ["Nick Jones", "Elastic"]
@@ -12,18 +12,17 @@ attempt to leverage the compromised service to access secrets in AWS Secrets Man
1212
a specific user identity has programmatically retrieved a secret value from Secrets Manager using the `GetSecretValue`
1313
or `BatchGetSecretValue` actions. This rule assumes that AWS services such as Lambda functions and EC2 instances are
1414
setup with IAM role's assigned that have the necessary permissions to access the secrets in Secrets Manager. An
15-
adversary with access to a compromised AWS service such as an EC2 instance, Lambda function, or other service would rely
16-
on the compromised service's IAM role to access the secrets in Secrets Manager.
15+
adversary with access to a compromised AWS service would rely on its' attached role to access the secrets in Secrets Manager.
1716
"""
1817
false_positives = [
1918
"""
2019
Verify whether the user identity, user agent, and/or hostname should be using GetSecretString API for the specified
2120
SecretId. If known behavior is causing false positives, it can be exempted from the rule.
2221
""",
2322
]
24-
from = "now-60m"
23+
from = "now-6m"
2524
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
26-
interval = "10m"
25+
interval = "5m"
2726
language = "kuery"
2827
license = "Elastic License v2"
2928
name = "First Time Seen AWS Secret Value Accessed in Secrets Manager"
@@ -33,7 +32,7 @@ note = """## Triage and analysis
3332
3433
AWS Secrets Manager is a service that enables the replacement of hardcoded credentials in code, including passwords, with an API call to Secrets Manager to retrieve the secret programmatically.
3534
36-
This rule looks for the retrieval of credentials using `GetSecretValue` action in Secrets Manager programmatically. This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule indicating this is the first time a specific user identity has successfuly retrieved a specific secret value from Secrets Manager within the last 15 days.
35+
This rule looks for the retrieval of credentials from Secrets Manager using `GetSecretValue` or `BatchGetSecretValue` API calls. This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule indicating this is the first time a specific user identity has successfuly retrieved a secret value from Secrets Manager.
3736
3837
#### Possible investigation steps
3938
@@ -53,7 +52,7 @@ This rule looks for the retrieval of credentials using `GetSecretValue` action i
5352
5453
### False positive analysis
5554
56-
- Review `user.id` values for expected ARNs. If this is an expected behavior, consider adding exceptions to the rule.
55+
- Review `actor.entity.id` and `target.entity.id` values for expected combinations of identity and secret value access. If this is an expected behavior, consider adding exceptions to the rule.
5756
- False positives may occur due to the intended usage of the service. Tuning is needed in order to have higher confidence. Consider adding exceptions — preferably with a combination of user agent and IP address conditions.
5857
5958
### Response and remediation
@@ -101,6 +100,21 @@ event.dataset:aws.cloudtrail and event.provider:secretsmanager.amazonaws.com and
101100
not user_agent.name: ("Chrome" or "Firefox" or "Safari" or "Edge" or "Brave" or "Opera")
102101
'''
103102

103+
[rule.investigation_fields]
104+
field_names = [
105+
"@timestamp",
106+
"user.name",
107+
"user_agent.original",
108+
"source.ip",
109+
"aws.cloudtrail.user_identity.arn",
110+
"aws.cloudtrail.user_identity.type",
111+
"aws.cloudtrail.user_identity.access_key_id",
112+
"event.action",
113+
"event.outcome",
114+
"cloud.account.id",
115+
"cloud.region",
116+
"aws.cloudtrail.request_parameters"
117+
]
104118

105119
[[rule.threat]]
106120
framework = "MITRE ATT&CK"
@@ -122,7 +136,7 @@ reference = "https://attack.mitre.org/tactics/TA0006/"
122136

123137
[rule.new_terms]
124138
field = "new_terms_fields"
125-
value = ["user.id"]
139+
value = ["cloud.account.id", "user.name"]
126140
[[rule.new_terms.history_window_start]]
127141
field = "history_window_start"
128142
value = "now-10d"

rules/integrations/aws/discovery_new_terms_sts_getcalleridentity.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
creation_date = "2024/05/24"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/02/03"
5+
updated_date = "2025/08/19"
66

77
[rule]
88
author = ["Elastic"]
99
description = """
1010
An adversary with access to a set of compromised credentials may attempt to verify that the credentials are valid and
1111
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.
13-
A legitimate user would not need to call this operation as they should know the account they are using.
12+
STS GetCallerIdentity API, which may be an indicator of compromised credentials.
13+
A legitimate user would not need to perform this operation as they should know the account they are using.
1414
"""
1515
false_positives = [
1616
"""
17-
Verify whether the user identity should be using the STS `GetCallerIdentity` API operation.
17+
Verify whether the user identity should be using the STS GetCallerIdentity API.
1818
If known behavior is causing false positives, it can be exempted from the rule.
1919
""",
2020
]
21-
from = "now-60m"
21+
from = "now-6m"
2222
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
23-
interval = "10m"
23+
interval = "5m"
2424
language = "kuery"
2525
license = "Elastic License v2"
2626
name = "AWS STS GetCallerIdentity API Called for the First Time"
@@ -29,13 +29,13 @@ note = """## Triage and analysis
2929
### Investigating AWS STS GetCallerIdentity API Called for the First Time
3030
3131
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.
32+
The `GetCallerIdentity` API returns details about the IAM user or role owning the credentials used to perform the operation.
3333
No permissions are required to run this operation and the same information is returned even when access is denied.
34-
This rule looks for use of the `GetCallerIdentity` operation. This is a [New Terms](https://www.elastic.co/guide/en/security/current/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.
34+
This rule looks for use of the `GetCallerIdentity` API, excluding the `AssumedRole` identity type as use of `GetCallerIdentity` after assuming a role is common practice. This is a [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule indicating the first time a specific user identity has performed this operation.
3535
3636
#### Possible investigation steps
3737
38-
- Identify the account and its role in the environment, a role belonging to a service like Lambda or an EC2 instance would be highly suspicious.
38+
- Identify the account and its role in the environment.
3939
- Identify the applications or users that should use this account.
4040
- Investigate other alerts associated with the account during the past 48 hours.
4141
- Investigate abnormal values in the `user_agent.original` field by comparing them with the intended and authorized usage and historical data. Suspicious user agent values include non-SDK, AWS CLI, custom user agents, etc.
@@ -44,14 +44,13 @@ This rule looks for use of the `GetCallerIdentity` operation. This is a [New Ter
4444
- Considering the source IP address and geolocation of the user who issued the command:
4545
- Do they look normal for the calling user?
4646
- If the source is an EC2 IP address, is it associated with an EC2 instance in one of your accounts or is the source IP from an EC2 instance that's not under your control?
47-
- If it is an authorized EC2 instance, is the activity associated with normal behavior for the instance role or roles? Are there any other alerts or signs of suspicious activity involving this instance?
4847
- Review IAM permission policies for the user identity.
4948
- 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.
5049
5150
### False positive analysis
5251
5352
- False positives may occur due to the intended usage of the service. Tuning is needed in order to have higher confidence. Consider adding exceptions — preferably with a combination of user agent and IP address conditions.
54-
- Automation workflows that rely on the results from this API request may also generate false-positives. We recommend adding exceptions related to the `user.name` or `aws.cloudtrail.user_identity.arn` values to ignore these.
53+
- Automation workflows that rely on the results from this API request may also generate false-positives. We recommend adding exceptions related to the `user.id` or `aws.cloudtrail.user_identity.arn` values to ignore these.
5554
5655
### Response and remediation
5756
@@ -75,7 +74,7 @@ This rule looks for use of the `GetCallerIdentity` operation. This is a [New Ter
7574
references = [
7675
"https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html",
7776
"https://www.secureworks.com/research/detecting-the-use-of-stolen-aws-lambda-credentials",
78-
"https://detectioninthe.cloud/ttps/discovery/get_caller_identity/",
77+
"https://detectioninthe.cloud/ttps/discovery/sts_get_caller_identity",
7978
]
8079
risk_score = 47
8180
rule_id = "30fbf4db-c502-4e68-a239-2e99af0f70da"
@@ -104,14 +103,15 @@ event.dataset: "aws.cloudtrail"
104103
field_names = [
105104
"@timestamp",
106105
"user.name",
107-
"source.address",
108-
"aws.cloudtrail.user_identity.type",
109-
"aws.cloudtrail.user_identity.arn",
110106
"user_agent.original",
107+
"source.ip",
108+
"aws.cloudtrail.user_identity.arn",
109+
"aws.cloudtrail.user_identity.type",
110+
"aws.cloudtrail.user_identity.access_key_id",
111111
"event.action",
112112
"event.outcome",
113-
"cloud.region",
114-
"aws.cloudtrail.request_parameters"
113+
"cloud.account.id",
114+
"cloud.region"
115115
]
116116

117117
[[rule.threat]]

rules/integrations/aws/persistence_sts_assume_role_with_new_mfa.toml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/10/25"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/08/20"
66

77

88
[rule]
@@ -14,7 +14,9 @@ While a new MFA device is not always indicative of malicious behavior it should
1414
false_positives = [
1515
"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.",
1616
]
17+
from = "now-6m"
1718
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
19+
interval = "5m"
1820
language = "kuery"
1921
license = "Elastic License v2"
2022
name = "AWS STS AssumeRole with New MFA Device"
@@ -29,10 +31,10 @@ AWS Security Token Service (STS) allows users to assume roles and gain temporary
2931
3032
### Possible investigation steps
3133
32-
- Review the event details in AWS CloudTrail to identify the user who assumed the role, focusing on the user.id field to determine if the user is legitimate and authorized to use the new MFA device.
33-
- Check the serialNumber in the aws.cloudtrail.flattened.request_parameters to verify the registration and legitimacy of the new MFA device associated with the role assumption.
34-
- Investigate the context of the AssumeRole action by examining the event.action field to understand if it was part of a legitimate workflow or an unusual activity.
35-
- Analyze the event.outcome field to confirm the success of the role assumption and cross-reference with any recent changes in user permissions or MFA device registrations.
34+
- Review the event details in AWS CloudTrail to identify the user who assumed the role, focusing on the `user.id` or `aws.cloudtrail.user_identity.arn` field to determine if the user is legitimate and authorized to use the new MFA device.
35+
- Check the serialNumber in `aws.cloudtrail.request_parameters` to verify the registration and legitimacy of the new MFA device associated with the role assumption.
36+
- Investigate the context of the AssumeRole action by examining surrounding events to understand if it was part of a legitimate workflow or an unusual activity.
37+
- Cross-reference with any recent changes in user permissions or MFA device registrations.
3638
- Correlate the event with other logs or alerts to identify any patterns of suspicious behavior, such as multiple role assumptions or changes in MFA devices within a short timeframe.
3739
- Contact the user or relevant team to confirm if the new MFA device registration and role assumption were expected and authorized.
3840
@@ -83,10 +85,27 @@ event.dataset:aws.cloudtrail
8385
and event.provider:sts.amazonaws.com
8486
and event.action:(AssumeRole or AssumeRoleWithSAML or AssumeRoleWithWebIdentity)
8587
and event.outcome:success
86-
and user.id:*
8788
and aws.cloudtrail.flattened.request_parameters.serialNumber:*
8889
'''
8990

91+
[rule.investigation_fields]
92+
field_names = [
93+
"@timestamp",
94+
"user.name",
95+
"user_agent.original",
96+
"source.ip",
97+
"aws.cloudtrail.user_identity.arn",
98+
"aws.cloudtrail.user_identity.type",
99+
"aws.cloudtrail.user_identity.access_key_id",
100+
"aws.cloudtrail.resources.arn",
101+
"aws.cloudtrail.resources.type",
102+
"event.action",
103+
"event.outcome",
104+
"cloud.account.id",
105+
"cloud.region",
106+
"aws.cloudtrail.request_parameters",
107+
"aws.cloudtrail.response_elements"
108+
]
90109

91110
[[rule.threat]]
92111
framework = "MITRE ATT&CK"
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
[metadata]
2+
creation_date = "2025/07/24"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/07/24"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This rule detects the execution of multiple base64 decoding commands to decode data. multi-decoded
11+
data is suspicious, and may be used by attackers to obfuscate malicious payloads or commands.
12+
"""
13+
from = "now-9m"
14+
index = ["logs-endpoint.events.process*"]
15+
language = "eql"
16+
license = "Elastic License v2"
17+
name = "Multi-Base64 Decoding Attempt from Suspicious Location"
18+
risk_score = 21
19+
rule_id = "03d856c2-7f74-4540-a530-e20af5e39789"
20+
setup = """## Setup
21+
22+
This rule requires data coming in from Elastic Defend.
23+
24+
### Elastic Defend Integration Setup
25+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
26+
27+
#### Prerequisite Requirements:
28+
- Fleet is required for Elastic Defend.
29+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
30+
31+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
32+
- Go to the Kibana home page and click "Add integrations".
33+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
34+
- Click "Add Elastic Defend".
35+
- Configure the integration name and optionally add a description.
36+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
37+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
38+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
39+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
40+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
41+
- Click "Save and Continue".
42+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
43+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
44+
"""
45+
severity = "low"
46+
tags = [
47+
"Domain: Endpoint",
48+
"OS: Linux",
49+
"Use Case: Threat Detection",
50+
"Tactic: Defense Evasion",
51+
"Tactic: Execution",
52+
"Data Source: Elastic Defend",
53+
]
54+
type = "eql"
55+
query = '''
56+
sequence by process.parent.entity_id with maxspan=3s
57+
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.executable != null and
58+
process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and
59+
// Only including potentially suspicious locations
60+
process.args like~ ("-d*", "--d*") and process.working_directory like (
61+
"/tmp/*", "/var/tmp*", "/dev/shm/*", "/var/www/*", "/home/*", "/root/*"
62+
) and not (
63+
process.parent.executable in (
64+
"/usr/share/ec2-instance-connect/eic_curl_authorized_keys", "/etc/cron.daily/vivaldi",
65+
"/etc/cron.daily/opera-browser"
66+
) or
67+
process.working_directory like (
68+
"/opt/microsoft/omsagent/plugin", "/opt/rapid7/ir_agent/*", "/tmp/newroot/*"
69+
)
70+
)]
71+
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.executable != null and
72+
process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and
73+
process.args like~ ("-d*", "--d*")]
74+
'''
75+
76+
[[rule.threat]]
77+
framework = "MITRE ATT&CK"
78+
79+
[rule.threat.tactic]
80+
name = "Defense Evasion"
81+
id = "TA0005"
82+
reference = "https://attack.mitre.org/tactics/TA0005/"
83+
84+
[[rule.threat.technique]]
85+
name = "Obfuscated Files or Information"
86+
id = "T1027"
87+
reference = "https://attack.mitre.org/techniques/T1027/"
88+
89+
[[rule.threat.technique]]
90+
name = "Deobfuscate/Decode Files or Information"
91+
id = "T1140"
92+
reference = "https://attack.mitre.org/techniques/T1140/"
93+
94+
[[rule.threat]]
95+
framework = "MITRE ATT&CK"
96+
97+
[rule.threat.tactic]
98+
name = "Execution"
99+
id = "TA0002"
100+
reference = "https://attack.mitre.org/tactics/TA0002/"
101+
102+
[[rule.threat.technique]]
103+
id = "T1059"
104+
name = "Command and Scripting Interpreter"
105+
reference = "https://attack.mitre.org/techniques/T1059/"
106+
107+
[[rule.threat.technique.subtechnique]]
108+
name = "Unix Shell"
109+
id = "T1059.004"
110+
reference = "https://attack.mitre.org/techniques/T1059/004/"
111+
112+
[[rule.threat.technique]]
113+
name = "User Execution"
114+
id = "T1204"
115+
reference = "https://attack.mitre.org/techniques/T1204/"
116+
117+
[[rule.threat.technique.subtechnique]]
118+
name = "Malicious File"
119+
id = "T1204.002"
120+
reference = "https://attack.mitre.org/techniques/T1204/002/"

rules/macos/command_and_control_unusual_network_connection_to_suspicious_web_service.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/03/26"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/04/07"
5+
updated_date = "2025/08/26"
66

77
[rule]
88
author = ["Elastic"]
@@ -164,7 +164,10 @@ destination.domain : (
164164
i.imgur.com or
165165
the.earth.li or
166166
*.trycloudflare.com
167-
)
167+
) and
168+
not (destination.domain : (*.sharepoint.com or *.azurewebsites.net or "onedrive.live.com" or *.b-cdn.net or api.onedrive.com or "drive.google.com" or *.blogspot.com) and process.code_signature.subject_name:(*Microsoft* or "Software Signing" or "Apple Mac OS Application Signing" or *VMware*) and process.code_signature.trusted:true) and
169+
not (process.code_signature.subject_name:(*Mozilla* or *Google* or *Brave* or *Opera* or "Software Signing" or *Zscaler* or *Browser*) and process.code_signature.trusted:true) and
170+
not (destination.domain :("discord.com" or cdn.discordapp.com or "content.dropboxapi.com" or "dl.dropboxusercontent.com") and process.code_signature.subject_name :(*Discord* or *Dropbox*) and process.code_signature.trusted:true)
168171
'''
169172

170173
[[rule.threat]]
@@ -191,4 +194,4 @@ value = ["host.id", "process.executable", "destination.domain"]
191194

192195
[[rule.new_terms.history_window_start]]
193196
field = "history_window_start"
194-
value = "now-7d"
197+
value = "now-7d"

0 commit comments

Comments
 (0)