IAM: Identity & Access Management

AWS Fundamentals

Chapter 2 · IAM: Identity & Access Management

Chapter 1 named "your own IAM users, roles & permissions" as squarely your side of the shared responsibility model. This chapter covers exactly that — IAM (Identity and Access Management), the real AWS service controlling who, and what, can do what, to which resources, across your entire account.

The Root Account — and Why You Don't Use It Day to Day

Every AWS account has exactly one real root user, created when the account itself was created, with unlimited, unrestricted access to everything — including the ability to close the account or change its own billing. AWS's own real, standard guidance is to lock this account down immediately (a strong password, MFA enabled) and then never use it for everyday work. Every real task after that first setup should run through a separate, individually named IAM identity instead — so that if any single credential is ever compromised, the damage is bounded to whatever that one identity was actually permitted to do.

Users, Groups, Roles & Policies

  • IAM User — a real, individual identity (a person or an application) with its own long-term credentials (a password for console access, and/or access keys for programmatic access).
  • IAM Group — a real, named collection of users. You attach permissions to the group once, and every user in it inherits them — the standard way to manage permissions for a whole team rather than one user at a time.
  • IAM Role — genuinely different from a user: a role has no long-term credentials of its own. It's assumed temporarily — by a real person, by an AWS service (an EC2 instance, a Lambda function), or by another AWS account — and grants only short-lived, automatically expiring credentials for the duration it's assumed.
  • IAM Policy — a real JSON document defining exactly what's allowed or denied. Policies attach to users, groups, or roles, and are what actually grant (or restrict) permission — a user or role with no policies attached can do essentially nothing.
Roles Are the Real Default for AWS Services
Never embed long-term access keys directly inside application code running on an EC2 instance or in a Lambda function — the real, standard practice is to attach an IAM role to that resource instead. AWS automatically issues, and automatically rotates, temporary credentials to anything assuming that role, with nothing to leak in a code repository.

A Real Policy Document

// Allows read-only access to objects in one specific S3 bucket only { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": [ "arn:aws:s3:::example-reports-bucket", "arn:aws:s3:::example-reports-bucket/*" ] } ] }

Every real IAM policy statement has the same four real building blocks: an Effect (Allow or Deny), an Action (the specific API calls it applies to, like s3:GetObject), a Resource (which specific thing it applies to, by ARN), and optionally a Condition (narrowing it further — e.g. only from a specific IP range, or only with MFA present).

The Principle of Least Privilege

A policy should grant exactly the permissions a real task needs, and nothing more. This is not just a security nicety — it's the direct practical guard against exactly the kind of failure Chapter 1's own shared-responsibility warning described: a resource or credential with far broader permissions than it actually needs becomes a far bigger real liability if it's ever compromised.

Multi-Factor Authentication (MFA)

MFA requires a second, real proof of identity beyond a password — a time-based one-time code from an authenticator app, or a physical hardware key — before a sign-in (or, via a policy Condition, before a specific sensitive action) is allowed to proceed. AWS's own real, standard recommendation is MFA on the root account without exception, and strongly encouraged for every IAM user with console access.

A Real Case Study: The 2019 Capital One Breach

What Actually Happened
In 2019, a former AWS employee, Paige Thompson, exploited a misconfiguration in a web application firewall Capital One had deployed on AWS, gaining access to data for roughly 106 million people across the US and Canada — including around 140,000 Social Security numbers and 80,000 bank account numbers. Thompson was later convicted and sentenced. Amazon's own real, public statement on the incident was direct: the breach came from "a misconfiguration of the (Capital One-designed) web application and not the underlying (Amazon-designed) cloud-based infrastructure."

This is a real, documented, large-scale illustration of Chapter 1's own shared responsibility model in practice: AWS's own infrastructure was not the point of failure — a customer-side misconfiguration was. Getting IAM roles, policies, and least-privilege access right isn't an abstract best practice; it's the exact category of control that determines how much real damage a single misconfiguration like this one can actually do.

Users, Groups, Roles & Policies at a Glance

ConceptHas Long-Term Credentials?Typical Use
UserYesA specific real person or application needing standing access
GroupNo (users inside it have their own)Managing permissions for a whole team at once
RoleNo — temporary credentials onlyAWS services, cross-account access, or a person needing short-lived elevated access
PolicyN/A — not an identityDefines what any of the above is actually allowed to do

Hands-On Exercises

Exercise 1

Explain, in your own words, why AWS recommends never using the root account for day-to-day work, even though it has full permissions and would technically be able to complete any task.

📄 View solution
Exercise 2

A developer hardcodes a long-term IAM access key directly into application code running on an EC2 instance, and later accidentally commits that code to a public GitHub repository. Explain what the real, standard alternative would have been, and why it avoids this specific risk entirely.

📄 View solution
Exercise 3

Using the real 2019 Capital One breach as your example, explain, in your own words, how the principle of least privilege — if it had been fully applied to the compromised web application's own permissions — could have limited the real scale of the damage, even if the underlying web application firewall misconfiguration still occurred.

📄 View solution

Chapter 2 Quick Reference

  • Root account — unlimited access; secure it with MFA, then stop using it day to day
  • User — a real identity with long-term credentials; Group — a named collection of users sharing permissions
  • Role — assumed temporarily, no long-term credentials; the real default for AWS services and applications
  • Policy — a JSON document (Effect/Action/Resource/Condition) that actually grants or restricts permission
  • Least privilege — grant only what's needed, nothing more; directly limits the real damage of a single compromise
  • Real case study — the 2019 Capital One breach (106 million people affected), a customer-side misconfiguration, not an AWS infrastructure failure