AWS IAM AdministratorAccess Policy Attached to User

Last updated a month ago on 2025-07-16
Created a year ago on 2024-05-30

About

An adversary with access to a set of compromised credentials may attempt to persist or escalate privileges by attaching additional permissions to compromised user accounts. This rule looks for use of the IAM `AttachUserPolicy` API operation to attach the highly permissive `AdministratorAccess` AWS managed policy to an existing IAM user.
Tags
Domain: CloudData Source: AWSData Source: Amazon Web ServicesData Source: AWS IAMUse Case: Identity and Access AuditTactic: Privilege EscalationTactic: PersistenceLanguage: esql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Privilege Escalation (TA0004)(opens in a new tab or window)

Persistence (TA0003)(opens in a new tab or window)

False Positive Examples
While this can be normal behavior, it should be investigated to ensure validity. Verify whether the user identity should be using the IAM `AttachUserPolicy` API operation to attach the `AdministratorAccess` policy to the target user.
License
Elastic License v2(opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

aws(opens in a new tab or window)

Query
from logs-aws.cloudtrail-* metadata _id, _version, _index

| where
  event.provider == "iam.amazonaws.com"
  and event.action == "AttachUserPolicy"
  and event.outcome == "success"

// Extract policy name and user name from request parameters
| dissect aws.cloudtrail.request_parameters
    "{%{?policyArn}=%{?arn}:%{?aws}:%{?iam}::%{?aws}:%{?policy}/%{Esql.aws_cloudtrail_request_parameters_policy_name},%{?userName}=%{Esql_priv.aws_cloudtrail_request_parameters_target_user_name}}"

// Filter for AdministratorAccess policy
| where Esql.aws_cloudtrail_request_parameters_policy_name == "AdministratorAccess"

// keep ECS and parsed fields
| keep
    @timestamp,
    cloud.region,
    event.provider,
    event.action,
    event.outcome,
    Esql.aws_cloudtrail_request_parameters_policy_name,
    Esql_priv.aws_cloudtrail_request_parameters_target_user_name,
    aws.cloudtrail.request_parameters,
    aws.cloudtrail.user_identity.arn,
    related.user,
    user_agent.original,
    user.name,
    source.address

Install detection rules in Elastic Security

Detect AWS IAM AdministratorAccess Policy Attached to User in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).