Lesson 8 of 36 · see all lessons
  1. Start here: cloud concepts (domain 1, 24%)

    1. 1. Start here: the exam, the plan and what you already know
    2. 2. What the cloud is: benefits, service models and deployment models
    3. 3. AWS global infrastructure: Regions, Availability Zones and edge locations
    4. 4. Cloud economics: what you pay for on-premises vs in the cloud
    5. 5. The AWS Well-Architected Framework: six pillars
    6. 6. Moving to AWS: the Cloud Adoption Framework and migration strategies
  2. Security and identity (domain 2, 30%)

    1. 7. The shared responsibility model: who secures what
    2. 8. IAM basics: users, groups, roles and policies
    3. 9. Protecting the root user, MFA and credentials
    4. 10. Identity at scale: IAM Identity Center, federation and cross-account access
    5. 11. Encryption and keys: protecting data at rest and in transit
    6. 12. Threat protection: Shield, WAF, GuardDuty, Inspector and Security Hub
  3. Governance, ways of working and compute (domains 2 and 3)

    1. 13. Logging, auditing and compliance: CloudWatch, CloudTrail, Config and Artifact
    2. 14. Governing many accounts: Organizations, Control Tower and Service Catalog
    3. 15. Ways to use AWS: console, CLI, SDKs and infrastructure as code
    4. 16. Amazon EC2: virtual servers and instance types
    5. 17. Elasticity: Auto Scaling and Elastic Load Balancing
    6. 18. Containers and serverless: ECS, EKS, Fargate, Lambda and more
  4. Storage, databases and networking (domain 3, 34%)

    1. 19. Block and file storage: EBS, instance store, EFS and FSx
    2. 20. Amazon S3: buckets, storage classes and lifecycle policies
    3. 21. Hybrid storage, backup and disaster recovery
    4. 22. Databases: RDS, Aurora, DynamoDB, ElastiCache and more
    5. 23. Networking: VPCs, subnets, gateways and security layers
    6. 24. Connecting and delivering: Route 53, CloudFront, VPN and Direct Connect
  5. Analytics, AI, integration and more (domain 3)

    1. 25. Analytics services: Athena, Glue, Kinesis, Redshift and Quick
    2. 26. AI and machine learning services: SageMaker AI, Lex, Rekognition and Amazon Q
    3. 27. App integration and business apps: SQS, SNS, EventBridge, Connect and SES
    4. 28. Developer tools, end-user computing, Amplify and IoT
  6. Billing, pricing and support, then exam practice (domain 4, 12%)

    1. 29. Pricing models: On-Demand, Savings Plans, Reserved, Spot and Dedicated
    2. 30. Billing and cost tools: Budgets, Cost Explorer, Pricing Calculator and tags
    3. 31. AWS Support plans, Trusted Advisor and where to get help
    4. 32. Final review and exam day: every decision on one page
    5. 33. Mock exam 1
    6. 34. Mock exam 2 Exam Pack · $12
  7. Extra practice: mock exams 3 and 4

    1. 35. Mock exam 3 Exam Pack · $12
    2. 36. Mock exam 4 Exam Pack · $12
See the leaderboard

19 min

IAM basics: users, groups, roles and policies

Grant the least access needed with IAM users, groups, roles and managed and custom policies.

By the end of this lesson you can

  • Choose an IAM user, group or role for a scenario
  • Read a short IAM policy and predict what it allows
  • Pick AWS managed, customer managed or inline policies
  • Apply least privilege with the right IAM review tool

From earlier lessons · 1 of 2

Cedar Lane Books runs MySQL on Amazon RDS. Under the shared responsibility model, who patches the database engine: AWS, you, or both?

Pick one answer.

From earlier lessons · 2 of 2

Which task is the customer's responsibility on every AWS service?

Pick one answer.

Cedar Lane Books has one AWS sign-in, and five people use it. The IT lead, three developers and an outside auditor all type the same password. Last week someone deleted a test database, and nobody knows who. Now the web server also needs to read product photos from Amazon S3. Everyone needs access, but not the same access.

[3]

What IAM does

Exam depth: know it cold.

