cvwiki

IAM

Nov 5, 2022

# Identity Access Management

# IAM Identity Policy Document

# Managed Policies

# IAM Users

# IAM User Limits

# IAM Groups

# IAM Roles

When might you use roles?

# Service Linked Roles

# SAML2.0 Identity Federation

# API/CLI Credential Process

# Console Credential Process

# ARNs

# #aws-sysops Scenarios


Question: A SysOps Administrator needs to grant a user the ability to pass any of the approved set of roles to the Amazon EC2 service upon launching an instance. This will enable the user to start an EC2 instance with an assigned role. In effect, the applications running on the instance can access temporary credentials for the role through the instance profile metadata. What must the Administrator do to accomplish this requirement? Answer: To configure many AWS services, you must pass an IAM role to the service. This allows the service to later assume the role and perform actions on your behalf. You only have to pass the role to the service once during setup, and not every time the service assumes the role. For example, assume that you have an application running on an Amazon EC2 instance. That application requires temporary credentials for authentication, and permissions to authorize the application to perform actions in AWS. When you set up the application you must pass a role to EC2 to use with the instance that provides those credentials. You define the permissions for the applications running on the instance by attaching an IAM policy to the role. The application assumes the role every time it needs to perform the actions that are allowed by the role. To pass a role (and it’s permissions) to an AWS service, a user must have permissions to pass the role to the service. This helps administrators ensure that only approved users can configure a service with a role that grants permissions. To allow a user to pass a role to an AWS service, you must grant the PassRole permission to the user’s IAM user, role, or group. If you want to grant a user the ability to pass any of an approved set of roles to the Amazon EC2 service upon launching an instance, you need these three elements:

  1. An IAM permissions policy attached to the role determines what the role can do. You should scope permissions to only the actions that the role must perform, and to only the resources that the role needs for those actions.
  2. A trust policy for the role that allows the service to assume the role. You could attach a trust policy to the role with the UpdateAssumeRolePolicy action. With a trust policy, it allows Amazon EC2 to use the role and the permissions attached to the role.
  3. Another IAM permissions policy which is attached to the IAM user allows the user to pass only those roles that are approved. The iam:PassRole permission usually is accompanied by iam:GetRole permission so that the user can get the details of the role to be passed.

Question: An administrator has launched new AWS accounts. Management wants that IAM users across all accounts be able to sign in using a single login URL as shown below:

https://connerv.signin.aws.amazon.com/console

How can the administrator meet the requirement?

Answer: Having a single login URL for different AWS accounts is not possible.

The AWS account root user and AWS Identity and Access Management (IAM) users in the account sign in using a web URL. The sign-in page URL for your account’s IAM users has the following format, by default: https://123456789123.signin.aws.amazon.com/console/

If you create an AWS account alias for your AWS account ID, the IAM user sign-in page URL looks like the following example: https://connerv.signin.aws.amazon.com/console

Your AWS account can only have one alias. If you create a new alias for your AWS account, the new alias overwrites the previous alias. The URL containing the previous alias stops working. Also, the account alias must be unique across all AWS products and must contain only lowercase letters, digits, and hyphens.