Created
December 11, 2017 13:23
-
-
Save bashtoni/168e0ce334793ed6d5cafb19185e737f to your computer and use it in GitHub Desktop.
Check if a user has access keys still being used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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