Skip to content

Instantly share code, notes, and snippets.

@mafonso
Last active April 23, 2025 08:33
Show Gist options
  • Save mafonso/7ee51981581f544ed52c to your computer and use it in GitHub Desktop.
Save mafonso/7ee51981581f544ed52c to your computer and use it in GitHub Desktop.
List Access Keys for all IAM users
for user in $(aws iam list-users --output text --no-cli-pager | awk '{print $NF}'); do
aws iam list-access-keys --user $user --output text --no-cli-pager
test $? -gt 128 && exit
done
for user in $(aws iam list-users --output text --no-cli-pager| awk '{print $NF}'); do aws iam list-access-keys --user $user --output json --no-cli-pager; done | jq
@Boris-Jancic
Copy link

Boris-Jancic commented Apr 23, 2025

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment