Created
March 24, 2016 08:51
-
-
Save coldclimate/464e6e5174d9a5ffcc6a to your computer and use it in GitHub Desktop.
Get a list of all access keys on an AWS account
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
for USERNAME in `aws iam list-users | jq -r '.Users[].UserName'` | |
do | |
KEYS=$(aws iam list-access-keys --user-name $USERNAME | jq '.AccessKeyMetadata[].AccessKeyId') | |
echo $USERNAME, $KEYS | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment