TL;DR: Revoking AWS credentials is not immediate. In my tests, IAM, STS, S3 and EC2 started denying requests within seconds, but Lambda accepted revoked credentials for about 5 minutes in every single trial, and so did DynamoDB on a kept connection. With new connections, S3, EC2 and DynamoDB kept accepting some requests for up to 8–10 minutes. Changing the revocation method didn't meaningfully shorten the delay. These are observations from my test accounts, not AWS guarantees, and the test harness is open source, so you can measure your own regions.

Why I measured this

When a key leaks, the incident-response playbook says: deactivate the key, attach a deny policy, revoke the role's sessions. Then what? How long until the attacker is actually locked out?

The community answer is "about 4 seconds". It comes from research by Eduard Agavriloae at OffensAI (summarized on Hacking the Cloud) showing that IAM is eventually consistent and that there's a short window right after a change. That research proved the window exists. Nobody had measured how long it lasts across revocation methods, services and regions.

AWS's own documentation is honest but vague. It says IAM "uses caching to improve performance" and that "it might take a few minutes for policy updates to take effect". It doesn't publish numbers per service.

So I built a harness, revoked credentials 410 times across 6 methods, 2 credential types, 6 services and 6 regions, and recorded every request. (Yes, 410 times. It took about 22 hours of non-stop testing, plus another 5 hours for presigned URLs.) The harness is open source: github.com/tokarev-artem/aws-credential-revocation-measured.

What I tested

Six revocation methods, the ones you'll find in incident-response runbooks:

MethodWhat it does
Delete access keyiam:DeleteAccessKey on the user's key
Inline Deny *Puts an inline policy with Deny * on the user or role
Attach AWSDenyAllAttaches the AWS-managed AWSDenyAll policy
AWSDenyAll as boundarySets AWSDenyAll as the permissions boundary
Revoke older sessionsThe console's "Revoke active sessions": a Deny on aws:TokenIssueTime
SCP Deny *An SCP denying everything for that principal's ARN

Two credential types: an IAM user's access key, and an STS session from AssumeRole.

Six probes, each a cheap read-only call that needs an explicit Allow:

  • IAM ListAccountAliases
  • STS AssumeRole
  • S3 GetObject
  • EC2 DescribeInstances
  • DynamoDB GetItem
  • Lambda Invoke

sts:GetCallerIdentity isn't one of them, because it succeeds even under Deny * and would tell us nothing.

Six regions: us-east-1, us-west-2, eu-central-1, eu-west-2, ap-southeast-1 and sa-east-1.

Two connection modes:

  • Kept connection: an SDK client that reuses its HTTP keep-alive connection, which is what a normal script or app does.
  • New connection per request: a fresh TCP and TLS connection for every call, which is closer to what a distributed attacker or many short-lived clients look like.

This turned out to matter a lot. Note that a new TCP connection doesn't guarantee a fresh authorization check inside AWS; it may simply reach a different front-end server with its own cache.

That's 20 trials of every revoking combination: 10 method and credential pairs × 2 connection modes × 20 trials = 400 revocation trials, each measured in 6 regions × 6 services, for 14,400 measurements. Another 10 control trials (deleting the key behind a live STS session) bring the total to 410. All tests ran November 26–28, 2026.

Trials (kept + new connection)User access keySTS session (AssumeRole)
Delete access key20 + 20control: 5 + 5
Inline Deny *20 + 2020 + 20
Attach AWSDenyAll20 + 2020 + 20
AWSDenyAll as boundary20 + 2020 + 20
Revoke older sessionsnot applicable (no session)20 + 20
SCP Deny *20 + 2020 + 20

A separate batch of 102 trials tested presigned URLs (see section 5).

How the harness works


  1. Create a fresh principal for every trial: a new IAM user, and for STS trials a new role assumed by that user. Then wait until every probe in every region succeeds three times in a row, because new principals are eventually consistent too.
  2. Start probe Lambdas in all six regions at once. Each one calls all six services every 100 ms (IAM every 500 ms) with the trial's credentials and records the start time, end time and result of every request. SDK retries are off, so one probe is exactly one HTTP request.
  3. Revoke after 15 seconds of baseline traffic. Time zero is the moment the revoking API call returned, corrected against time.aws.com with NTP. This is the most generous choice for AWS: the clock starts only after AWS confirmed the change.
  4. Keep probing until access has been stably denied for 10 minutes, up to 30 minutes in total. Probe Lambdas chain themselves past the 15-minute Lambda limit.
  5. Delete everything, then record two numbers per region and service: the first denied request and the last successful request.
First denial vs last success. First denial is when revocation starts to bite: the first request that came back denied. Last success is when it actually ends: the last request that still worked. Between the two, an attacker's requests partly or fully keep working. The last success is the number that matters for incident response.

Trials ran 8 at a time in random order, from probe Lambdas in two separate AWS accounts.

