AWSCompromisedKeyQuarantine V4 Has Arrived, So I Looked Back at Every Version of the Policy Serverworks technical support engineer Ichino retrieved all 12 versions of the AWSCompromisedKeyQuarantine managed policies and found the denied-action list grew from 28 actions to 215 in the newly released V4, expanding beyond EC2 to cover Bedrock, KMS, ECS and SSM. AWS applies the policy to IAM users whose credentials have been compromised or exposed publicly, and the V4 description states it aims to limit damage from fraud-related activity leading to unauthorized charges. Ichino, who wrote the analysis after a customer's access key was misused in an unauthorized-use incident, said the post is a personal interpretation of why actions were added or removed and is not an official AWS statement. AWSCompromisedKeyQuarantine V4 Has Arrived, So I Looked Back at Every Version of the Policy 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 policy https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSCompromisedKeyQuarantineV4.html says: 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. bash /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