Fix it
Find old and forgotten IAM access keys in your AWS account
An access key nobody uses is still a live credential. This is how to list the old ones and replace them without breaking an app.
AWS details read from the AWS docs on 28 November 2026. Each one links to its page.
What AWS says
- A user can have at most two access keys. AWS docs
- The credential report shows, per key, when it was created or last changed (access_key_1_last_rotated) and when it was last used (access_key_1_last_used_date). AWS docs
- You can generate a credential report as often as once every four hours, and it covers only the first two access keys per user. AWS docs
Find it in your account
Print the credential report, then look at each active key's last_rotated and last_used_date. AWS docs
Run this
aws iam generate-credential-report && aws iam get-credential-report --query Content --output text | base64 --decodeCheck your credential report in the browser. It runs in your browser and uploads nothing.
Fix it
- Create a second key for the user. AWS docsRun this
aws iam create-access-key --user-name USER - Update every application and tool to use the new key. AWS docs
- Check that the old key is no longer used. AWS docsRun this
aws iam get-access-key-last-used --access-key-id OLD_KEY_ID - Make the old key inactive instead of deleting it. AWS recommends not deleting it straight away. AWS docsRun this
aws iam update-access-key --access-key-id OLD_KEY_ID --status Inactive --user-name USER - After a waiting period with nothing broken, delete it. AWS docsRun this
aws iam delete-access-key --access-key-id OLD_KEY_ID --user-name USER
What OpsAgent flags
OpsAgent runs checks 02 and 13 against your AWS account every night and flags:
- Medium: an active access key last rotated over 90 days ago.
- Medium: an active access key that was never used, after 7 days.
- Low: a user with two active access keys at once.
- Medium: a console user without MFA. Low: a console password unused for over 90 days.
- Critical: the root user signed in within 30 days or has an access key. High: a user with AdministratorAccess attached.
What OpsAgent does not do here
- It does not find a key that was pasted into GitHub or a chat. It sees old, unused and powerful keys in your account, not where a key has been copied.
- It never rotates, disables or deletes a key. It connects read-only; you run the commands above.
Get your ops teammate.
Start a 14-day free trial. Card required, cancel any time.
Start free trial