Results

1. Revocation starts fast and ends slowly


For every method, the first denied request came quickly for most services: about 8 seconds with new connections, and about 2 seconds for SCPs. Lambda and DynamoDB on a kept connection are the exception (see section 2).

But the last successful request came minutes later. The median worst case per trial, across all services and regions, was:

Kept connectionNew connection per request
Delete access key (user key)289 s601 s
Inline Deny *289 s598–600 s
Attach AWSDenyAll289 s601 s
AWSDenyAll as boundary289 s599–601 s
Revoke older sessions289 s599 s
SCP Deny *288 s609–615 s

No method shortens the tail. An SCP bites first and ends last.

2. It depends on the service


Seconds from revocation to the last successful request (p50 / p90 / max), all methods pooled, 1,200 measurements per cell:

ServiceKept connectionNew connection per request
IAM10 / 19 / 369 / 20 / 74
STS AssumeRole17 / 19 / 7844 / 109 / 311
S3 GetObject17 / 36 / 577487 / 587 / 615
EC2 DescribeInstances18 / 88 / 248295 / 386 / 480
DynamoDB GetItem287 / 289 / 290585 / 602 / 646
Lambda Invoke283 / 286 / 302279 / 285 / 291

Three patterns stand out:

  • IAM and STS are fast. IAM itself stops honoring revoked credentials in about 10 seconds. This is probably where the "4 seconds" folklore comes from.
  • Lambda and DynamoDB look like a fixed cache. Every revoked credential kept working until about 285 seconds, then they all stopped together. You can see the cliff in the chart. That happened in 100% of trials, with every method, in every region. Lambda didn't deny a single request for the first 4 minutes: the first denial came at about 247 seconds and the last success at about 280. DynamoDB on a kept connection was even sharper, with no denials at all until about 288 seconds and then a clean switch.
  • With new connections, S3, EC2 and DynamoDB fade out slowly. Requests start getting denied after about 8 seconds, but some keep succeeding for up to 10 minutes. With new connections, requests to DynamoDB frequently alternated between AccessDenied and successful responses: the probe saw a median of 78 switches from denied back to allowed per trial, and up to 390 in some trials. That's what you'd expect from a fleet of front-end hosts, each with its own authorization cache.

3. It depends on the region


Median seconds to the last successful request, new connection per request:

RegionS3DynamoDBEC2
us-east-170202318
us-west-2102525332
eu-central-1460590311
eu-west-2508593249
ap-southeast-1557594281
sa-east-1583592243

us-east-1 cuts off S3 and DynamoDB access much faster than the other regions. If you test revocation only in us-east-1, as most blog posts do, you'll underestimate the window everywhere else by several minutes.

Is this IAM replicating slowly from us-east-1? No. The first denied request arrived after about 7.5 seconds in every region, including sa-east-1 and ap-southeast-1. The change reaches all regions at once; the long tail comes from caches inside each region's service fleet, which keep using an old "allowed" decision until it expires.

4. Deleting an access key doesn't end sessions it created

This is documented, but it's easy to forget mid-incident. In the control trials, an attacker who had used a user's key to call AssumeRole kept full access with that session for the entire 30-minute test, in all 10 trials, after the key was deleted. Role sessions live until they expire, up to 12 hours, unless you revoke them separately.

5. Presigned URLs outlive revocation too

A presigned S3 URL is signed with its creator's credentials, and S3 checks the signer's permissions every time the link is used. So revoking the signer should kill every link they handed out. It does, eventually.

In a separate batch of 102 trials (96 revocation trials plus 6 controls; delete key, inline deny and SCP for user keys, inline deny, revoke older sessions and SCP for STS sessions, 8 trials each per connection mode), each trial signed a 1-hour GetObject URL in every region before revoking, then fetched it every 100 ms alongside a normal S3 GetObject call with the same credentials. Seconds to the last successful download (p50 / p90 / max):

Kept connectionNew connection per request
Presigned URL17 / 218 / 577549 / 592 / 616
Normal S3 GetObject17 / 127 / 587546 / 594 / 618

A presigned link behaves broadly like the signer's own S3 requests when credentials are revoked. The authorization delay is similar, although individual measurements vary. With new connections it kept working for about 9 minutes in the median case. That was true for every method: delete the signing key (537 s), inline deny (554 s), revoke older sessions (545 s) or SCP (549 s). Deleting the key does change the error, to InvalidAccessKeyId instead of AccessDenied, but not the timing.

The region pattern is the same as before. The median was 149 s in us-east-1 and 251 s in us-west-2, against 537–585 s in the other four regions.

If a leaked key was used to mint presigned URLs, assume those links keep working for about 10 minutes after you revoke.

