What Is AWS IAM? Access Management with Users, Roles and Policies

Sunucun 3 min read

AWS IAM (Identity and Access Management) is the service that controls who (authentication) can do what (authorization) in your AWS account. Letting a developer read only a specific S3 bucket, letting an EC2 server write to DynamoDB without storing a password, or letting the accounting team see only invoices are all configured with IAM. There is no additional charge for IAM itself.

Illustration: AWS

Core IAM Concepts

ConceptWhat it is for
Root userThe all-powerful identity created with the email you signed up with. It shouldn’t be used for everyday tasks.
IAM userAn identity for a person or application with long-term credentials (password, access keys).
IAM groupA group used to grant permissions to users collectively (for example “Developers”).
IAM roleAn identity with no permanent password, assumed with temporary credentials. Services such as EC2 and Lambda, and users from external identity providers, use roles.
PolicyA JSON document that defines which actions (Action) on which resources (Resource) under which conditions (Condition) are allowed or denied.

An Example IAM Policy

The policy below only allows listing and reading files in the S3 bucket named example-backups; it grants no access to any other bucket or action:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:ListBucket"],
      "Resource": "arn:aws:s3:::example-backups"
    },
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject"],
      "Resource": "arn:aws:s3:::example-backups/*"
    }
  ]
}

In IAM the default is “no access”; an action is possible only if a policy explicitly allows it. An explicit Deny statement always overrides any allow.

IAM Security Practices AWS Recommends

The main recommendations from AWS’s IAM security best practices page are:

  1. Protect the root user: Don’t use the root account for daily work; protect it with a strong password and MFA.
  2. Require MFA: Where possible, use phishing-resistant MFA such as passkeys or security keys.
  3. Temporary credentials for people: Have human users access AWS through an identity provider (for example IAM Identity Center) with temporary credentials.
  4. Roles for workloads: Assign IAM roles to applications running on EC2 or Lambda instead of giving them access keys; AWS supplies temporary credentials automatically.
  5. Least privilege: Grant only the permissions the job requires. Start with AWS managed policies and move toward your own narrower policies over time; IAM Access Analyzer can generate policies based on actual usage.
  6. Remove what isn’t used: Use last accessed information to regularly remove unused users, roles, keys and policies.
  7. Use conditions: For example, add conditions that require requests to use TLS.
  8. Keep long-term keys up to date: If access keys are unavoidable (for example for a tool outside AWS), update them when needed and revoke them immediately when an employee leaves.

A Short Checklist for Initial Setup

  • Add MFA to the root user and don’t create root access keys.
  • Create a separate administrator identity with MFA for admin work (preferably through IAM Identity Center).
  • Split teams into groups and grant permissions to the groups.
  • Assign roles to your servers and functions instead of access keys.
  • Never commit access keys to a code repository (for example GitHub).

For the services where IAM roles are used most, see our articles on Amazon EC2, Amazon S3, AWS Lambda and Amazon RDS. The same logic applies to your own server: using a sudo user and SSH keys instead of root is the foundation of VDS server security.

Conclusion

AWS IAM uses users, groups, roles and JSON policies to define who can access what in your AWS account. Protecting the root user, requiring MFA, using roles and temporary credentials instead of long-term keys, and following least privilege are the foundations of your AWS account’s security.

Categories

Latest guides