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
event.category:file and event.type:change and file.path:(/etc/sudoers* or /private/etc/sudoers*) and
36
-
not process.name:(dpkg or platform-python or puppet or yum or dnf) and
37
-
not process.executable:(/opt/chef/embedded/bin/ruby or /opt/puppetlabs/puppet/bin/ruby or /usr/bin/dockerd)
34
+
file where host.os.type in ("linux", "macos") and event.type in ("creation", "change") and
35
+
file.path like ("/etc/sudoers*", "/private/etc/sudoers*") and not (
36
+
process.name in ("dpkg", "platform-python", "puppet", "yum", "dnf") or
37
+
process.executable in ("/opt/chef/embedded/bin/ruby", "/opt/puppetlabs/puppet/bin/ruby", "/usr/bin/dockerd")
38
+
)
38
39
'''
39
40
note = """## Triage and analysis
40
41
@@ -71,30 +72,20 @@ The sudoers file is crucial in Unix-like systems, defining user permissions for
71
72
- Implement additional monitoring on the affected system and similar systems to detect any further attempts to modify the sudoers file or other privilege escalation activities.
72
73
- Review and update security policies and configurations to prevent similar incidents, ensuring that only authorized processes can modify the sudoers file."""
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