What this means for incident response

  1. Plan for 11 minutes, not 4 seconds. In my tests, some requests succeeded up to 10 min 46 s after revocation (only 1.4% of measurements went past 10 minutes). For incident response, allow at least 11 minutes. That's the worst case I observed, not a guaranteed upper bound from AWS. us-east-1 was the fastest region, so don't use it as your benchmark.
  2. The choice of method doesn't buy speed. Use whichever is most reliable and reversible for your team. An SCP denies first and covers every principal in the account, but its tail is just as long.
  3. Revoke sessions, not just keys. Deleting a key leaves any STS session created from it fully working. Also revoke older sessions on every role the key could assume (see How to revoke sessions below).
  4. Lambda and DynamoDB: expect about 5 minutes, every time. This isn't a rare tail. It's the typical case.
  5. Measure in your own regions. Results from us-east-1 look much better than elsewhere.
  6. Treat the window as part of the incident timeline. Activity in the first 11 minutes after revocation may still be the attacker's activity, so keep investigating it.

How to revoke sessions

You attach a deny policy that blocks every session issued before a cutoff time. Sessions created after the cutoff keep working, so legitimate users simply assume the role again.

Console: IAM → Roles → the role → Revoke sessions tab → Revoke active sessions. AWS adds an inline policy named AWSRevokeOlderSessions, with the cutoff about 30 seconds in the future.

CLI, handy during an incident or to script it across many roles:

# 30 s in the future, like the console. Linux (GNU date): CUTOFF=$(date -u -d '+30 seconds' +%Y-%m-%dT%H:%M:%SZ) # macOS: CUTOFF=$(date -u -v+30S +%Y-%m-%dT%H:%M:%SZ) cat > revoke.json <<EOF { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": "*", "Resource": "*", "Condition": {"DateLessThan": {"aws:TokenIssueTime": "$CUTOFF"}} }] } EOF aws iam put-role-policy --role-name <ROLE> \ --policy-name AWSRevokeOlderSessions --policy-document file://revoke.json 

This revokes temporary sessions only. It doesn't touch the IAM user's long-term access key, so disable or delete the key as a separate step.

Details that matter mid-incident:

  • Which roles? CloudTrail shows which roles the leaked key actually assumed: look for AssumeRole events whose accessKeyId is the leaked key. Also check which roles the user was allowed to assume, through its sts:AssumeRole permissions and the roles' trust policies.
  • Role chaining: if the attacker used role A's session to assume role B, revoke sessions on role B too.
  • Sessions from the user itself: GetSessionToken and GetFederationToken sessions aren't tied to a role, and deleting the key doesn't end them either. Attach the same deny policy to the user with aws iam put-user-policy.
  • When to remove the policy: keep it until every affected session would have expired on its own: up to 12 hours for AssumeRole sessions (1 hour for sessions created through role chaining), and up to 36 hours for GetSessionToken and GetFederationToken sessions.
  • It still takes time. In my tests, revoking older sessions had the same 5–10 minute tail as every other method. It ends the sessions, just not instantly.

Limitations

  • Measured November 26–28, 2026, in two new accounts, in six regions. These are observations, not AWS guarantees, and AWS can change caching behavior at any time. That's why the harness is open source: re-run it.
  • Each probe sent about 10 requests per second per service per region from Lambda inside AWS. Different request rates, clients outside AWS, or other APIs could behave differently.
  • I tested one read-only API per service. Other operations on the same service may use different authorization paths.
  • The results cover identity-based permissions. Permissions granted directly through resource-based policies (for example a bucket policy that names the user) can be evaluated differently, notably with permissions boundaries, and weren't tested. KMS grants, VPC endpoint policies and Identity Center session revocation weren't tested either. Presigned URLs were tested only for S3 GetObject, with 4 of the 6 methods.

Try it yourself

The code is on GitHub: github.com/tokarev-artem/aws-credential-revocation-measured. The harness is Terraform for the probe Lambdas plus a Python orchestrator. A full run of 410 trials across 6 regions took about 22 hours, mostly limited by Lambda concurrency in new accounts, and cost about $20 in AWS usage, almost all of it Lambda. A single trial takes about 20 minutes:

uv run python -m revocation trial --method inline_deny --cred user_key --conn fresh 

Methodology notes

  • Time zero is when the revoking API call returned, NTP-corrected. Starting the clock when the call was sent would add about 0.4 s to every number.
  • "Revoke older sessions" uses a cutoff of now. The console sets it about 30 seconds in the future to allow for propagation, which would make the console version look 30 seconds worse. The CLI example above uses the console's 30-second offset.
  • For SCPs, the policy was created in advance; only attaching it was timed. SCPs have no Principal element, so the policy used the aws:PrincipalArn condition key. For STS sessions that key matches the role ARN, not the assumed-role session ARN, so the SCP targeted the role.
  • Control trials (deleting the key of a user whose STS session stays alive) are reported separately and not mixed into the revocation statistics.