AWS IAM Customer Managed Policy Version Created or Default Version Set
Description
Identifies successful IAM API calls that create a new customer managed policy version or set the default version for an
existing customer managed policy. Attackers with iam:CreatePolicyVersion or iam:SetDefaultPolicyVersion on a
privileged policy can introduce a permissive policy document and activate it, escalating effective permissions without
attaching a new policy. These APIs are high impact when the target policy is attached to powerful roles or users.
Query · kuery
event.dataset: "aws.cloudtrail"
and event.provider: "iam.amazonaws.com"
and event.action: ("CreatePolicyVersion" or "SetDefaultPolicyVersion")
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and not aws.cloudtrail.user_identity.arn:arn*/terraform
and not source.as.organization.name:(Amazon* or AMAZON* or "Google LLC" or "MongoDB, Inc.")
and not source.address: ( "cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com")
Investigation fields
Pivot points the source recommends for triage.
@timestampuser.nameuser_agent.originalsource.ipaws.cloudtrail.user_identity.arnaws.cloudtrail.user_identity.typeaws.cloudtrail.user_identity.access_key_idaws.cloudtrail.resources.arnaws.cloudtrail.resources.typeevent.actionevent.outcomecloud.account.idcloud.regionaws.cloudtrail.request_parametersaws.cloudtrail.response_elements
Known false positives
- Infrastructure-as-code, CI/CD, and IAM administrators routinely publish new policy versions or roll back defaults. Validate the policy ARN, change tickets, and whether the policy document broadens permissions. Exclude automation roles or pipelines after review.
Analyst notes
Investigating AWS IAM Customer Managed Policy Version Created or Default Version Set
CreatePolicyVersion uploads a new immutable version of a customer managed policy. SetDefaultPolicyVersion switches
which version principals evaluate—immediately changing effective access if the policy is already attached.
Possible investigation steps
- From
aws.cloudtrail.request_parameters, extractpolicyArn,policyDocument(if present), andsetAsDefault. - Map the policy ARN to attached users, groups, and roles; prioritize policies attached to admin or break-glass roles.
- Compare the new or selected version to prior versions in IAM or version history for added
Action/Resourcewildcards. - Review
aws.cloudtrail.user_identity.arn,source.ip, anduser_agent.originalfor interactive vs automation context. - Correlate with
AttachUserPolicy,AttachRolePolicy, orCreatePolicyVersionspikes from the same principal.
False positive analysis
- Planned policy releases and rollbacks are expected in mature shops; baseline known publishers.
Response and remediation
- If malicious: set default to a known-good version, delete bad versions where supported, detach policy if necessary, and
revoke excess
iam:*on the actor.