[Rule Tuning] AWS IAM Brute Force of Assume Role Policy #5282
+152
−105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue link(s):
Summary - What I changed
Description and primary tactic for this rule is a bit misleading. The rule captures an IAM principal enumeration technique used by tools like PACU, it does not capture AssumeRole brute-force attempts. I've changed the primary tactic to Discover, changed the rule name and updated the rule description and Investigation Guide to more clearly reflect what behavior is being captured.
The query itself remains the same and the threshold values. I changed the execution window to the standard 5 min + 1 min lookback and was still able to capture the behavior.
The TARGET BEHAVIOR
That’s what this rule is seeing: lots of failed
UpdateAssumeRolePolicycalls with bad principals. Stemming from within your account. This activity could be targeting an external account as a form of role enumeration.Reference: PACU iam_enum_roles Module
How To Test
Test data in the stack to run the query against
The existing rule has been updated with the execution window change
Script for triggering the rule: trigger_discovery_iam_principal_enumeration_via_update_assume_role_policy.py
Screenshot of Alerting Rule and Triggering Events