I retrieved all 12 versions of the AWSCompromisedKeyQuarantine policies, which AWS applies to compromised access keys, and compared how the denied actions changed over time. The policy grew from 28 actions to 215 in V4, expanding from EC2 to Bedrock, KMS, ECS, SSM, and more.
A note from the author: I'm not fluent in English, so I asked Kiro, an AI assistant, to translate this post from my original Japanese draft. If anything reads awkwardly, that's on the translation process, not on the content.
Hi everyone. I'm Ichino, a technical support engineer at Serverworks who loves the AWS CLI.
Recently, a customer's access key was misused in an unauthorized-use incident, and it made me take another look at the AWSCompromisedKeyQuarantine policy. The policy gets updated in place, with new versions of the same policy. But AWS also puts a version number in the policy name and publishes a brand-new policy when it makes bigger changes. While looking into this, I noticed that AWSCompromisedKeyQuarantineV4 had been released.
I wondered whether tracing how the denied actions changed from one policy to the next might show which known attack patterns AWS had in mind at each point in time. So I let my imagination run through each policy in turn. In short, this post is a bit of a poem.
Disclaimer #
Everything in this post comes from one of two sources: facts I could retrieve through the AWS API, and my own personal interpretation of why actions were added or removed between policies. This is not an official AWS statement. Please keep that in mind as you read.
What Is the AWSCompromisedKeyQuarantine Policy? #
It is one of the AWS managed policies, but as a user you will almost never attach it yourself or even think about it.
Translated literally, the name means a policy for quarantining (Quarantine) a compromised key (Compromised Key), applied by AWS. The description of the
latest V4 policysays: Description: Denies access to certain actions, applied by AWS in the event that an IAM user's credentials have been compromised or exposed publicly. The policy aims to limit the potential damage that may be caused by fraud-related activity leading to unauthorized charges. Do NOT remove this policy. Instead, please follow the instructions specified in the support case created for you regarding this event. AWSCompromisedKeyQuarantineV4 is an AWS managed policy.
In other words, AWS attaches this special policy to an IAM user when the user's credentials have been compromised or exposed. Its purpose is to suppress fraudulent activity, prevent unauthorized charges, and limit the damage.
My colleague Sumiko Mori at Serverworks has written a detailed article that uses the V3 policy as its example. I recommend reading it alongside this one (the article is in Japanese).
Retrieving Every Version of Every Policy #
The official AWS documentation (the AWS Managed Policy Reference Guide) only shows the current version of each policy document. So I wrote the following script to collect every version.
#!/usr/bin/env bash# Fetch and save every version of every AWSCompromisedKeyQuarantine* policy.# Usage: ./fetch_all_versions.sh [output directory]# Uses AWS_PROFILE if it is set (otherwise the default profile).set -euo pipefailPREFIX="AWSCompromisedKeyQuarantine"OUT_DIR="${1:-./versions}"mkdir -p "$OUT_DIR"# List AWS managed policies whose names start with PREFIX (V5 and later are picked up automatically)policies=$(aws iam list-policies --scope AWS \ --query "Policies[?starts_with(PolicyName, \`${PREFIX}\`)].[PolicyName,Arn]" \ --output text): > "$OUT_DIR/index.tsv"printf 'policy\tversion\tis_default\tcreate_date\n' >> "$OUT_DIR/index.tsv"while IFS=$'\t' read -r name arn; do [ -z "$name" ] && continue echo "== $name" >&2 # List all versions, oldest first aws iam list-policy-versions --policy-arn "$arn" \ --query 'sort_by(Versions,&CreateDate)[].[VersionId,IsDefaultVersion,CreateDate]' \ --output text | while IFS=$'\t' read -r ver is_default created; do aws iam get-policy-version --policy-arn "$arn" --version-id "$ver" \ --query 'PolicyVersion.Document' --output json > "$OUT_DIR/${name}_${ver}.json" printf '%s\t%s\t%s\t%s\n' "$name" "$ver" "$is_default" "$created" >> "$OUT_DIR/index.tsv" echo " $ver ($created) default=$is_default" >&2 donedone <<< "$policies"echo "Done: $OUT_DIR" >&2
Every Policy Version I Collected #
Running the script above saves each version as
<policy name>_<version>.json . I've listed all of them below.
If you really want to see every version, the original Japanese post has all of them: [Quick Tip] A "V4" version of the AWSCompromisedKeyQuarantine policy has appeared—let’s take a look back at its previous iterations.
json{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "cloudtrail:LookupEvents", "ec2:RequestSpotInstances", "ec2:RunInstances", "ec2:StartInstances", "ec2:PurchaseReservedInstancesOffering", "ec2:AcceptReservedInstancesExchangeQuote", "ec2:CreateReservedInstancesListing", "iam:AddUserToGroup", "iam:AttachGroupPolicy", "iam:AttachRolePolicy", "iam:AttachUserPolicy", "iam:ChangePassword", "iam:CreateAccessKey", "iam:CreateInstanceProfile", "iam:CreateLoginProfile", "iam:CreatePolicyVersion", "iam:CreateRole", "iam:CreateUser", "iam:DetachUserPolicy", "iam:PassRole", "iam:PutGroupPolicy", "iam:PutRolePolicy", "iam:PutUserPermissionsBoundary", "iam:PutUserPolicy", "iam:SetDefaultPolicyVersion", "iam:UpdateAccessKey", "iam:UpdateAccountPasswordPolicy", "iam:UpdateAssumeRolePolicy", "iam:UpdateLoginProfile", "iam:UpdateUser", "iam:DeleteRole", "iam:DeleteAccessKey", "iam:ListUsers", "iam:UpdateServiceSpecificCredential", "lambda:AddLayerVersionPermission", "lambda:AddPermission", "lambda:CreateFunction", "lambda:GetPolicy", "lambda:ListTags", "lambda:PutProvisionedConcurrencyConfig", "lambda:TagResource", "lambda:UntagResource", "lambda:UpdateFunctionCode", "lambda:GetEventSourceMapping", "lightsail:Create*", "lightsail:Delete*", "lightsail:DownloadDefaultKeyPair", "lightsail:GetInstanceAccessDetails", "lightsail:Start*", "lightsail:Update*", "organizations:CreateAccount", "organizations:CreateOrganization", "organizations:InviteAccountToOrganization", "organizations:LeaveOrganization", "organizations:AcceptHandshake", "s3:DeleteBucket", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:PutLifecycleConfiguration", "s3:PutBucketAcl", "s3:PutBucketOwnershipControls", "s3:DeleteBucketPolicy", "s3:ObjectOwnerOverrideToBucketOwner", "s3:PutAccountPublicAccessBlock", "s3:PutBucketPolicy", "s3:ListAllMyBuckets", "s3:CreateBucket", "s3:PutBucketCors", "s3:GetObject", "s3:ListBucket", "s3:PutEncryptionConfiguration", "savingsplans:CreateSavingsPlan", "ecs:CreateService", "ecs:CreateCluster", "ecs:RegisterTaskDefinition", "ecr:GetAuthorizationToken", "bedrock:CreateModelInvocationJob", "bedrock:InvokeModelWithResponseStream", "bedrock:CreateFoundationModelAgreement", "bedrock:PutFoundationModelEntitlement", "bedrock:InvokeModel", "sagemaker:CreateEndpointConfig", "sagemaker:CreateProcessingJob", "sts:GetSessionToken", "sts:GetFederationToken", "amplify:CreateDeployment", "amplify:CreateBackendEnvironment", "codebuild:CreateProject", "glue:CreateJob", "sns:GetSMSAttributes", "mediapackagev2:CreateChannel", "logs:PutLogEvents", "xray:CallWithBearerToken", "ssm:SendCommand", "ssm:StartSession", "autoscaling:CreateAutoScalingGroup", "autoscaling:UpdateAutoScalingGroup", "autoscaling:SetDesiredCapacity", "secretsmanager:GetSecretValue", "ssm:GetParameter*", "kms:CreateKey", "kms:CreateAlias", "kms:CreateCustomKeyStore", "kms:Enable*", "kms:Put*", "kms:Update*", "kms:Revoke*", "kms:Disable*", "kms:Delete*", "kms:TagResource", "kms:UntagResource", "kms:Replicate*", "kms:Connect*", "kms:Cancel*", "kms:Retire*", "kms:Schedule*", "kms:Rotate*", "dynamodb:CreateTable", "lambda:InvokeFunction", "ses:Send*", "ses:Create*", "ses:Get*", "ses:List*", "ses:Delete*", "ses:Put*", "ses:Update*", "ses:TagResource", "ses:UntagResource", "ses:Set*", "ses:Describe*", "sns:Publish", "cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "s3:PutBucketVersioning", "s3:PutBucketObjectLockConfiguration", "s3:PutObjectRetention", "s3:PutObjectLegalHold", "backup:DeleteRecoveryPoint", "backup:DeleteBackupVault", "rds:DeleteDBSnapshot", "cloudformation:DeleteStack", "iam:CreateServiceSpecificCredential", "iam:ResetServiceSpecificCredential", "sts:AssumeRole", "ecs:RunTask", "ecs:UpdateService", "apprunner:CreateService", "apprunner:UpdateService", "apprunner:StartDeployment", "apprunner:ResumeService", "apprunner:TagResource", "apprunner:UntagResource", "sagemaker:CreateTrainingJob", "sagemaker:CreateEndpoint", "bedrock-mantle:Create*", "bedrock-mantle:Delete*", "bedrock-mantle:Update*", "bedrock-mantle:Put*", "bedrock-mantle:Cancel*", "bedrock-mantle:Associate*", "bedrock-mantle:Disassociate*", "bedrock-mantle:ArchiveProject", "bedrock-mantle:TagResource", "bedrock-mantle:UntagResource", "aws-marketplace:Subscribe", "aws-marketplace:AcceptAgreementApprovalRequest", "apprunner:DeleteService", "ecs:ExecuteCommand", "ecs:StartTask", "ecs:CreateTaskSet", "ecs:UpdateTaskSet", "ecs:UpdateServicePrimaryTaskSet", "ecs:CreateExpressGatewayService", "ecs:UpdateExpressGatewayService", "ecs:RegisterDaemonTaskDefinition", "ecs:CreateDaemon", "ecs:UpdateDaemon", "application-autoscaling:RegisterScalableTarget", "application-autoscaling:PutScalingPolicy", "sagemaker:CreateNotebookInstance", "sagemaker:CreateTransformJob", "autoscaling:DeleteAutoScalingGroup", "ec2:CreateLaunchTemplateVersion", "ec2:ModifyLaunchTemplate", "sagemaker:CreateCluster", "secretsmanager:PutResourcePolicy", "sagemaker:CreateHyperParameterTuningJob", "sagemaker:CreateCompilationJob", "sagemaker:CreateOptimizationJob", "sagemaker:CreateApp", "sagemaker:CreateMlflowTrackingServer", "sagemaker:CreatePartnerApp", "sagemaker:CreateJob", "ssm:ResumeSession", "lambda:InvokeFunctionUrl", "lambda:InvokeAsync", "ssm:PutParameter", "ssm:DescribeParameters", "ssm:DeleteParameter", "ssm:DeleteParameters", "ssm:PutResourcePolicy", "secretsmanager:TagResource", "secretsmanager:UntagResource", "bedrock-mantle:CallWithBearerToken", "bedrock:CallWithBearerToken", "lambda:CreateFunctionUrlConfig", "lambda:UpdateFunctionUrlConfig", "lambda:CreateEventSourceMapping", "lambda:UpdateEventSourceMapping", "lambda:InvokeWebFunctionEndpoint", "lambda:CreateWebFunction", "lambda:CreateWebFunctionRevision", "lambda:CreateWebFunctionEndpoint", "lambda:UpdateWebFunctionEndpoint" ], "Resource": [ "" ] }, { "Effect": "Deny", "Action": [ "kms:CreateGrant" ], "Resource": "", "Condition": { "Null": { "kms:ViaService": "true" } } } ]}### Policy Versions and Creation Dates
This table was also generated by the script above.
| policy | version | is_default | create_date |
|---|---|---|---|
| AWSCompromisedKeyQuarantine | v1 | TRUE | 2020-08-11T18:04:13+00:00 |
| AWSCompromisedKeyQuarantineV2 | v1 | FALSE | 2021-04-21T22:30:59+00:00 |
| AWSCompromisedKeyQuarantineV2 | v2 | FALSE | 2021-11-11T21:32:48+00:00 |
| AWSCompromisedKeyQuarantineV2 | v3 | FALSE | 2022-08-10T21:15:53+00:00 |
| AWSCompromisedKeyQuarantineV2 | v4 | FALSE | 2023-03-16T00:20:25+00:00 |
| AWSCompromisedKeyQuarantineV2 | v5 | TRUE | 2024-10-02T16:41:39+00:00 |
| AWSCompromisedKeyQuarantineV3 | v1 | FALSE | 2024-08-21T17:36:49+00:00 |
| AWSCompromisedKeyQuarantineV3 | v2 | FALSE | 2024-10-02T16:52:27+00:00 |
| AWSCompromisedKeyQuarantineV3 | v3 | FALSE | 2026-03-16T16:27:14+00:00 |
| AWSCompromisedKeyQuarantineV3 | v4 | TRUE | 2026-11-09T21:37:07+00:00 |
| AWSCompromisedKeyQuarantineV4 | v1 | FALSE | 2026-11-06T00:37:07+00:00 |
| AWSCompromisedKeyQuarantineV4 | v2 | TRUE | 2026-11-09T22:27:07+00:00 |
The original AWSCompromisedKeyQuarantine was created on August 11, 2020. You could say that AWS began putting minimal brakes in place for emergencies like this about six years ago.
Versions and the Number of Denied Actions Over Time #
| Date (UTC) | Policy | Version | Actions | Main changes from the previous version |
|---|---|---|---|---|
| 2020-08-11 | AWSCompromisedKeyQuarantine | v1 | 28 | Initial version. IAM create/modify actions, EC2 launch actions, Lightsail, Lambda CreateFunction, Organizations CreateAccount, and more |
| 2021-04-21 | V2 | v1 | 55 | IAM privilege escalation actions (PassRole, CreatePolicyVersion, UpdateAssumeRolePolicy, and more), Lambda modification actions, S3 deletion and public-access settings |
| 2021-11-11 | V2 | v2 | 55 | Replaced s3:DeleteBucketOwnershipControls withs3:PutBucketOwnershipControls |
| 2022-08-10 | V2 | v3 | 56 | Added cloudtrail:LookupEvents |
| 2023-03-16 | V2 | v4 | 60 | Reserved Instance purchase, exchange, and listing; savingsplans:CreateSavingsPlan |
| 2024-08-21 | V3 | v1 | 60 | New V3 policy with the same content as V2 v4 (additions such as organizations:LeaveOrganization came in later versions) |
| 2024-10-02 | V2 | v5 | 89 | Bedrock, ECS/ECR, SageMaker, Amplify, CodeBuild, Glue, S3 read and create actions, STS token issuance, SES/SNS read actions, iam:ListUsers , and more |
| 2024-10-02 | V3 | v2 | 89 | Aligned with the content of V2 v5 |
| 2026-03-16 | V3 | v3 | 99 | KMS (PutKeyPolicy, ScheduleKeyDeletion, grant operations, and a conditional Deny on CreateGrant ),s3:PutEncryptionConfiguration ,organizations:LeaveOrganization /AcceptHandshake ,logs:PutLogEvents |
| 2026-11-06 | V4 | v1 | 205 | Major expansion (see below) |
| 2026-11-09 | V3 | v4 | 114 | bedrock:CallWithBearerToken ,bedrock-mantle:* ,iam:*ServiceSpecificCredential |
| 2026-11-09 | V4 | v2 | 215 | Aligned bedrock-mantle:* with the form used in V3 v4 and addediam:UpdateServiceSpecificCredential |
Observations #
The Big Picture
-
From 2020 to August 2024, about four years, the policy grew from 28 to 60 actions. About six weeks after V3 was introduced, on 2024-10-02, V2 (v5) and V3 (v2) both grew to 89 actions at the same time.
-
The earliest AWSCompromisedKeyQuarantine, beyond blocking IAM privilege escalation and locking out the compromised user, seems to have focused on preventing the abuse of compute resources.
-
The October 2024 update added generative AI (Bedrock), containers (ECS/ECR), SageMaker, read actions for SES/SNS, and STS token issuance. It looks like it reflects how the ways to run up a bill had spread beyond EC2.
-
The V3 v3 update in March 2026 added actions that block encryption and key deletion through KMS, as well as changes to S3 default encryption.
-
To me, this looks like a countermeasure against attacks that hold data hostage.
-
November 2026 was concentrated on two days: 11/6 (V4 v1) and 11/9 (V3 v4 and V4 v2). V4 v1 was released on 11/6 with 205 actions. On 11/9, the Bedrock Mantle actions and
iam:UpdateServiceSpecificCredentialwere revised (bedrock-mantle:CreateInferencewas removed). On the same day, the same Bedrock-related changes also landed in V3. -
It looks like AWS is moving to address the risks of Amazon Bedrock API keys, which I wrote about in another post (Japanese).
-
Compared with V3 v4, some individual actions (such as
ses:GetSendQuota/ListIdentitiesandkms:PutKeyPolicy/ScheduleKeyDeletion) no longer appear in V4. They are covered by wildcards such asses:Get*/List*andkms:Put*/Schedule*. -
However, V4 v1 did not include the
bedrock-mantlewildcard actions oriam:UpdateServiceSpecificCredentialthat V3 v4 had. They were added in V4 v2. -
V4 seems to have moved from "don't let them create things" to "don't let them move laterally, delete things, or break things."
What Changed in the Current V4
The changes seem to cover the following areas much more thoroughly.
-
Coverage of compute execution paths
-
ECS (RunTask, ExecuteCommand, the various TaskSet actions, Express Gateway, Daemon)
-
App Runner
-
Auto Scaling, Application Auto Scaling, and launch template changes
-
SageMaker jobs, endpoints, notebooks, and clusters
-
Lambda function URLs, event source mappings, and invocation
-
Retrieval of credentials and secrets
-
secretsmanager:GetSecretValue -
ssm:GetParameter*, plusssm:SendCommand/StartSession/ResumeSession -
sts:AssumeRole -
Erasing evidence and evading defenses
-
cloudtrail:StopLogging/DeleteTrail -
Destructive actions
-
backup:DeleteRecoveryPoint/DeleteBackupVault -
rds:DeleteDBSnapshot -
cloudformation:DeleteStack -
S3 versioning, Object Lock, and retention settings
Closing Thoughts #
I simply got curious one day and wanted to trace how the AWSCompromisedKeyQuarantine policies changed over time. I don't think readers need to know the entire history.
Still, looking at the whole picture reminded me that each version of the policy captures the actions AWS recognized as known attack techniques at that point in time. I also got the impression that the policy has been evolving beyond stopping the abuse of AWS resources. It seems to be aimed at minimizing the impact on running resources, and at preventing mistakes by the user while the quarantine is in place.
I don't think there's much value in following every change, but I do recommend reading through the current version of the policy. Turning the policy inside out may help you judge whether the credentials attached to your running workloads have permissions they don't actually need.
I hope this post is useful to someone.
See you next time.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
recommendations