Identity and Access Management (IAM)
What is IAM
A web service that allows you to securely control access to your AWS resources.
Manage permissions that control which resources Users can access.
Features
IAM is eventually consistent
Meaning that achieves high availability by replicating data across multiple servers around the world.
However these changes may take some time to replicate.
AWS recommeds that IAM changes should not be included in critical, high-availability code paths of the application. And be sure to verify that the changes have been propagated before production workflows depend on them.
Shared access to your AWS account.
Granular permissions.
Secure access to AWS resources for applications that run on
Amazon EC2.Identity Federationto grant permissions for users outside of AWS.Access log auditing using
CloudTrail.Payment Card Industry (PCI) Data Security Standard (DSS) Complience.
IAM is integrated with many AWS services like.
Free to use.
How it Works
Initial Steps
When you create an AWS account, you begin with one sign-in identity that has complete access to all AWS services and resources.
This identity is called the AWS account
root user.You can access it by the email and password provided when the account was created.
AWS strongly recommends that you don't use the
root userfor everyday tasks. (Use it only to perform tasks that onlyroot usercan perform like)
Use IAM to setup
IAM Usersin addition to theroot, and grant them access to the resources they need to succeed in their tasks.These new users will use their sign-in credentials to authenticate.
Cycle
A human or application uses their sign-in credentials to authenticate with AWS.
Authentication is provided by matching the sign-in credentials to a principal (
IAM User,Federated User,IAM Role, or application).
Next, a request is made to grant the principal access to resources.
E.g: When you firts sign in and are on the console Home page, you aren't accessing a specific service.
When you select a service, the request for authorization is sent to that service to see:
if you are in the list of authorized users,
what policies are being enforced to control the level of access granted,
and any other policies that might be in effect.
IAM Common Terms

Principals
A person or application that uses the AWS account
root user, anIAM User, or anIAM Roleto sign-in and make requests to AWS.Can be granted either permanent or temporary crendentials.
Typically
IAM Usersandroot userare granted permanent.While
IAM Rolesare granted temporary.
Principals include
Feredated Usersandassumed roles.
IAM Entity
Are IAM Resources that AWS uses for authentication.
Entities can be specified as a Principal in a resource-based policy.
Includes:
IAM UsersIAM Roles
IAM Identity
Are IAM Resources that can be authorized in
policiesto perform actions and to access resources.Includes:
IAM UsersIAM GroupsIAM Roles
IAM Resource
Are stored in IAM, you can add, edit, and remove them from IAM.
The number and size of IAM Resources in AWS are limited.
IAM User
IAM UserRepresent the person or application accessing your account to interact with AWS.
Consist of a name and credentials.
Are identified by:
A friendly name;
Amazon Resource Name (
ARN);arn:aws:iam::account-ID-without-hyphens:user/Bill
Unique identifier which is returned only when you use the
API,SDK,Tools for Windows Powershell, orAWS CLIto create the user.
Credentials can be assossiated to a user:
Console password.
Access keys. (access key ID and a secret access key)
SSH keys. (for use with
CodeCommit)
It is associated with one and only one AWS account.
IAM Group
IAM Group
Are collections of IAM users.
Groups let you specify permissions for multiple users.
Users assume the permissions of the group.
Users can belong to multiple groups.
Groups cannot be nested, can only contain Users.
IAM Role
IAM RoleIt is an
IAM Identitythat you can create that has specific permissions.Roles are intended to be assumed by one or more Users or Applications.
Does not have standard long-term credentials.
When you assume a Role, it provides you with temporary security credentials for your Role session.
You can use Roles to delegate access to Users, applications, or services that don't normally have access to your AWS resources.
E.g: Allow EC2 intances to access other AWS resources.
Identity federation using:
AWS Cognito.
OAUTH.
Enterprise Single Sign On with LDAP or Active Directory.
Identity Providers and Federation
If you already manage users outside of AWS, you can use
Identity Providersinstead of creatingIAM Users.They can use
OpenID Connect (OIDC), orSAML 2.0.
Are
IAM Rolecan be used to specify permissions for externally identified (federated) users.Max 5000 IAM users per account. Identity Federation enables unlimited temporary credentials.
Can be identified by your organization or a third-party identity provider like:
OAuth.
Enterprise Single Sign-On with LDAP or Active Directory.
Access Management
You manage access in AWS by creating
Policiesand attaching them toIAM IdentitiesorAWS Resources.AWS checks each
Policythat applies to the context of the request.If a single
Policydenies the request, AWS denies the entire request and stops evaluating policies. (Explicit Deny)By default, all requests are implicitly DENIED.
Policy
Are JSON documents in AWS that, when attached to an Identity or Resource, define their
Permissions.A Policy may have one or more
Permissions.
AWS evaluates these Policies when an
IAM Principalmakes a request.
Permission
What determine whether the request is allowed or denied in
Policies.
AWS Organizations

Allows multiple AWS accounts used by an organization to be part of an
Organization Unit (OU).Service Control Policies (SCPs)allow the whitelisting or blacklisting of services within an Organization Unit.A blacklisted service will not be available even if the IAM user or group policy allows it.
Benefits
Centrally manage policies across multiple AWS accounts.
Control access to AWS services.
Automate AWS account creation and management programatically with APIs.
Consolidate billing across multiple AWS accounts.
IAM Best Practices
Grant
Least Privilegeaccess.Give people access only to the minimum that they need.
Lock away your AWS account Root User Access Keys.
Require human users and workloads to use temporary credentials.
Rotate Credentials regularly.
Require
Multi-Factor Authentication (MFA).Regularly review and remove unused users, roles, permission, policies and credentials.
Monitor activity in your AWS Account. (eg.
CloudTrail)Use conditions in
IAM Policiesfor further restrict access.Use
IAM Access Analyserto validate youIAM Policiesand ensure functional permissions.Delegate by using
Rolesinstead of by sharing credentials.
Last updated