AWS Identity and Access Management (IAM) controls who can use your AWS resources and what they can do.

It answers two questions on every request. Authentication asks who you are, for example by checking a password. Authorization asks what you are allowed to do, by checking your permissions.

Two facts the exam likes. IAM is global: you don't pick a Region for users, groups, roles or policies. And IAM is free: AWS charges only for the other services your identities use.

[26][79]

Users, groups and roles

Exam depth: know it cold.

  • An IAM user is one identity for one person or workload. It has long-term credentials: a console password, access keys, or both, which last until someone changes or deletes them.
  • An IAM group is a collection of IAM users. Permissions you attach to the group apply to every member. A user can belong to several groups.
  • An IAM role is an identity with permissions but no password or keys of its own. Someone assumes the role and gets temporary credentials that expire, from minutes to hours. People, AWS services such as Amazon EC2, and users in other AWS accounts can all assume roles.

[71][76][78]

Cedar Lane Books in IAMCedar Lane Books AWS accountGroup: DevelopersGroup: FinanceRole: WebServerReadPhotosUser: PriyaUser: TomUser: AnaWeb server on EC2Policies attach to the group;members get themAssumes the role and getstemporary credentials

[71][76]

UserGroupRole
What it is.One identity.A set of users.Permissions you assume.
Credentials.Long-term password or keys.None; members use their own.Temporary, issued on assume.
Can sign in?Yes.No.No; you switch to it.
Typical use.A person or tool that can't use a role.Same permissions for a team.EC2 apps, other accounts, short-term access.

Decision rule: a team that shares a job gets a group. An application on AWS, another account, or anyone needing short-term access gets a role. Create an IAM user only when nothing else works.

[71][76][77]

[71][77][78]

Cedar Lane Books' web application runs on Amazon EC2. It must read product photos from an Amazon S3 bucket. What is the MOST secure way to give the application access?

Pick one answer.

[77]

Policies: the permission documents

Exam depth: know it cold.

An IAM policy is a document, written in JSON, that lists permissions. JSON is a plain-text format of names and values. Each statement in a policy has:

  • Effect: Allow or Deny.
  • Action: what can be done, such as s3:GetObject, which reads a file from S3.
  • Resource: which item it applies to, named by its ARN, AWS's unique ID for a resource.
  • Condition (optional): when it applies, for example only after signing in with MFA.

Two rules decide every request. First, everything is denied by default. This is the implicit deny. Second, an explicit deny always beats an allow. One matching Deny blocks the request, whatever else allows it.

[74][75]

