Let’s Get Certified
Module 02 / 15 · Design secure architectures

Grant access across accounts

Turn a workforce identity into a short-lived, auditable session with only the required permissions.

Task 1.1 · Grant access across accounts

Start with the principal

Write down who initiates the request, which account owns the resource, and the exact action and resource ARN. A developer signing in, an EC2 process reading an object, and a customer using a mobile app have different identities. Federate employees from the corporate directory through IAM Identity Center, assign groups to permission sets and accounts, and have workloads assume IAM roles for temporary credentials. Cognito user pools handle application sign-in. A group is a collection of IAM users and cannot be assumed by a workload.

Trace a cross-account role

Suppose an analyst in Research needs read access to Finance reports. The caller needs permission to assume the Finance role. Its trust policy must accept that caller. The role's permissions must allow the actual reads on the intended prefix. Listing a bucket and reading an object use different actions and resource types. If reports use a customer managed KMS key, also evaluate decrypt permission and the key policy. Test one intended read and one read outside the prefix with an approved test identity.

Set a ceiling for many accounts

Use Organizations to group accounts with common guardrails. A service control policy can restrict member-account principals even when an administrator attaches a broader identity policy. A permissions boundary also limits the permissions an identity can receive. Neither mechanism creates a grant. Use Control Tower to establish governed accounts and central audit logs. Keep production separate from sandboxes. Protect root access with MFA, avoid persistent root credentials and delegate daily work. AWS secures the underlying cloud infrastructure. Customers own the permissions, data and guest OS configuration they choose.

Trace a failed authorization in order

First identify the account and session that actually signed the request. A tool using a cached CLI profile may be acting as the wrong role. Next identify the action and resource, then evaluate applicable identity and resource policies, session restrictions, permissions boundaries and SCPs. A relevant explicit deny overrides an allow. Cross-account access needs authorization on both sides. Use CloudTrail to confirm which principal attempted the operation. Include object-level data events when you need evidence for individual S3 reads.

A partner needs monthly access

An auditor has its own AWS account. Three consultants need read access for a month. Your company wants one revocation point and protection against another client using the same audit provider.

Which account owns the role, and what information belongs in its trust and permissions policies?

Compare your design with the worked answer

Create the role in the account that owns the reports. Trust the agreed partner principal and require the customer-specific external ID supplied by the partner. Grant only list and read on the required resources. Removing trust stops new sessions. Plan for already-issued temporary sessions to expire or revoke them where necessary. The external ID distinguishes customers of the provider. It is not a password.

If these were employees instead, use their existing identity provider, group membership and an Identity Center permission set. Review CloudTrail events for the assumed role and session identity.

Apply the video example

Read the principal field as an owner would. A bucket policy naming the analysis role allows that role to be evaluated on resource access. A trust policy naming the research account instead answers who can acquire a role session. Draw the two arrows with separate action names before debugging a denial.

freeCodeCamp at 17:55:27 · IAM policy evaluation

AWS exam guide for this domain · Return to the objective map

Knowledge check

Grant access across accounts quiz

Answer 5 questions. Check each answer for an explanation.