AWS Builder Center

5 IAM Mistakes That Keep Showing Up in AWS Accounts

The IAM misconfigurations that actually cause breaches in AWS — root account misuse, wide-open policies, exposed keys — and how to fix each one.

5 IAM mistakes that keep showing up in AWS accounts (and how to fix them)

I've been digging into AWS security lately, and one thing keeps standing out: most breaches in cloud environments aren't caused by some exotic zero-day. They're caused by boring, avoidable IAM misconfigurations. Wide open policies, root accounts used for everyday work, access keys sitting in a GitHub repo for anyone to find.
None of this requires advanced knowledge to fix. It just requires knowing what to look for. So here are 5 mistakes I see (and made myself) constantly, plus how to actually fix them. You just need an AWS account — the free tier is enough to follow along.

Quick refresher: what IAM actually does

IAM decides who can do what in your account. Every time something tries to touch a resource — you clicking around the console, a script running, an app calling an API — IAM checks whether that action is allowed.
The core idea to keep in mind throughout this whole article is least privilege: give each identity only what it needs, nothing more. Everything below basically comes back to that one principle.

1. Using the root account for daily work

When you first create an AWS account, you log in as root. Root has zero restrictions — it can do anything, including closing the account or changing billing. And yet a lot of people just keep using it because, well, it's already logged in.
If those credentials leak, it's game over. No permission boundary to fall back on.
Fix it:
  • Turn on MFA for root right away, before doing anything else.
  • Create a separate IAM user with admin permissions for actual daily use.
  • Lock the root credentials away and only touch them for the handful of things that genuinely require root (some support plan changes, for example).

2. Policies that allow everything

You'll run into policies like this constantly, usually written in a rush to stop getting "access denied" errors:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}

That's full admin access, dressed up as a "temporary fix." If whatever's using this policy gets compromised — a user, a role, an app — the attacker now owns the account.
Scope it down instead. Say an app only needs to read from one specific S3 bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-example-bucket",
"arn:aws:s3:::my-example-bucket/*"
]
}
]
}

If you're not sure what permissions something actually needs, IAM Access Analyzer can generate a policy based on real activity it observed — much better than guessing action by action.

3. Long-lived access keys floating around

Access keys are meant for programmatic access (CLI, SDKs, scripts), and they don't expire on their own. The usual way they cause damage:
  • Hardcoded directly in source code
  • Accidentally pushed to a public GitHub repo
  • Pasted into Slack or email "just this once"
Once a key is out there, it's usable by whoever finds it until someone manually revokes it — and there are bots scanning GitHub around the clock specifically for exposed AWS keys. It doesn't take long.
Fix it:
  • Use IAM roles instead of keys wherever you can. If code is running on EC2, Lambda, ECS, etc., attach a role to it instead of embedding credentials.
  • If you genuinely need long-lived keys, keep them in something like Secrets Manager, not in the codebase.
  • Rotate keys on a schedule.
  • Set up something like git-secrets locally so commits with key-shaped strings get blocked before they ever reach the repo.

4. No MFA anywhere

Without MFA, a leaked password is all it takes. This is one of the cheapest controls to set up relative to how much risk it removes, which makes skipping it kind of a waste.
Fix it:
  • Require MFA for every IAM user with console access.
  • You can go a step further and deny sensitive actions outright when MFA isn't present in the session:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"NotAction": [
"iam:CreateVirtualMFADevice",
"iam:EnableMFADevice",
"iam:ListMFADevices",
"iam:ResyncMFADevice",
"sts:GetSessionToken"
],
"Resource": "*",
"Condition": {
"BoolIfExists": {
"aws:MultiFactorAuthPresent": "false"
}
}
}
]
}

That policy blocks basically everything except setting up MFA itself, unless MFA is already active on the session.

5. Attaching policies straight to individual users

This one's less obviously dangerous, but it causes problems as a team grows. You attach permissions directly to a person, then another person, then another — and six months later nobody remembers who has what, or why.
Fix it:
  • Use IAM groups: create groups by function (Developers, Finance, Support, whatever fits), attach policies at the group level, and just move people in and out of groups.
  • For cross-account access or anything service-to-service, use roles instead of fixed users — roles hand out temporary credentials, which already cuts down a lot of long-term exposure.
  • Check the IAM Credential Report every so often. It shows every user, when they last used their password or keys, whether MFA is on — a quick way to catch accounts nobody's touched in months but that still have access.

The short version

Mistake
Fix
Using root daily
Admin user for daily work, root locked with MFA
"Action": "*" policies
Scope to specific actions and resources
Access keys everywhere
Roles first, Secrets Manager, rotation
No MFA
Require it, optionally enforce via policy
Policies on individual users
Groups and roles instead
None of this is advanced. It's mostly just discipline — the kind of stuff that's easy to skip when you're moving fast and setting up a new project. But fixing these five things closes off a big chunk of what actually gets accounts compromised in the real world.
If you're just starting out, spin up a free tier account and run through this list from scratch. It puts you ahead of a lot of people who only learn this stuff after something's already gone wrong.
Got questions on any of this, or want me to go deeper on something specific — cross-account roles, Access Analyzer, Secrets Manager? Drop a comment.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article