-
Notifications
You must be signed in to change notification settings - Fork 573
[Rule Tuning] AWS IAM Assume Role Policy Update #4799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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.
Rule: Tuning - GuidelinesThese guidelines serve as a reminder set of considerations when tuning an existing rule. Documentation and Context
Rule Metadata Checks
Testing and Validation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
rules/integrations/aws/privilege_escalation_iam_update_assume_role_policy.toml
Outdated
Show resolved
Hide resolved
rules/integrations/aws/privilege_escalation_iam_update_assume_role_policy.toml
Show resolved
Hide resolved
rules/integrations/aws/privilege_escalation_iam_update_assume_role_policy.toml
Outdated
Show resolved
Hide resolved
@imays11 - It looks like the session ID persists in |
@terrancedejesus If you look below, session names are persisted in
Yes we want to isolate this to each individual user, for organizations ingesting cloudtrail logs for multiple accounts we need to distinguish between the same user names across accounts so that's why I included the |
Pull Request
Issue link(s):
Summary - What I changed
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 given a session name which is attached to the end of the role's
aws.cloudtrail.user_identity.arn
. This means that each time a Role is assumed, there is a uniqueaws.cloudtrail.user_identity.arn
created.This rule is meant to capture new instances of the Role updating role policies. Right now it's analyzing each session used with the Role, resulting in false positives. To capture the role itself we can use 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.aws.cloudtrail.user_identity.arn
for AssumedRoles.)This will improve performance and detection accuracy especially in environments where there are many users assuming the same role and updating it's trust policy as a part of normal operations.
How To Test
You can use this script to test this rule against both IAM user and Assumed Role Identity types.
For manual testing use an existing user or role to update a new policy (to trigger new_terms combination)