Skip to content

Commit 76c5262

Browse files
imays11tradebot-elastic
authored andcommitted
[Rule Tuning] AWS STS GetCallerIdentity API Called for the First Time (#4995)
* [Rule Tuning] AWS STS GetCallerIdentity API Called for the First Time Rule is executing as expected with no troubling alerts in telemetry. For tuning I've: - reduced the execution window - removed MD from description and FP as it's not supported in Kibana UI - edited some of the language of IG to speak about the exclusion of AssumedRoles - edited the highlighted fields for consistency across AWS rules * updated broken link updated broken reference link (cherry picked from commit df179f0)
1 parent 5d157c7 commit 76c5262

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

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]]

0 commit comments

Comments
 (0)