Detection rules › Splunk
AWS IAM Assume Role Policy Brute Force
The following analytic detects multiple failed attempts to assume an AWS IAM role, indicating a potential brute force attack. It leverages AWS CloudTrail logs to identify MalformedPolicyDocumentException errors with a status of failure and filters out legitimate AWS services. This activity is significant as repeated failures to assume roles can indicate an adversary attempting to guess role names, which is a precursor to unauthorized access. If confirmed malicious, this could lead to unauthorized access to AWS resources, potentially compromising sensitive data and services.
Known false positives
- This detection will require tuning to provide high fidelity detection capabilties. Tune based on src addresses (corporate offices, VPN terminations) or by groups of users.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Credential Access | |
| Discovery |
Rule body
name: AWS IAM Assume Role Policy Brute Force
id: f19e09b0-9308-11eb-b7ec-acde48001122
version: 10
creation_date: '2021-04-06'
modification_date: '2026-05-13'
author: Michael Haag, Splunk
status: production
type: TTP
description: The following analytic detects multiple failed attempts to assume an AWS IAM role, indicating a potential brute force attack. It leverages AWS CloudTrail logs to identify `MalformedPolicyDocumentException` errors with a status of `failure` and filters out legitimate AWS services. This activity is significant as repeated failures to assume roles can indicate an adversary attempting to guess role names, which is a precursor to unauthorized access. If confirmed malicious, this could lead to unauthorized access to AWS resources, potentially compromising sensitive data and services.
data_source:
- AWS CloudTrail
search: |-
`cloudtrail` (errorCode=MalformedPolicyDocumentException) status=failure (userAgent!=*.amazonaws.com)
| rename user_name as user
| stats count min(_time) as firstTime max(_time) as lastTime values(requestParameters.policyName) as policy_name
BY src, user, vendor_account
vendor_region, vendor_product, signature,
dest, errorCode
| where count >= 2
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `aws_iam_assume_role_policy_brute_force_filter`
how_to_implement: The Splunk AWS Add-on and Splunk App for AWS is required to utilize this data. The search requires AWS CloudTrail logs. Set the `where count` greater than a value to identify suspicious activity in your environment.
known_false_positives: This detection will require tuning to provide high fidelity detection capabilties. Tune based on src addresses (corporate offices, VPN terminations) or by groups of users.
references:
- https://www.praetorian.com/blog/aws-iam-assume-role-vulnerabilities/
- https://rhinosecuritylabs.com/aws/assume-worst-aws-assume-role-enumeration/
- https://www.elastic.co/guide/en/security/current/aws-iam-brute-force-of-assume-role-policy.html
finding:
title: User $user$ has caused multiple failures with errorCode $errorCode$, which potentially means adversary is attempting to identify a role name.
entity:
field: user
type: user
score: 50
threat_objects:
- field: src
type: ip_address
analytic_story:
- AWS IAM Privilege Escalation
asset_type: AWS Account
mitre_attack_id:
- T1580
- T1110
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: cloud
security_domain: access
Stages and Predicates
Stage 1: search
`cloudtrail` (errorCode=MalformedPolicyDocumentException) status=failure (userAgent!=*.amazonaws.com)
Stage 2: rename
| rename user_name as user
Stage 3: stats
| stats count min(_time) as firstTime max(_time) as lastTime values(requestParameters.policyName) as policy_name
BY src, user, vendor_account
vendor_region, vendor_product, signature,
dest, errorCode
Stage 4: where
| where count >= 2
Stage 5: search
| `security_content_ctime(firstTime)`
Stage 6: search
| `security_content_ctime(lastTime)`
Stage 7: search
| `aws_iam_assume_role_policy_brute_force_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
count | ge |
| field:"count" kind:ge value:"2" |
errorCode | eq |
| field:"aws::errorCode" kind:eq value:"MalformedPolicyDocumentException" |
sourcetype | eq |
| field:"sourcetype" kind:eq value:"aws:cloudtrail" |
status | eq |
| field:"status" kind:eq value:"failure" |
userAgent | ne |
| field:"userAgent" kind:ne value:"*.amazonaws.com" |