1. LPU MCA Semester 1
  2. CAP470
  3. Unit 8

CAP470 · Unit 8: AWS authentication and authorization

IAM users, groups and roles

12 practice questions · in the ETE syllabus

Key points

  • Users have long-term credentials; roles have temporary ones
  • Groups manage many users and cannot be nested
  • Roles need a permissions policy and a trust policy
  • Protect the root user with MFA

An IAM user is an identity for one person or application, with its own name and credentials (a console password and/or access keys). An IAM group is a collection of users, used to manage permissions for many users at once: policies attached to the group apply to every member. A user can belong to several groups, and permissions from all groups combine, but a group cannot contain another group and a group cannot sign in.

An IAM role is an identity with permissions that is assumed temporarily by users, applications or AWS services. Assuming a role returns temporary credentials issued by the AWS Security Token Service (STS), so no long-term keys are stored. A role has two kinds of policy: a permissions policy (what it can do) and a trust policy (who may assume it).

IdentityCredentialsTypical use
UserLong-term (password, access keys)A person or application
GroupNoneManage many users
RoleTemporary (via STS)EC2 instances, cross-account access, short-term access

The root user has complete access to the account, so protect it with MFA and use it only for the few tasks that require it.

Exam trap: for an application on an EC2 instance, use a role, not access keys stored in the code.

Try two questions

Question 1 · Tier 3, Apply

Which AWS service issues the temporary credentials that are used when a role is assumed?

  1. AWS Security Token Service (STS)
  2. Amazon S3
  3. Amazon CloudFront
  4. Amazon Route 53
Show the answer

A. STS returns temporary access keys and a session token.

Why not B: S3 stores objects.

Why not C: CloudFront delivers content.

Why not D: Route 53 provides DNS.

Question 2 · Tier 3, Apply

A user is a member of two groups. One group allows reading S3 and the other allows writing to S3. What are the user's permissions?

  1. Only the permissions of the first group
  2. Only the permissions of the second group
  3. No permissions, because the groups conflict
  4. The combined permissions of both groups
Show the answer

D. Policies from every group (and the user) are evaluated together.

Why not A: Permissions from all groups are combined.

Why not B: Permissions from all groups are combined.

Why not C: Allows from different groups add up unless a deny applies.