Authentication
Who is requesting access to the AWS account and the resources in it?
- Establish the identity of the requester through credentials
- The requester could be a person or an application
Authentication
Who is requesting access to the AWS account and the resources in it?
Authorization
After the requester has been authenticated, what should they be allowed to do?
Think of a bank that allows customers to access accounts online:
“With authentication, you can use the identity of requesters to control who can use your AWS resources. With authorization, you can also use access management to control what resources requesters can use and in what ways.”
IAM controls individual and group access to AWS resources with the following capabilities:
Term | Definition |
---|---|
IAM resource | User, group, role, policy and identity-provider objects stored in IAM |
IAM entity | IAM resource objects that are used by AWS for authentication (users and roles) |
IAM identity | IAM resource objects that can be authorized in policies to perform actions and access resources (user, group, or role) |
Principal | Person or application that can sign in and make requests to AWS |
IAM User
A person or application that can authenticate with an AWS account. Given a permanent set of credentials that stay with the user until forced rotation occurs.
IAM Group
A collection of IAM users. Use groups to grant the same set of permissions to multiple users.
IAM Role
Similar to a user but doesn’t have long-term credentials. When assumed, provides temporary security credentials for the role session.
IAM Policy
A document that explicitly lists permissions. Can be attached to an IAM user, group, role, or any combination of these resources.
Action | Credentials Needed |
---|---|
Sign in to AWS Management Console | Username and password |
Run commands from AWS CLI | AWS access key* |
Make programmatic calls to AWS | AWS access key* |
*An AWS access key is a combination of an access key ID and a secret key.
“An IAM user who is a member of an IAM group inherits the permissions that are attached to that group.”
You can attach IAM policies directly to an IAM user to further customize access granted through the group, but the recommended approach is group-based management.
Cross-account access: IAM user in AWS account 1 needs temporary access to an EC2 instance - create IAM role with necessary permissions that the user can assume
EC2 application access: Application on EC2 instance needs S3 bucket access - create IAM role, add to instance profile, attach profile to instance
Cross-account S3 access: IAM user in AWS account 2 needs S3 bucket access in AWS account 1 - create cross-account IAM role in account 1 defining account 2 as trusted entity
“When you use IAM roles, you don’t need to grant long-term security credentials to each entity that requires access to a resource.”
This section covered the fundamental concepts of authentication and authorization in AWS, focusing on IAM as the central service for managing access control through users, groups, roles, and policies while emphasizing security best practices and proper root user protection.