Last active
March 15, 2018 15:07
-
-
Save oli-logicnow/da1be4c9dccadb94670338e21bf4f348 to your computer and use it in GitHub Desktop.
Find all the keys and their associated user for a specific account
This file contains 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
export PROFILE=XXXX | |
for USER in `aws --profile $PROFILE iam list-users --query 'Users[].UserName' --output text` | |
do | |
for KEY in `aws --profile $PROFILE iam list-access-keys --user-name "$USER" --query 'AccessKeyMetadata[].AccessKeyId' --output text` | |
do | |
echo $USER $KEY | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment