An enterprise wants to use a third-party SaaS application. The SaaS application needs to have access to issue
several API commands to discover Amazon EC2 resources running within the enterprise’s account The
enterprise has internal security policies that require any outside access to their environment must conform to
the principles of least privilege and there must be controls in place to ensure that the credentials used by the
SaaS vendor cannot be used by any other third party.
Which of the following would meet all of these conditions?
From the AWS Management Console, navigate to the Security Credentials page and retrieve the access
and secret key for your account.
Create an IAM user within the enterprise account assign a user policy to the IAM user that allows only the
actions required by the SaaS application create a new access and secret key for the user and provide these
credentials to the SaaS provider.
Create an IAM role for cross-account access allows the SaaS provider’s account to assume the role and
assign it a policy that allows only the actions required by the SaaS application.
Create an IAM role for EC2 instances, assign it a policy that allows only the actions required tor the Saas
application to work, provide the role ARN to the SaaS provider to use when launching their application
Granting Cross-account Permission to objects It Does Not Own
In this example scenario, you own a bucket and you have enabled other AWS accounts to upload objects. That
is, your bucket can have objects that other AWS accounts own.
Now, suppose as a bucket owner, you need to grant cross-account permission on objects, regardless of who
the owner is, to a user in another account. For example, that user could be a billing application that needs to
access object metadata. There are two core issues:
The bucket owner has no permissions on those objects created by other AWS accounts. So for the bucket
owner to grant permissions on objects it does not own, the object owner, the AWS account that created the
objects, must first grant permission to the bucket owner. The bucket owner can then delegate those
Bucket owner account can delegate permissions to users in its own account but it cannot delegate permissions
to other AWS accounts, because cross-account delegation is not supported.
In this scenario, the bucket owner can create an AWS Identity and Access Management (IAM) role with
permission to access objects, and grant another AWS account permission to assume the role temporarily
enabling it to access objects in the bucket.
Background: Cross-Account Permissions and Using IAM Roles
IAM roles enable several scenarios to delegate access to your resources, and cross-account access is one of
the key scenarios. In this example, the bucket owner, Account A, uses an IAM role to temporarily delegate
object access cross-account to users in another AWS account, Account C. Each IAM role you create has two
policies attached to it:
A trust policy identifying another AWS account that can assume the role.
An access policy defining what permissions—for example, s3:GetObject—are allowed when someone assumes
the role. For a list of permissions you can specify in a policy, see Specifying Permissions in a Policy.
The AWS account identified in the trust policy then grants its user permission to assume the role. The user can
then do the following to access objects:
Assume the role and, in response, get temporary security credentials.
Using the temporary security credentials, access the objects in the bucket.
For more information about IAM roles, go to Roles (Delegation and Federation) in IAM User Guide.
The following is a summary of the walkthrough steps:
Account A administrator user attaches a bucket policy granting Account B conditional permission to upload
Account A administrator creates an IAM role, establishing trust with Account C, so users in that account can
access Account A. The access policy attached to the role limits what user in Account C can do when the user
accesses Account A.
Account B administrator uploads an object to the bucket owned by Account A, granting full-control permission
to the bucket owner.Account C administrator creates a user and attaches a user policy that allows the user to assume the role.
User in Account C first assumes the role, which returns the user temporary security credentials. Using those
temporary credentials, the user then accesses objects in the bucket.
For this example, you need three accounts. The following table shows how we refer to these accounts and the
administrator users in these accounts. Per IAM guidelines (see About Using an Administrator User to Create
Resources and Grant Permissions) we do not use the account root credentials in this walkthrough. Instead, you
create an administrator user in each account and use those credentials in creating resources and granting them