AWS Builder Center
7 IAM mistakes that put student AWS accounts at risk

7 IAM mistakes that put student AWS accounts at risk

Root user, no MFA, leaked keys, admin everywhere: seven common IAM shortcuts, the free fix for each, and a 10-minute checklist.

Dev
Most AWS horror stories don't start with a clever attack. They start with a small IAM shortcut: a key committed to GitHub, the root user used for everything, an admin policy attached "just for now". Here are seven common mistakes and the fix for each. All the fixes are free.
IAM mistakes and fixes cheat sheet


1. Using the root user for daily work

The root user can do everything, including closing the account, and its permissions can't be limited by IAM policies.
Fix: Turn on MFA for the root user, store its credentials safely, and stop using it. Create a separate identity for daily work: IAM Identity Center if you can, or an IAM user if you can't.

2. No MFA anywhere

A leaked password with no MFA means a takeover.
Fix: Enable MFA on the root user and on every human identity. A passkey or an authenticator app is enough.

3. Long-term access keys on your laptop, or in your repo

Access keys don't expire on their own. Once pushed to a public repository, they're found fast. In one test by Palo Alto Networks' Unit 42 researchers, AWS attached its  AWSCompromisedKeyQuarantine  policy to a leaked key within about 10 seconds. That policy blocks some high-risk actions, but it doesn't delete the key. You still have to rotate the key and investigate.
Fix:
  • Prefer short-term credentials:  aws configure sso  with IAM Identity Center, or IAM roles.
  • If you must use keys, never put them in code. Keep them in  ~/.aws/credentials  and add  .env  to  .gitignore .
  • Turn on GitHub push protection for your repositories, so a secret is blocked before it's pushed.

4. Attaching  AdministratorAccess  to everything

Admin "for now" usually becomes admin forever. Any app or person with admin access can do anything in the account.
Fix: Start from AWS managed policies for the job (for example  AmazonS3ReadOnlyAccess ), then tighten them. IAM Access Analyzer can generate a least-privilege policy based on the activity recorded in CloudTrail.

5. Putting secrets in code or in EC2 user data

Database passwords and API keys end up in Git, in logs, and in user data that anyone with  ec2:DescribeInstanceAttribute  can read.
Fix: Store secrets in AWS Secrets Manager or Systems Manager Parameter Store (as a  SecureString ), and let your application read them through its IAM role at runtime.

6. Leaving old users and keys around

Old access keys from a finished project are pure risk.
Fix: Download the IAM credential report (IAM → Credential report). It shows every user, when their password and keys were last used, and whether MFA is on. Delete anything you don't recognise or haven't used in 90 days.

7. Making an S3 bucket public to "make it work"

Since April 2023, new S3 buckets have Block Public Access turned on by default. Turning it off to fix an "Access Denied" error is the classic way private files end up public.
Fix: Keep Block Public Access on. To serve a website, put CloudFront in front of the private bucket. To share a single file, use a presigned URL with an expiry.

A 10-minute checklist

  • [ ] MFA on root, and root put away
  • [ ] A separate daily identity (IAM Identity Center or IAM user) with MFA
  • [ ] No access keys in code,  .env  in  .gitignore , push protection on
  • [ ] No  AdministratorAccess  on apps
  • [ ] Secrets in Secrets Manager or Parameter Store
  • [ ] Credential report reviewed
  • [ ] Block Public Access on for every bucket
  • [ ] Bonus: an AWS Budgets alert, so a compromise shows up as an email before it shows up as a bill
Which of these seven have you seen in a real project, or in your own account? Be honest; no judgement here.
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