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
[Rule Tuning] AWS IAM Assume Role Policy Update (#4799)
* [Rule Tuning] AWS IAM Assume Role Policy Update
- changed time window to have only 1 minute lookback
- changed the new terms field to look at combination of cloud.account.id, user.name, and roleName. This is to account for the problem with using user_identity.arn for AssumedRoles. Roles are identities in AWS that are granted a set of permissions and can then be assumed by various users across many different sessions. Each of these sessions is designated a session name which is attached to the `user_identity.arn`. This means that each time a Role is assumed, there is a unique user_identity.arn created. This rule is meant to capture unique instances of the Role itself which is captured separate from the individual session names in the `user.name` field. `cloud.account.id` has been added to the new_terms fields to account for organizations with multiple AWS account ids, which may reuse certain user.names across accounts.
This may improve performance especially in environments where there are many users assuming the same role and updating it's trust policy as a part of normal operations.
* remove markdown from description
Copy file name to clipboardExpand all lines: rules/integrations/aws/privilege_escalation_iam_update_assume_role_policy.toml
+30-16Lines changed: 30 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,20 @@
2
2
creation_date = "2020/07/06"
3
3
integration = ["aws"]
4
4
maturity = "production"
5
-
updated_date = "2025/01/27"
5
+
updated_date = "2025/06/12"
6
6
7
7
[rule]
8
8
author = ["Elastic"]
9
9
description = """
10
-
Identifies AWS CloudTrail events where an IAM role's trust policy has been updated. The trust policy is a JSON document
11
-
that defines which principals are allowed to assume the role. An attacker may attempt to modify this policy to gain the
12
-
privileges of the role. This is a [New
13
-
Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule, which means it
14
-
will only trigger once for each unique value of the `aws.cloudtrail.user_identity.arn` and
15
-
`aws.cloudtrail.flattened.request_parameters.roleName` fields that has not been seen making this API request within the
16
-
last 14 days.
10
+
Identifies AWS CloudTrail events where an IAM role's trust policy has been updated by an IAM user or Assumed Role identity. The trust policy is a JSON document that defines which principals are allowed to assume the role. An attacker may attempt to modify this policy to gain the privileges of the role. This is a New Terms rule, which means it will only trigger once for each unique combination of the "cloud.account.id", "user.name" and "aws.cloudtrail.flattened.request_parameters.roleName" fields, that have not been seen making this API request within the last 14 days.
17
11
"""
18
12
false_positives = [
19
13
"""
20
-
Verify whether the user identity, user agent, and/or hostname should be making changes in your environment. Policy
21
-
updates from unfamiliar users or hosts should be investigated. If known behavior is causing false positives, it can
22
-
be exempted from the rule.
14
+
Verify whether the user identity should be making changes in your environment. Policy updates from unfamiliar users should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
23
15
""",
24
16
]
25
-
from = "now-9m"
17
+
from = "now-6m"
18
+
interval = "5m"
26
19
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
27
20
language = "kuery"
28
21
license = "Elastic License v2"
@@ -37,7 +30,8 @@ The role trust policy is a JSON document in which you define the principals you
37
30
38
31
#### Possible investigation steps
39
32
40
-
- Review the `aws.cloudtrail.user_identity.arn` field to determine the user identity that performed the action.
33
+
- Review the `aws.cloudtrail.user_identity.arn` to determine the IAM User that performed the action.
34
+
- If an AssumedRole identity type performed the action review the `aws.cloudtrail.user_identity.session_context.session_issuer.arn` field to determine which role was used.
41
35
- Review the `aws.cloudtrail.flattened.request_parameters.roleName` field to confirm the role that was updated.
42
36
- Within the `aws.cloudtrail.request_parameters` field, review the `policyDocument` to understand the changes made to the trust policy.
43
37
- If `aws.cloudtrail.user_identity.access_key_id` is present, investigate the access key used to perform the action as it may be compromised.
0 commit comments