How the attack works
Managed policies are attached to IAM users, groups and roles with AttachUserPolicy, AttachGroupPolicy and AttachRolePolicy. A principal allowed to call these on itself, on a group it belongs to, or on a role it can assume can grant itself any managed policy, including the AWS managed AdministratorAccess (every action on every resource) or IAMFullAccess (every IAM action, which leads to administrator in one more step). Short of administrator rights, PowerUserAccess gives full access to AWS services except the management of users and groups, and the AWS managed policies whose name ends with FullAccess give full access to one service each.
This is one of the most direct AWS privilege escalation paths, and it also serves persistence: an attacker adds administrator rights to a quiet user or role and returns later. CloudTrail records the caller in userIdentity, the target in requestParameters.userName, groupName or roleName, and the policy in requestParameters.policyArn.
What an attacker needs
- Credentials for a principal allowed to call iam:AttachUserPolicy, AttachGroupPolicy or AttachRolePolicy on a target it controls or can use.
- No permissions boundary or service control policy that caps the target's effective permissions.
Impact
Administrator access to the account through an identity the attacker controls, which can then be used to create further credentials, disable logging and reach data in every service.
Detection rules
AdministratorAccess or IAMFullAccess Attached to an IAM Identity
Detects AttachUserPolicy, AttachGroupPolicy and AttachRolePolicy calls whose policyArn ends with AdministratorAccess or IAMFullAccess (the AWS managed policies in any partition, and customer policies with the same name). It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: AdministratorAccess or IAMFullAccess Attached to an IAM Identity
id: 521e23cd-b034-4c6b-a9ab-c741632e232b
status: experimental
description: >-
Detects AttachUserPolicy, AttachGroupPolicy and AttachRolePolicy calls whose
policyArn ends with AdministratorAccess or IAMFullAccess (the AWS managed
policies in any partition, and customer policies with the same name).
It also matches attempts that failed (errorCode present): check errorCode,
because an unauthorized attempt is worth seeing.
references:
- https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AdministratorAccess.html
- https://docs.aws.amazon.com/aws-managed-policy/latest/reference/IAMFullAccess.html
- https://docs.aws.amazon.com/IAM/latest/APIReference/API_AttachUserPolicy.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/cloudwatch-controls.html
author: Forestall
date: 2026-11-10
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: iam.amazonaws.com
eventName:
- AttachUserPolicy
- AttachGroupPolicy
- AttachRolePolicy
requestParameters.policyArn|endswith:
- ':policy/AdministratorAccess'
- ':policy/IAMFullAccess'
condition: selection
falsepositives:
- Provisioning of administrator and break-glass roles by the identity team or infrastructure-as-code pipelines; allow-list those callers and review each new target.
level: high
False positives
- Provisioning of administrator and break-glass roles by the identity team or infrastructure-as-code pipelines; allow-list those callers and review each new target.
AWS Managed FullAccess or PowerUserAccess Policy Attached to an IAM Identity
Detects AttachUserPolicy, AttachGroupPolicy and AttachRolePolicy calls that attach an AWS managed policy whose name ends with FullAccess, or PowerUserAccess. PowerUserAccess gives full access to AWS services and resources without the management of users and groups, and a FullAccess policy gives full access to one service, for example AmazonSESFullAccess for Amazon SES. An attacker who wants one service, such as mail sending, compute or secrets, attaches the policy for that service and stays below an alert that only watches AdministratorAccess. The match is on the ARN of AWS managed policies (the ARN contains iam::aws:policy/), so customer managed policies are not covered. IAMFullAccess matches this rule and the administrator rule on this page. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: AWS Managed FullAccess or PowerUserAccess Policy Attached to an IAM Identity
id: 457f066f-cbbf-486c-ad20-fbad6afb00e7
status: experimental
description: >-
Detects AttachUserPolicy, AttachGroupPolicy and AttachRolePolicy calls that
attach an AWS managed policy whose name ends with FullAccess, or
PowerUserAccess. PowerUserAccess gives full access to AWS services and
resources without the management of users and groups, and a FullAccess
policy gives full access to one service, for example AmazonSESFullAccess
for Amazon SES. An attacker who wants one service, such as mail sending,
compute or secrets, attaches the policy for that service and stays below
an alert that only watches AdministratorAccess. The match is on the ARN of
AWS managed policies (the ARN contains iam::aws:policy/), so customer
managed policies are not covered. IAMFullAccess matches this rule and the
administrator rule on this page.
It also matches attempts that failed (errorCode present): check errorCode,
because an unauthorized attempt is worth seeing.
references:
- https://docs.aws.amazon.com/aws-managed-policy/latest/reference/PowerUserAccess.html
- https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonSESFullAccess.html
- https://docs.aws.amazon.com/IAM/latest/APIReference/API_AttachUserPolicy.html
- https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: iam.amazonaws.com
eventName:
- AttachUserPolicy
- AttachGroupPolicy
- AttachRolePolicy
requestParameters.policyArn|contains: ':iam::aws:policy/'
selection_name:
requestParameters.policyArn|endswith:
- 'FullAccess'
- '/PowerUserAccess'
condition: selection and selection_name
falsepositives:
- Provisioning of service roles and team roles by the identity team, infrastructure-as-code pipelines and service consoles that attach a FullAccess policy for you. Add those callers to a filter_* selection on userIdentity.arn, or narrow the list to the services that matter in the account.
level: medium
False positives
- Provisioning of service roles and team roles by the identity team, infrastructure-as-code pipelines and service consoles that attach a FullAccess policy for you. Add those callers to a filter_* selection on userIdentity.arn, or narrow the list to the services that matter in the account.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Identity attaches a policy to itself, then succeeds at calls it was denied just before
An attacker with stolen credentials tries what they want, is denied, attaches a policy to their own user, to a group they belong to or to the role they are using, and repeats the calls. The pair "denied before, allowed after" for the same principal and the same call, around an attachment to itself, is the trace of a self-escalation. It also finds customer managed policies, which the rules of this page do not name.
- An
AttachUserPolicy,AttachGroupPolicyorAttachRolePolicyevent fromiam.amazonaws.comwhose target is the caller:requestParameters.userNameequal touserIdentity.userName,requestParameters.roleNameequal touserIdentity.sessionContext.sessionIssuer.userName, or a group the caller belongs to. - In the hour before the attachment, events of the same
userIdentity.arnwhoseerrorCodecontains AccessDenied or UnauthorizedOperation. - In the hour after it, events of the same
userIdentity.arnwith the sameeventSourceandeventNameand noerrorCode. - Alert when at least one call that was denied before the attachment succeeds after it, and list what the newly allowed calls did.
EventsAttachUserPolicyAttachGroupPolicyAttachRolePolicy
LimitsAn administrator who fixes a missing permission of an application produces the same pair, usually for one call and from a known pipeline. Group membership has to be read from IAM or from earlier AddUserToGroup events. Inline policies and new default policy versions grant permissions the same way and can be joined the same way. The one hour windows are starting points.
Triage
- Compare the caller (userIdentity.arn) with the target named in requestParameters; an identity attaching administrator rights to itself, its own group or a role it can assume is the strongest signal.
- Check errorCode; failed attempts show reconnaissance of the caller's permissions.
- Review what the target identity did after the attachment, and detach the policy if the change is not approved.
Response
Once the attack is confirmed:
- Detach the policy from the user, group or role named in the event. Permissions are evaluated on every request, so sessions of that identity that already exist lose the administrator rights as well.
- Contain the identity that received the policy and the principal that attached it. Deactivate their access keys, and revoke the active sessions of roles, until you know who was using them.
- Find and remove what was created while the administrator rights were in place, such as users, access keys, login profiles, roles, trust policy changes and identity providers. Detaching the policy does not undo any of these.
- Check that logging and threat detection were not changed in the same period, and restore them if they were.
- Take the permission to attach policies away from the caller before its credentials go back into use, and confirm in CloudTrail that no further attachment follows.
Mitigation
- Restrict iam:Attach*Policy to IAM administrators, and limit which policies can be attached with the iam:PolicyARN condition key.
- Set permissions boundaries on users and roles that delegated administrators manage, and deny attaching AdministratorAccess and IAMFullAccess outside approved roles with an SCP.
- Remove wildcard IAM actions (
iam:*) from customer-managed policies so that ordinary principals cannot change policy attachments.
Frequently asked questions
Does the rule catch every way of granting administrator rights in IAM?
No. The administrator rule matches the three attach calls when the policy ARN ends with AdministratorAccess or IAMFullAccess, and a second rule matches AWS managed policies whose name ends with FullAccess, and PowerUserAccess. A customer managed policy with another name that allows every action, an inline policy, a new default version of a policy that is already attached, or a removed permissions boundary reach the same result through other events, and these rules do not match them.
Why is IAMFullAccess treated like AdministratorAccess?
IAMFullAccess allows every IAM action. An identity that holds it can attach AdministratorAccess to itself in a second call, so it is one step away from administrator. The administrator rule therefore treats both attachments as the same kind of event.
What does an attach event with an errorCode tell me?
The call failed, so nothing was attached. It still shows that the caller tried to give an identity administrator rights, which is how someone with stolen credentials tests what they can do. Check who the caller is and whether other IAM calls from the same session failed around the same time.
References
- MITRE ATT&CK T1098.003: Additional Cloud Roles
- AWS managed policy: AdministratorAccess
- AWS managed policy: IAMFullAccess
- IAM API Reference: AttachRolePolicy
- Revoke IAM role temporary security credentials
- Disabling permissions for temporary security credentials
- AWS managed policy: PowerUserAccess
- IAM API Reference: AttachUserPolicy
- IAM API Reference: AttachGroupPolicy
- CloudTrail userIdentity element
- CloudTrail record contents for management, data, and network activity events