You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rules/integrations/aws/persistence_iam_api_calls_via_user_session_token.toml
+26-10Lines changed: 26 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,19 @@
2
2
creation_date = "2025/04/16"
3
3
integration = ["aws"]
4
4
maturity = "production"
5
-
updated_date = "2025/04/16"
5
+
updated_date = "2025/07/10"
6
6
7
7
[rule]
8
8
author = ["Elastic"]
9
9
description = """
10
-
Detects use of sensitive AWS STS or IAM API operations using temporary credentials (session tokens starting with 'ASIA').
11
-
This may indicate credential theft or abuse of elevated access via a stolen session. It is not common for legitimate users to perform sensitive IAM operations with temporary session tokens.
10
+
Detects use of sensitive AWS IAM API operations using temporary credentials (session tokens starting with 'ASIA'). This may indicate credential theft or abuse of elevated access via a stolen session. It is not common for legitimate users to perform sensitive IAM operations with temporary session tokens.
12
11
"""
13
12
false_positives = [
14
13
"""
15
14
Some CI/CD pipelines or administrative users may use session tokens. Review user context, IP, and timing to validate.
16
15
""",
17
16
]
18
-
from = "now-9m"
17
+
from = "now-6m"
19
18
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
20
19
language = "kuery"
21
20
license = "Elastic License v2"
@@ -29,15 +28,15 @@ This rule detects sensitive IAM API operations performed using temporary AWS cre
29
28
30
29
#### Possible investigation steps:
31
30
32
-
- Review aws.cloudtrail.user_identity.arn to determine which IAM user or assumed role initiated the request.
33
-
- Check aws.cloudtrail.user_identity.access_key_id to confirm if the credential starts with 'ASIA', indicating a temporary session token.
34
-
- Examine aws.cloudtrail.user_identity.session_context.mfa_authenticated to verify whether MFA was present during session creation.
35
-
- Investigate source.ip to assess whether the request originated from a known network, office IP, or corporate VPN.
36
-
- Look at user_agent.original to determine if the API call came from a known CLI version or unexpected tool (e.g., unknown SDK, custom script).
31
+
- Review `aws.cloudtrail.user_identity.arn` to determine which IAM user or assumed role initiated the request.
32
+
- Check `aws.cloudtrail.user_identity.access_key_id` to confirm if the credential starts with 'ASIA', indicating a temporary session token.
33
+
- Examine `aws.cloudtrail.user_identity.session_context.mfa_authenticated` to verify whether MFA was present during session creation.
34
+
- Investigate `source.ip` to assess whether the request originated from a known network, office IP, or corporate VPN.
35
+
- Look at `user_agent.original` to determine if the API call came from a known CLI version or unexpected tool (e.g., unknown SDK, custom script).
37
36
- Confirm whether a recent sts:GetSessionToken, sts:AssumeRole, or AWS SSO login event issued the temporary credential.
38
37
- Correlate other events using the same access key ID to identify additional privileged actions, such as iam:CreateAccessKey, iam:PutUserPolicy, or iam:EnableMFADevice.
39
38
- Analyze timing via @timestamp to determine if the action occurred during off-hours or deviates from normal user behavior.
40
-
- Review the event.outcome to check if the API call was successful or failed, which may indicate unauthorized access attempts.
39
+
- Review the `event.outcome` to check if the API call was successful or failed, which may indicate unauthorized access attempts.
41
40
- Check for related events in the same session, such as iam:CreateUser, iam:AttachUserPolicy, or sts:GetCallerIdentity, to identify potential lateral movement or privilege escalation.
42
41
43
42
### False positive analysis:
@@ -77,10 +76,27 @@ type = "new_terms"
77
76
query = '''
78
77
event.dataset: aws.cloudtrail
79
78
and event.provider: ("iam.amazonaws.com")
79
+
and event.outcome: "success"
80
80
and aws.cloudtrail.user_identity.type: "IAMUser"
81
81
and aws.cloudtrail.user_identity.access_key_id: ASIA*
0 commit comments