Validate a leaked AWS key with sts get-caller-identity before you report it

When you find AWS credentials in a JS bundle, repo or config file, the first call to make is the one that needs no IAM permissions and changes nothing:

code
AWS_ACCESS_KEY_ID=<access-key-id> AWS_SECRET_ACCESS_KEY=<secret> aws sts get-caller-identity

If the key is temporary (it starts with ASIA), also set AWS_SESSION_TOKEN=<token>. A live key returns Account, UserId and Arn. The Arn tells you the principal: user/ci-deploy, assumed-role/... or the root account.

This works because STS lets any valid credential ask who it is, so you can prove the key is active without touching customer data. Compare the 12-digit Account with the accounts the program lists in scope. If it belongs to a third party (a vendor's SDK demo key, for example), stop and do not test further.

Proof of impact is a valid response plus the Arn. InvalidClientTokenId or ExpiredToken means the key is dead and the report is informational at best. Do not list buckets, read secrets or enumerate other services unless the program explicitly allows it; the identity output is enough to report. Use only keys you found within scope, and never paste the full secret into the report.

Follow #aws, #cloud, #leaked-keys or #sts for new tips like this one, on your notifications page and, if you choose, in a daily or weekly email.

Comments

No comments yet.