IAM Flashcards
Why do IAM Roles exist?
Applications must sign their API requests with AWS credentials.
You need a strategy for managing credentials for your applications that run on EC2 instances.
You can distribute credentials to instances and use them, but there is management overhead and its not as secure. Especially when instances are managed by SPOT etc..
Rotating creds is also a challenge.
IAM Roles exist to make secure API requests from an instance without requiring cred management. Instead of creating and distributing creds, you can delegate permissions with roles.
It also makes permission management easier when services can temporarily assume roles without the policies having to be updated.
What are the two different types of users in AWS and how do they differ in terms of permissions?
Account owner (root user) or AWS Identity and Access Management (IAM) user.
- The root user is created when the AWS account is created.
- IAM users are created by the root user or an IAM administrator for the account. All AWS users have security credentials.
- You cannot use IAM policies to explicitly deny the root user access to resources. You can only use an AWS Organizations service control policy (SCP) to limit the permissions of the root user.
- There are specific tasks that are restricted to the AWS account root user. For example, only the root user can close your account. If you need to perform a task that requires the root user, sign in to the AWS Management Console using the email address and password of the root user.
- With IAM, you can securely control access to AWS services and resources for users in your AWS account. For example, if you require administrator-level permissions, you can create an IAM user, grant that user full access, and then use those credentials to interact with AWS. If you need to modify or revoke your permissions, you can delete or modify the policies that are associated with that IAM user.
- If you have multiple users that require access to your AWS account, you can create unique credentials for each user and define who has access to which resources. You don’t need to share credentials. For example, you can create IAM users with read-only access to resources in your AWS account and distribute those credentials to users.
What type of credentials are required for console access? What is special about the Root user and IAM user?
Email Address and Password.
Root user has the main email address and password.
IAM user
This user needs an account alias or 12-digit AWS account ID, the IAM user name, and the password for the IAM user.
What is IAM?
AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.
What is the root user?
When you first create an AWS account, you begin with a single sign-in identity that has complete access to all AWS services and resources in the account. This identity is called the AWS account root user and is accessed by signing in with the email address and password that you used to create the account.
What are IAM Users?
IAM users can be created to correspond with users in your organisation or you can create user groups. Users need to be authenticated to use AWS resources and creating an IAM user is the way to do this.
IAM Groups manage permissions for a group of users.
What is an IAM Policy?
By default users can’t access anything in your accounts. You need to create permissions to AUTHORIZE users using policies.
A policy is a JSON document that explicitly states what permissions a user has.
What does an IAM Policy document contain?
An Policy document is a JSON document that contains:
- the affect
- Actions
- Resources
- Optional contitions
for the API calls that an entity can invoke.
Anything that is not explicitly allowed is denied by default.
The JSON Document contains a:
- SID - Who or what is being authorized, User, Group or Resource within AWS.
- Effect - self explanitory
- Action Valiue - What actions on the API can be performed.
- Condition - The condition to be succesfull. For example, only calls from the listed IP Addresses.
- Finaly the policy describes the resources to which the tasks can be performed.
Typically how would IAM users and groups work with policies?
- Create a user.
- Create a group of users.
- Create a policy.
- Assign the policy to the Group.
- Add users to the group etc.
What is an IAM Role, how does it interact with policies.
IAM Policies my be assigned to an IAM role.
IAM role is similar to a user in that it is an AWS Identity with permissions that say what the identity can do.
A role does not have long term creds, password or access keys or anything associated to it.
The user is assigned to a role and the access keys are temporarily assigned.
IAM roles can be used to give access to users, applications and services that dont normally have access to your resources.
User that assumes role temporarily gives up current permissions and assumes permission of the role.
What are credentials and the different types of long term credentials for an IAM user?
Credentials - This is just the overall term used for the information AWS needs to authenticate and authorize you.
Detail: When you interact with AWS, you specify your AWS security credentials to verify who you are and whether you have permission to access the resources that you are requesting. AWS uses the security credentials to authenticate and authorize your requests.
Long term IAM Creds:
- Passwords – Used to sign in to secure AWS pages, such as the AWS Management Console and the AWS Discussion Forums.
- Access keys – Used to make programmatic calls to AWS from the AWS APIs, AWS CLI, AWS SDKs, or AWS Tools for Windows PowerShell.
- Amazon CloudFront key pairs – Used for CloudFront to create signed URLs.
- SSH public keys – Used to authenticate to AWS CodeCommit repositories.
Explain a real world scenario for an IAM role.
There is a custom app in your EC2 Instance.
You could embed your AWS credentials in the code. But that could compromise credentails.
Changing or rotating credentials require update to code.
Alternative, more secure option is to use an IAM role to pass temporary credentials as part of an instance profile. The service would use the role assumed by the instance to do the action.
Scenario 2
Users also get assigned policies for temporary privilages they dont normally have.
you would create the policy and then the role. The user can then assume the role and temorary gain those permissions. Thus a user policy does not need to change all the time.
What are Credentials for Console Access?
- To sign in to your AWS account as the root user, you provide this email address and password
- IAM users are created by the root user or an IAM administrator within the AWS account. The user who created your IAM user should provide you with either the account alias or 12-digit AWS account ID, the IAM user name, and the password for the IAM user. An IAM user can sign in using either the console sign-in page or the following sign-in URL, replacing account_id_or_alias with either the account alias or AWS account ID provided to you:
https://account_id_or_alias.signin.aws.amazon.com/console/
What are credentials for programattic AWS access?
AWS access keys to make programmatic calls to AWS or to use the AWS Command Line Interface or AWS Tools for PowerShell.
Access Keys consist of an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY) as a set.
What are Temporary Security Credentials?
In addition to the access key ID and secret access key, temporary security credentials include a security token that you must send to AWS when you use temporary security credentials. The advantage of temporary security credentials is that they are short term. After they expire, they’re no longer valid.
You can use temporary access keys in less secure environments or distribute them to grant users temporary access to resources in your AWS account. For example, you can grant entities from other AWS accounts access to resources in your AWS account (cross-account access). You can also grant users who don’t have AWS security credentials access to resources in your AWS account (federation). For more information, see aws sts assume-role.
What is assume-role?
TBC