AWS Builder Center

IAM Basics for Beginners: 6 Rules to Keep Your AWS Account Safe

Six core IAM rules for beginners, from protecting the root user to using roles and least privilege, to help keep your AWS account secure.

IAM (Identity and Access Management) decides who can do what in your AWS account. Most beginner security problems come from a few avoidable habits. Here are six rules that cover the fundamentals.

1. Protect the root user

The root user has complete access to the account. Enable MFA on it, don't create access keys for it, and use it only for the few tasks that require it. For daily work, use a separate IAM identity.

2. Use roles instead of long-lived keys

Roles provide temporary credentials. If an application on an EC2 instance needs to reach S3, attach a role to the instance instead of storing access keys on it.

3. Never put access keys in code

Keys committed to a public GitHub repository can be found and abused quickly. Keep them out of source code and out of repositories. If a key is ever exposed, deactivate and delete it immediately.

4. Understand how permissions are evaluated

Requests are denied by default. Access exists only if a policy explicitly allows it, and an explicit deny always overrides any allow.

5. Apply least privilege

Start with the minimum permissions a task needs and add more only when required. Avoid using "*" for both actions and resources in a policy, because that grants far more than most tasks need.

6. Turn on MFA and review access regularly

Enable MFA for every human user. Periodically remove users, keys, and permissions that are no longer used. IAM shows when a permission was last used, which helps you find what to remove.

Remember

IAM is a global service, so users, roles, and policies apply across all Regions in your account.

Your turn

What was the first IAM mistake you made, or the one that confused you the most?
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