json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::cedar-product-photos/*"
}
]
}
Read it as: allow reading any file in the cedar-product-photos bucket. Nothing else is allowed.

[74]

Step through

How IAM decides one request

  1. Request0now
  2. Any Deny?1
  3. Any Allow?2
  4. Result3

Tom asks to delete a photo. IAM starts from deny: nothing is allowed yet.

Step 1 of 4

[75]

An IAM user is in two groups. One group's policy allows s3:DeleteObject on a bucket. The other group's policy explicitly denies s3:DeleteObject on the same bucket. What happens when the user tries to delete a file?

Pick one answer.

Two policies say Allow. One says Deny. Deny wins, and it isn't close. Picture: Whiteboard doodle style, black and blue marker on a white board, slightly messy hand-drawn lines.

AWS managed, customer managed and inline policies

Exam depth: know it cold.

Policy typeWho writes itCan you edit it?Attach to
AWS managed.AWS.No.Many identities.
Customer managed (custom).You.Yes.Many identities.
Inline.You.Yes.One identity only; deleted with it.

AWS managed policies are ready-made, such as AmazonS3ReadOnlyAccess. They are quick to start with, but they are written for every customer, so they often grant more than you need. A customer managed policy is one you write for your exact case.

Exam depth: recognize it. These are all identity-based policies: attached to a user, group or role. A resource-based policy is attached to a resource instead, such as an Amazon S3 bucket policy. It names who may use that resource.

[13][72][73]

Match

Match each need to the policy type

Pick an item on the left, then its match on the right.

[72][73]

Least privilege in practice

Exam depth: know it cold.

Least privilege means granting only the permissions a task needs, and no more. In practice:

  • Give permissions to groups, not to one user at a time. When someone changes jobs, move them to another group.
  • Start with AWS managed policies, then narrow to customer managed ones.
  • Review and remove what nobody uses.

Three IAM tools help with the review:

ToolWhat it shows
IAM Access Analyzer.Resources shared outside your account, unused access, and policies generated from real activity.
Last accessed information (the Last Accessed tab).When each service was last used by a user, group, role or policy.
Credential report.Every user and the status of their passwords, access keys and MFA devices.

[13][69][71][137][138]

An auditor asks Cedar Lane Books for a list of every IAM user, showing whether each has MFA turned on and when their access keys were last changed. Which IAM feature produces this?

Pick one answer.

[137]

Try it in the AWS console

IAM costs nothing, so this stays free.

  1. Sign in to the AWS Management Console and open the IAM console.
  2. In the navigation pane, choose User groups, then Create group.
  3. Name it cedar-readonly-test.
  4. Skip adding users.
  5. In the policy list, tick the AWS managed policy AmazonS3ReadOnlyAccess, then choose Create group.
  6. Open the group and look at its Permissions tab. Then delete the group so nothing is left behind.

These steps fit a standard AWS account. Accounts opened through AWS's newer sign-up experience, which uses projects and team members, can't create IAM users with console access. They invite people as team members instead.

[70][78][79]

Exam-style practice

A company hires 12 analysts who all need the same read-only access to billing data. New analysts join every month. Which approach follows AWS best practice with the LEAST ongoing effort?

Pick one answer.

[13][71]

A security team wants to replace a role's broad permissions with a policy based on the actions the role actually used over the last 90 days. Which AWS feature helps them do this?

Pick one answer.

[13][69]

FlashcardsIndex cardsFlashcards ⚡

Card 1 of 18

[69][71][73][74][75][76][79][137]

Worth keeping

  1. Users have long-term credentials, groups share permissions among users, roles hand out temporary credentials.
  2. Applications on EC2 get a role, never stored access keys.
  3. Everything is denied by default, and an explicit deny beats any allow.
  4. AWS managed policies are a quick start; customer managed policies fit least privilege.
  5. Credential report lists users' credentials; Access Analyzer and last accessed data find unused access.

On the job

Cedar Lane Books retires the shared password. Developers join a Developers group, finance joins Finance, and the web server gets a role to read photos. When a developer moves to marketing, the IT lead moves them between groups instead of editing permissions.

A project manager can use the same words in planning. "Who needs access, to what, for how long?" maps straight to group, policy and role. Finance staff often meet IAM through audits, where the credential report answers "who still has old keys?"

[13]

One sign-in sits above all of this: the root user, with full access to everything in the account. Next lesson: how to lock it away, and the few jobs only root can do.

Leaderboard

Loading…

50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.

Embed this practice on your site

Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.

Report a copyright problem with this lesson

Sources for this lesson (18)

Each fact in the lesson is marked with the number of the page it comes from.

  1. [3]AWS: CLF-C02 Content Domain 2: Security and Compliance
  2. [13]AWS: Security best practices in IAM
  3. [26]AWS: Global services (AWS Fault Isolation Boundaries)
  4. [69]AWS: Using AWS Identity and Access Management Access Analyzer
  5. [70]AWS: Create IAM groups
  6. [71]AWS: IAM user groups
  7. [72]AWS: Identity-based policies and resource-based policies
  8. [73]AWS: Managed policies and inline policies
  9. [74]AWS: Policies and permissions in AWS Identity and Access Management
  10. [75]AWS: How AWS enforcement code logic evaluates requests to allow or deny access
  11. [76]AWS: IAM roles
  12. [77]AWS: Use an IAM role to grant permissions to applications running on Amazon EC2 instances
  13. [78]AWS: IAM users
  14. [79]AWS: What is IAM?
  15. [102]AWS: Shared Responsibility Model
  16. [137]AWS: Generate credential reports for your AWS account
  17. [138]AWS: Refine permissions in AWS using last accessed information
  18. [244]AWS: What is Amazon Relational Database Service (Amazon RDS)?