AWS IAM Privilege Escalation via AdministratorAccess Policy Attachment to Group
An adversary with compromised AWS credentials may escalate privileges or establish persistence by attaching the AWS-managed AdministratorAccess policy to an IAM group using the AttachGroupPolicy API call, granting full administrative privileges across all AWS services to all group members.
Triage facts
Revision 2- Evidence
- Unknown
- Severity
- Medium
- Sources
- 3 public sources
- Freshness
- Revision 2Jan 2, 12:00 UTC
- Detection
- 2 rules
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
This alert focuses on a privilege escalation and persistence technique in AWS environments. An attacker who has gained initial access with compromised credentials may attempt to broaden their access by attaching the AWS-managed AdministratorAccess policy to an existing IAM group. This is achieved through the AttachGroupPolicy API operation. The AdministratorAccess policy grants full administrative privileges across all AWS services. If successful, all members of the group inherit these privileges, potentially leading to widespread compromise of the AWS environment. This activity is detected through AWS CloudTrail logs, which record API calls made within the AWS environment. Defenders should monitor for unexpected attachments of the AdministratorAccess policy to IAM groups, especially if the calling identity is unusual or the group contains sensitive accounts.
Attack Chain
- Initial Access: The attacker gains initial access to the AWS environment through compromised IAM user credentials.
- Discovery: The attacker enumerates existing IAM groups using AWS CLI or API calls such as
ListGroups. - Target Selection: The attacker identifies a target IAM group to which they can attach the
AdministratorAccesspolicy. - Privilege Check: The attacker verifies they have the
iam:AttachGroupPolicypermission for the target group. - Policy Attachment: The attacker executes the
AttachGroupPolicyAPI operation, specifying the ARN of theAdministratorAccesspolicy and the name of the target IAM group. - Verification: The attacker verifies the policy attachment by using the
GetGroupPolicyAPI operation or AWS CLI. - Privilege Exploitation: The attacker, or other members of the compromised group, leverage the newly acquired administrative privileges to access sensitive data, modify configurations, or perform other malicious actions.
- Persistence: The attacker maintains persistent access by ensuring the
AdministratorAccesspolicy remains attached to the group, even if their initial access method is revoked.
Impact
Successful exploitation can result in complete compromise of the AWS environment. The attacker gains full control over all AWS services and resources. This includes the ability to access sensitive data stored in S3 buckets, modify EC2 instances, create or delete IAM users and roles, and disrupt critical services. The widespread nature of the AdministratorAccess policy means that a single successful attachment can lead to cascading failures and significant financial losses.
Recommendation
- Deploy the following Sigma rule to detect the attachment of the
AdministratorAccesspolicy to IAM groups via CloudTrail logs. - Review IAM group memberships and associated policies regularly to enforce the principle of least privilege.
- Use AWS IAM Access Analyzer to identify unintended access to AWS resources.
- Implement Service Control Policies (SCPs) to restrict the attachment of highly permissive policies like
AdministratorAccessat the organizational level. - Investigate any
AttachGroupPolicyevents where the user identity (aws.cloudtrail.user_identity.arn) is not expected to be performing this action. - Detach the
AdministratorAccesspolicy from any affected groups (aws iam detach-group-policy) as a containment measure.
Detection coverage 2
AWS IAM AdministratorAccess Policy Attached to Group
mediumDetects when the AWS-managed AdministratorAccess policy is attached to an IAM group, potentially indicating privilege escalation or persistence attempts.
AWS IAM Group Modification Events
lowDetects potentially malicious modifications to IAM groups.
Detection queries are available on the platform. Get full rules →