Security, Identity & Compliance | AWS Identity and Access Management (IAM) Flashcards
What is AWS Identity and Access Management (IAM)?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can use AWS IAM to securely control individual and group access to your AWS resources. You can create and manage user identities (“IAM users”) and grant permissions for those IAM users to access your resources. You can also grant permissions for users outside of AWS (federated users).
How do I get started with IAM?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
To start using IAM, you must subscribe to at least one of the AWS services that is integrated with IAM. You then can create and manage users, groups, and permissions via IAM APIs, the AWS CLI, or the IAM console, which gives you a point-and-click, web-based interface. You can also use the visual editor to create policies.
What problems does IAM solve?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM makes it easy to provide multiple users secure access to your AWS resources. IAM enables you to:
Manage IAM users and their access: You can create users in AWS’s identity management system, assign users individual security credentials (such as access keys, passwords, multi-factor authentication devices), or request temporary security credentials to provide users access to AWS services and resources. You can specify permissions to control which operations a user can perform.
Manage access for federated users: You can request security credentials with configurable expirations for users who you manage in your corporate directory, allowing you to provide your employees and applications secure access to resources in your AWS account without creating an IAM user account for them. You specify the permissions for these security credentials to control which operations a user can perform.
Who can use IAM?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Any AWS customer can use IAM. The service is offered at no additional charge. You will be charged only for the use of other AWS services by your users.
What is a user?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
A user is a unique identity recognized by AWS services and applications. Similar to a login user in an operating system like Windows or UNIX, a user has a unique name and can identify itself using familiar security credentials such as a password or access key. A user can be an individual, system, or application requiring access to AWS services. IAM supports users (referred to as “IAM users”) managed in AWS’s identity management system, and it also enables you to grant access to AWS resources for users managed outside of AWS in your corporate directory (referred to as “federated users”).
What can a user do?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
A user can place requests to web services such as Amazon S3 and Amazon EC2. A user’s ability to access web service APIs is under the control and responsibility of the AWS account under which it is defined. You can permit a user to access any or all of the AWS services that have been integrated with IAM and to which the AWS account has subscribed. If permitted, a user has access to all of the resources under the AWS account. In addition, if the AWS account has access to resources from a different AWS account, its users may be able to access data under those AWS accounts. Any AWS resources created by a user are under control of and paid for by its AWS account. A user cannot independently subscribe to AWS services or control resources.
How do users call AWS services?
General
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Users can make requests to AWS services using security credentials. Explicit permissions govern a user’s ability to call AWS services. By default, users have no ability to call service APIs on behalf of the account.
How do I get started with IAM?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
To start using IAM, you must subscribe to at least one of the AWS services that is integrated with IAM. You then can create and manage users, groups, and permissions via IAM APIs, the AWS CLI, or the IAM console, which gives you a point-and-click, web-based interface. You can also use the AWS Policy Generator to create policies.
How are IAM users managed?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM supports multiple methods to:
Create and manage IAM users.
Create and manage IAM groups.
Manage users’ security credentials.
Create and manage policies to grant access to AWS services and resources.
You can create and manage users, groups, and policies by using IAM APIs, the AWS CLI, or the IAM console. You also can use the visual editor and the IAM policy simulator to create and test policies.
What is a group?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
A group is a collection of IAM users. Manage group membership as a simple list:
Add users to or remove them from a group.
A user can belong to multiple groups.
Groups cannot belong to other groups.
Groups can be granted permissions using access control policies. This makes it easier to manage permissions for a collection of users, rather than having to manage permissions for each individual user.
Groups do not have security credentials, and cannot access web services directly; they exist solely to make it easier to manage user permissions. For details, see Working with Groups and Users.
What kinds of security credentials can IAM users have?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM users can have any combination of credentials that AWS supports, such as an AWS access key, X.509 certificate, SSH key, password for web app logins, or an MFA device. This allows users to interact with AWS in any manner that makes sense for them. An employee might have both an AWS access key and a password; a software system might have only an AWS access key to make programmatic calls; IAM users might have a private SSH key to access AWS CodeCommit repositories; and an outside contractor might have only an X.509 certificate to use the EC2 command-line interface. For details, see Temporary Security Credentials in the IAM documentation.
Which AWS services support IAM users?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can find the complete list of AWS services that support IAM users in the AWS Services That Work with IAM section of the IAM documentation. AWS plans to add support for other services over time.
Can I enable and disable user access?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. You can enable and disable an IAM user’s access keys via the IAM APIs, AWS CLI, or IAM console. If you disable the access keys, the user cannot programmatically access AWS services.
Who is able to manage users for an AWS account?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
The AWS account holder can manage users, groups, security credentials, and permissions. In addition, you may grant permissions to individual users to place calls to IAM APIs in order to manage other users. For example, an administrator user may be created to manage users for a corporation—a recommended practice. When you grant a user permission to manage other users, they can do this via the IAM APIs, AWS CLI, or IAM console.
Can I structure a collection of users in a hierarchical way, such as in LDAP?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. You can organize users and groups under paths, similar to object paths in Amazon S3—for example /mycompany/division/project/joe.
Can I define users regionally?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Not initially. Users are global entities, like an AWS account is today. No region is required to be specified when you define user permissions. Users can use AWS services in any geographic region.
How are MFA devices configured for IAM users?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You (the AWS account holder) can order multiple MFA devices. You can then assign these devices to individual IAM users via the IAM APIs, AWS CLI, or IAM console.
What kind of key rotation is supported for IAM users?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
User access keys and X.509 certificates can be rotated just as they are for an AWS account’s root access identifiers. You can manage and rotate programmatically a user’s access keys and X.509 certificates via the IAM APIs, AWS CLI, or IAM console.
Can IAM users have individual EC2 SSH keys?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Not in the initial release. IAM does not affect EC2 SSH keys or Windows RDP certificates. This means that although each user has separate credentials for accessing web service APIs, they must share SSH keys that are common across the AWS account under which users have been defined.
Where can I use my SSH keys?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Currently, IAM users can use their SSH keys only with AWS CodeCommit to access their repositories.
Do IAM user names have to be email addresses?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
No, but they can be. User names are just ASCII strings that are unique within a given AWS account. You can assign names using any naming convention you choose, including email addresses.
Which character sets can I use for IAM user names?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can only use ASCII characters for IAM entities.
Are user attributes other than user name supported?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Not at this time.
How are user passwords set?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can set an initial password for an IAM user via the IAM console, AWS CLI, or IAM APIs. User passwords never appear in clear text after the initial provisioning, and are never displayed or returned via an API call. IAM users can manage their passwords via the My Password page in the IAM console. Users access this page by selecting the Security Credentials option from the drop-down list in the upper right corner of the AWS Management Console.
Can I define a password policy for my user’s passwords?
IAM User Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes, you can enforce strong passwords by requiring minimum length or at least one number. You can also enforce automatic password expiration, prevent re-use of old passwords, and require a password reset upon the next AWS sign-in. For details, see Setting an Account Policy Password for IAM Users.
Can I set usage quotas on IAM users?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
No. All limits are on the AWS account as a whole. For example, if your AWS account has a limit of 20 Amazon EC2 instances, IAM users with EC2 permissions can start instances up to the limit. You cannot limit what an individual user can do.
What is an IAM role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
An IAM role is an IAM entity that defines a set of permissions for making AWS service requests. IAM roles are not associated with a specific user or group. Instead, trusted entities assume roles, such as IAM users, applications, or AWS services such as EC2.
What problems do IAM roles solve?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM roles allow you to delegate access with defined permissions to trusted entities without having to share long-term access keys. You can use IAM roles to delegate access to IAM users managed within your account, to IAM users under a different AWS account, or to an AWS service such as EC2.
How do I get started with IAM roles?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You create a role in a way similar to how you create a user—name the role and attach a policy to it. For details, see Creating IAM Roles.
How do I assume an IAM role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You assume an IAM role by calling the AWS Security Token Service (STS) AssumeRole APIs (in other words, AssumeRole, AssumeRoleWithWebIdentity, and AssumeRoleWithSAML). These APIs return a set of temporary security credentials that applications can then use to sign requests to AWS service APIs.
How many IAM roles can I assume?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
There is no limit to the number of IAM roles you can assume, but you can only act as one IAM role when making requests to AWS services.
Who can use IAM roles?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Any AWS customer can use IAM roles.
How much do IAM roles cost?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM roles are free of charge. You will continue to pay for any resources a role in your AWS account consumes.
How are IAM roles managed?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can create and manage IAM roles via the IAM APIs, AWS CLI, or IAM console, which gives you a point-and-click, web-based interface.
What is the difference between an IAM role and an IAM user?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
An IAM user has permanent long-term credentials and is used to directly interact with AWS services. An IAM role does not have any credentials and cannot make direct requests to AWS services. IAM roles are meant to be assumed by authorized entities, such as IAM users, applications, or an AWS service such as EC2.
When should I use an IAM user, IAM group, or IAM role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
An IAM user has permanent long-term credentials and is used to directly interact with AWS services. An IAM group is primarily a management convenience to manage the same set of permissions for a set of IAM users. An IAM role is an AWS Identity and Access Management (IAM) entity with permissions to make AWS service requests. IAM roles cannot make direct requests to AWS services; they are meant to be assumed by authorized entities, such as IAM users, applications, or AWS services such as EC2. Use IAM roles to delegate access within or between AWS accounts.
Can I add an IAM role to an IAM group?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Not at this time.
How many policies can I attach to an IAM role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
For inline policies: You can add as many inline policies as you want to a user, role, or group, but the total aggregate policy size (the sum size of all inline policies) per entity cannot exceed the following limits:
User policy size cannot exceed 2,048 characters.
Role policy size cannot exceed 10,240 characters.
Group policy size cannot exceed 5,120 characters.
For managed policies: You can add up to 10 managed policies to a user, role, or group. The size of each managed policy cannot exceed 6,144 characters.
How many IAM roles can I create?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You are limited to 1,000 IAM roles under your AWS account. If you need more roles, submit the IAM limit increase request form with your use case, and we will consider your request.
To which services can my application make requests?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Your application can make requests to all AWS services that support role sessions.
What is IAM roles for EC2 instances?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM roles for EC2 instances enables your applications running on EC2 to make requests to AWS services such as Amazon S3, Amazon SQS, and Amazon SNS without you having to copy AWS access keys to every instance. For details, see IAM Roles for Amazon EC2.
What are the features of IAM roles for EC2 instances?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM roles for EC2 instances provides the following features:
AWS temporary security credentials to use when making requests from running EC2 instances to AWS services.
Automatic rotation of the AWS temporary security credentials.
Granular AWS service permissions for applications running on EC2 instances.
What problem does IAM roles for EC2 instances solve?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM roles for EC2 instances simplifies management and deployment of AWS access keys to EC2 instances. Using this feature, you associate an IAM role with an instance. Then your EC2 instance provides the temporary security credentials to applications running on the instance, and the applications can use these credentials to make requests securely to the AWS service resources defined in the role.
How do I get started with IAM roles for EC2 instances?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
To understand how roles work with EC2 instances, you need to use the IAM console to create a role, launch an EC2 instance that uses that role, and then examine the running instance. You can examine the instance metadata to see how the role credentials are made available to an instance. You can also see how an application that runs on an instance can use the role. For more details, see How Do I Get Started?
Can I use the same IAM role on multiple EC2 instances?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes.
Can I change the IAM role on a running EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. Although a role is usually assigned to an EC2 instance when you launch it, a role can also be assigned to an EC2 instance that is already running. To learn how to assign a role to a running instance, see IAM Roles for Amazon EC2. You can also change the permissions on the IAM role associated with a running instance, and the updated permissions take effect almost immediately.
Can I associate an IAM role with an already running EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. You can assign a role to an EC2 instance that is already running. To learn how to assign a role to an already running instance, see IAM Roles for Amazon EC2.
Can I associate an IAM role with an Auto Scaling group?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. You can add an IAM role as an additional parameter in an Auto Scaling launch configuration and create an Auto Scaling group with that launch configuration. All EC2 instances launched in an Auto Scaling group that is associated with an IAM role are launched with the role as an input parameter. For more details, see What Is Auto Scaling? in the Auto Scaling Developer Guide.
Can I associate more than one IAM role with an EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
No. You can only associate one IAM role with an EC2 instance at this time. This limit of one role per instance cannot be increased.
What happens if I delete an IAM role that is associated with a running EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Any application running on the instance that is using the role will be denied access immediately.
Can I control which IAM roles an IAM user can associate with an EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. For details, see Permissions Required for Using Roles with Amazon EC2.
Which permissions are required to launch EC2 instances with an IAM role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You must grant an IAM user two distinct permissions to successfully launch EC2 instances with roles:
Permission to launch EC2 instances.
Permission to associate an IAM role with EC2 instances.
For details, see Permissions Required for Using Roles with Amazon EC2.
Who can access the access keys on an EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Any local user on the instance can access the access keys associated with the IAM role.
How do I use the IAM role with my application on the EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
If you develop your application with the AWS SDK, the AWS SDK automatically uses the AWS access keys that have been made available on the EC2 instance. If you are not using the AWS SDK, you can retrieve the access keys from the EC2 instance metadata service. For details, see Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances.
How do I rotate the temporary security credentials on the EC2 instance?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
The AWS temporary security credentials associated with an IAM role are automatically rotated multiple times a day. New temporary security credentials are made available no later than five minutes before the existing temporary security credentials expire.
Can I use IAM roles for EC2 instances with any instance type or Amazon Machine Image?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. IAM roles for EC2 instances also work in Amazon Virtual Private Cloud (VPC), with spot and reserved instances.
What is a service-linked role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
A service-linked role is a type of role that links to an AWS service (also known as a linked service) such that only the linked service can assume the role. Using these roles, you can delegate permissions to AWS services to create and manage AWS resources on your behalf.
Can I assume a service-linked role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
No. A service-linked role can be assumed only by the linked service. This is the reason why the trust policy of a service-linked role cannot be modified.
Can I delete a service-linked role?
IAM Role Management
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Yes. If you no longer want an AWS service to perform actions on your behalf, you can delete its service-linked role. Before you delete the role, you must delete all AWS resources that depend on the role. This step ensures that you do not inadvertently delete a role required for your AWS resources to function properly.
How do I delete a service-linked role?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can delete a service-linked role from the IAM console. Choose Roles in the navigation pane, choose the service-linked role that you want to delete, and choose Delete role. (Note: For Amazon Lex, you must use the Amazon Lex console to delete the service-linked role.)
How do permissions work?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Access control policies are attached to users, groups, and roles to assign permissions to AWS resources. By default, IAM users, groups, and roles have no permissions; users with sufficient permissions must use a policy to grant the desired permissions.
How do I assign permissions using a policy?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
To set permissions, you can create and attach policies using the AWS Management Console, the IAM API, or the AWS CLI. Users who have been granted the necessary permissions can create policies and assign them to IAM users, groups, and roles.
What are managed policies?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Managed policies are IAM resources that express permissions using the IAM policy language. You can create, edit, and manage separately from the IAM users, groups, and roles to which they are attached. After you attach a managed policy to multiple IAM users, groups, or roles, you can update that policy in one place and the permissions automatically extend to all attached entities. Managed policies are managed either by you (these are called customer managed policies) or by AWS (these are called AWS managed policies). For more information about managed policies, see Managed Policies and Inline Policies.
How do I create a customer managed policy?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
You can use the visual editor or the JSON editor in the IAM console. The visual editor is a point-and-click editor that guides you through the process of granting permissions in a policy without requiring you to write the policy in JSON. You can create policies in JSON by using the CLI and SDK.
How do I assign commonly used permissions?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
AWS provides a set of commonly used permissions that you can attach to IAM users, groups, and roles in your account. These are called AWS managed policies. One example is read-only access for Amazon S3. When AWS updates these policies, the permissions are applied automatically to the users, groups, and roles to which the policy is attached. AWS managed policies automatically appear in the Policies section of the IAM console. When you assign permissions, you can use an AWS managed policy or you can create your own customer managed policy. Create a new policy based on an existing AWS managed policy, or define your own.
How do group-based permissions work?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Use IAM groups to assign the same set of permissions to multiple IAM users. A user can also have individual permissions assigned to them. The two ways to attach permissions to users work together to set overall permissions.
What is the difference between assigning permissions using IAM groups and assigning permissions using managed policies?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Use IAM groups to collect IAM users and define common permissions for those users. Use managed policies to share permissions across IAM users, groups, and roles. For example, if you want a group of users to be able to launch an Amazon EC2 instance, and you also want the role on that instance to have the same permissions as the users in the group, you can create a managed policy and assign it to the group of users and the role on the Amazon EC2 instance.
How are IAM policies evaluated in conjunction with Amazon S3, Amazon SQS, Amazon SNS, and AWS KMS resource-based policies?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
IAM policies are evaluated together with the service’s resource-based policies. When a policy of any type grants access (without explicitly denying it), the action is allowed. For more information about the policy evaluation logic, see IAM Policy Evaluation Logic.
Can I use a managed policy as a resource-based policy?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Managed policies can only be attached to IAM users, groups, or roles. You cannot use them as resource-based policies.
How do I set granular permissions using policies?
Permissions
AWS Identity and Access Management (IAM) | Security, Identity & Compliance
Using policies, you can specify several layers of permission granularity. First, you can define specific AWS service actions you wish to allow or explicitly deny access to. Second, depending on the action, you can define specific AWS resources the actions can be performed on. Third, you can define conditions to specify when the policy is in effect (for example, if MFA is enabled or not).