Skip to content

Instantly share code, notes, and snippets.

@bashtoni
Created December 11, 2017 13:23
Show Gist options
  • Save bashtoni/168e0ce334793ed6d5cafb19185e737f to your computer and use it in GitHub Desktop.
Save bashtoni/168e0ce334793ed6d5cafb19185e737f to your computer and use it in GitHub Desktop.
Check if a user has access keys still being used
user=foo
for key in $(aws iam list-access-keys --user-name $foo --query 'AccessKeyMetadata[].AccessKeyId' --output text); do
aws iam get-access-key-last-used --access-key-id $key
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment