DEV Community

Lucien Boix
Lucien Boix

Posted on

AWS IAM : how to list unused access keys in your account

You have two options here.

The best is to activate the IAM unused access analyser if you are willing to pay around 50USD monthly for this service.
Basically it will scan constantly all your IAM section and list you warning events like unused roles, unused permissions, unused passwords and what interests us the most here : unused access keys.

  • You can event use EventBridge to be notified about that through an email or a Lambda (that could write to your Slack channel for example)
  • Or simply add this check to your morning routine at work

Otherwise you can launch this simple bash script I made here : it will list you the active access keys not used from more than 90 days.
You can confidently start to deactivate them, then remove them after a few days.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay