Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
creation_date = "2024/05/24"
integration = ["aws"]
maturity = "production"
updated_date = "2025/02/03"
updated_date = "2025/08/19"

[rule]
author = ["Elastic"]
description = """
An adversary with access to a set of compromised credentials may attempt to verify that the credentials are valid and
determine what account they are using. This rule looks for the first time an identity has called the
STS `GetCallerIdentity` API operation in the last 15 days, which may be an indicator of compromised credentials.
A legitimate user would not need to call this operation as they should know the account they are using.
STS GetCallerIdentity API, which may be an indicator of compromised credentials.
A legitimate user would not need to perform this operation as they should know the account they are using.
"""
false_positives = [
"""
Verify whether the user identity should be using the STS `GetCallerIdentity` API operation.
Verify whether the user identity should be using the STS GetCallerIdentity API.
If known behavior is causing false positives, it can be exempted from the rule.
""",
]
from = "now-60m"
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
interval = "10m"
interval = "5m"
language = "kuery"
license = "Elastic License v2"
name = "AWS STS GetCallerIdentity API Called for the First Time"
Expand All @@ -29,13 +29,13 @@ note = """## Triage and analysis
### Investigating AWS STS GetCallerIdentity API Called for the First Time

AWS Security Token Service (AWS STS) is a service that enables you to request temporary, limited-privilege credentials for users.
The `GetCallerIdentity` function returns details about the IAM user or role owning the credentials used to call the operation.
The `GetCallerIdentity` API returns details about the IAM user or role owning the credentials used to perform the operation.
No permissions are required to run this operation and the same information is returned even when access is denied.
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.
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.

#### Possible investigation steps

- 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.
- Identify the account and its role in the environment.
- Identify the applications or users that should use this account.
- Investigate other alerts associated with the account during the past 48 hours.
- 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.
Expand All @@ -44,14 +44,13 @@ This rule looks for use of the `GetCallerIdentity` operation. This is a [New Ter
- Considering the source IP address and geolocation of the user who issued the command:
- Do they look normal for the calling user?
- 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?
- 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?
- Review IAM permission policies for the user identity.
- 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.

### False positive analysis

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

### Response and remediation

Expand All @@ -75,7 +74,7 @@ This rule looks for use of the `GetCallerIdentity` operation. This is a [New Ter
references = [
"https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html",
"https://www.secureworks.com/research/detecting-the-use-of-stolen-aws-lambda-credentials",
"https://detectioninthe.cloud/ttps/discovery/get_caller_identity/",
"https://detectioninthe.cloud/ttps/discovery/sts_get_caller_identity",
]
risk_score = 47
rule_id = "30fbf4db-c502-4e68-a239-2e99af0f70da"
Expand Down Expand Up @@ -104,14 +103,15 @@ event.dataset: "aws.cloudtrail"
field_names = [
"@timestamp",
"user.name",
"source.address",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.arn",
"user_agent.original",
"source.ip",
"aws.cloudtrail.user_identity.arn",
"aws.cloudtrail.user_identity.type",
"aws.cloudtrail.user_identity.access_key_id",
"event.action",
"event.outcome",
"cloud.region",
"aws.cloudtrail.request_parameters"
"cloud.account.id",
"cloud.region"
]

[[rule.threat]]
Expand Down
Loading