Lesson 12 β Cross-Account Access
Learning Path
βοΈ Phase 2 β AWS Cloud Security
π Module 02 β Identity & Access Management (IAM)
π― Lesson Objective
Section titled βπ― Lesson ObjectiveβBy the end of this lesson, you will be able to:
- Understand AWS Cross-Account Access.
- Explain why enterprises use multiple AWS accounts.
- Configure IAM Roles for Cross-Account Access.
- Understand Trust Relationships between AWS accounts.
- Use AWS STS AssumeRole for secure access.
- Apply Cross-Account security best practices.
- Troubleshoot Cross-Account access issues.
π Lesson Information
Estimated Time: 4 Hours
Difficulty: Intermediate
Prerequisites: Lesson 11 β AWS Security Token Service (STS) & Temporary Credentials
Hands-on Lab: Yes
Assignment: Yes
πΌ Business Value
Section titled βπΌ Business ValueβAs organisations grow, they rarely operate from a single AWS account.
Instead, they separate workloads into multiple AWS accounts for better security, governance and cost management.
Typical enterprise AWS environments include:
- Management Account
- Development Account
- Testing Account
- Production Account
- Security Account
- Shared Services Account
- Disaster Recovery Account
Users often need access to resources across multiple accounts.
Rather than creating separate IAM Users in every account, AWS recommends using Cross-Account Access with IAM Roles and AWS STS.
π’ In the Company
Section titled βπ’ In the CompanyβCloudNova Technologies has expanded globally.
The AWS Organization now contains:
- Management Account
- Development Account
- Testing Account
- Production Account
- Security Account
- Shared Services Account
Security Engineers frequently investigate incidents in every account.
Previously, separate IAM Users existed in each AWS account.
Problems included:
- Password management
- Inconsistent permissions
- Difficult auditing
- Increased attack surface
The CISO decides to replace local IAM Users with Cross-Account IAM Roles.
π What is Cross-Account Access?
Section titled βπ What is Cross-Account Access?βCross-Account Access allows an IAM User or IAM Role in one AWS account to securely access resources in another AWS account.
Instead of creating duplicate identities, AWS issues temporary credentials through AWS STS.
This approach simplifies administration while improving security.
π Multi-Account Architecture
Section titled βπ Multi-Account ArchitectureβCloudNova AWS Organization
β
βββββββββββββΌβββββββββββββ β β β βΌ βΌ βΌ
Development Testing Production
β
βΌ
Security Account
β
βΌ
Cross-Account IAM Role
β
βΌ
Temporary Credentials
β
βΌ
Secure Accessπ Why Use Cross-Account Access?
Section titled βπ Why Use Cross-Account Access?βCross-Account Access provides several advantages.
- Centralized identity management
- Reduced number of IAM Users
- Better auditing
- Temporary credentials
- Least Privilege
- Easier administration
- Improved security
π Components of Cross-Account Access
Section titled βπ Components of Cross-Account AccessβA Cross-Account solution typically consists of:
- Source AWS Account
- Target AWS Account
- IAM Role
- Trust Policy
- IAM Permissions Policy
- AWS STS AssumeRole
Each component plays an important role in secure authentication.
π’ Enterprise Example
Section titled βπ’ Enterprise ExampleβCloudNova Security Engineers work from the Security Account.
When an incident occurs in the Production Account, engineers assume the following role:
Production-IncidentResponse-RoleAWS STS issues temporary credentials.
The engineer investigates the incident and, once the session expires, access is automatically removed.
No permanent Production account credentials are required.
π Cross-Account Authentication Flow
Section titled βπ Cross-Account Authentication FlowβSecurity Engineer
β
Security Account
β
AssumeRole
β
AWS STS
β
Temporary Credentials
β
Production Account
β
Investigate Incidentπ€ Trust Relationships
Section titled βπ€ Trust RelationshipsβA Trust Policy specifies who is allowed to assume an IAM Role.
Example:
Development Account
β
Allowed to Assume
β
Production-ReadOnly-Role
Without a Trust Policy, AWS denies the request.
π Example Trust Policy
Section titled βπ Example Trust Policyβ{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Principal":{ "AWS":"arn:aws:iam::111122223333:root" }, "Action":"sts:AssumeRole" } ]}This policy allows the specified AWS account to assume the role.
π‘ Security Benefits
Section titled βπ‘ Security BenefitsβCross-Account Access provides:
- No shared passwords
- No duplicated IAM Users
- Temporary credentials
- CloudTrail auditing
- Better governance
- Reduced credential exposure
- Easier compliance
π« Common Mistakes
Section titled βπ« Common MistakesβAvoid:
β Creating IAM Users in every AWS account.
β Sharing AWS credentials.
β Granting AdministratorAccess unnecessarily.
β Using overly permissive Trust Policies.
β Forgetting to monitor AssumeRole activity.
β Enterprise Best Practices
Section titled ββ Enterprise Best Practicesβ- Use AWS Organizations.
- Use IAM Identity Center for workforce identities.
- Use IAM Roles for Cross-Account Access.
- Require MFA for privileged roles.
- Enable CloudTrail in every account.
- Review Trust Policies regularly.
- Follow the Principle of Least Privilege.
π§ͺ Enterprise Mission 01 β Review AWS Organization
Section titled βπ§ͺ Enterprise Mission 01 β Review AWS OrganizationβNavigate to:
AWS Organizations
β
AccountsReview:
- Management Account
- Member Accounts
- Organizational Structure
Document your observations.
π§ͺ Enterprise Mission 02 β Review Existing Cross-Account Roles
Section titled βπ§ͺ Enterprise Mission 02 β Review Existing Cross-Account RolesβNavigate to:
IAM
β
RolesIdentify Roles used for:
- Cross-Account Administration
- Security Auditing
- Read-Only Access
Review:
- Trust Policy
- Attached Permissions
π§ͺ Enterprise Mission 03 β Create a Cross-Account Trust Policy
Section titled βπ§ͺ Enterprise Mission 03 β Create a Cross-Account Trust PolicyβCreate a file named:
CrossAccountTrust.jsonExample:
{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Principal":{ "AWS":"arn:aws:iam::111122223333:root" }, "Action":"sts:AssumeRole" } ]}Save the file.
π§ͺ Enterprise Mission 04 β Create a Cross-Account IAM Role
Section titled βπ§ͺ Enterprise Mission 04 β Create a Cross-Account IAM RoleβRun:
aws iam create-role \--role-name ProductionReadOnlyRole \--assume-role-policy-document file://CrossAccountTrust.jsonVerify:
aws iam get-role \--role-name ProductionReadOnlyRoleπ§ͺ Enterprise Mission 05 β Attach Read-Only Permissions
Section titled βπ§ͺ Enterprise Mission 05 β Attach Read-Only PermissionsβAttach an AWS Managed Policy.
aws iam attach-role-policy \--role-name ProductionReadOnlyRole \--policy-arn arn:aws:iam::aws:policy/ReadOnlyAccessVerify.
aws iam list-attached-role-policies \--role-name ProductionReadOnlyRoleπ§ͺ Enterprise Mission 06 β Assume the Cross-Account Role
Section titled βπ§ͺ Enterprise Mission 06 β Assume the Cross-Account RoleβRun:
aws sts assume-role \--role-arn arn:aws:iam::TARGET_ACCOUNT_ID:role/ProductionReadOnlyRole \--role-session-name CloudNovaCrossAccountReview:
- AccessKeyId
- SecretAccessKey
- SessionToken
- Expiration
π§ͺ Enterprise Mission 07 β Review CloudTrail Events
Section titled βπ§ͺ Enterprise Mission 07 β Review CloudTrail EventsβNavigate to:
CloudTrail
β
Event HistoryFilter for:
AssumeRoleReview:
- Source Account
- Target Account
- User
- Event Time
- Source IP
π§ͺ Enterprise Mission 08 β Enterprise Design Exercise
Section titled βπ§ͺ Enterprise Mission 08 β Enterprise Design ExerciseβCloudNova has:
- 15 AWS Accounts
- 200 Developers
- 40 Security Engineers
- 25 DevOps Engineers
Design a Cross-Account Access strategy.
Include:
- Administrative access
- Read-only access
- Incident response
- Audit access
- Logging
- MFA requirements
π’ Enterprise Scenario
Section titled βπ’ Enterprise ScenarioβCloudNova acquires another company.
The acquired company already has:
- Five AWS Accounts
- Existing IAM Users
- Separate administrators
Management requires:
- Centralized authentication.
- No duplicated IAM Users.
- Temporary credentials.
- Secure administration across all AWS accounts.
Design a migration strategy using:
- AWS Organizations
- IAM Identity Center
- IAM Roles
- AWS STS
- Cross-Account Access
π Knowledge Check
Section titled βπ Knowledge Checkβ-
What is AWS Cross-Account Access?
-
Why do enterprises use multiple AWS accounts?
-
What is the purpose of a Trust Policy?
-
Which AWS service issues temporary credentials?
-
What is AssumeRole?
-
Why are IAM Roles preferred over IAM Users?
-
Why should Cross-Account access use temporary credentials?
-
Which AWS service records AssumeRole events?
-
What are the benefits of AWS Organizations?
-
How does Cross-Account Access improve enterprise security?
π Assignment
Section titled βπ AssignmentβPrepare an AWS Cross-Account Access Implementation Guide.
Include:
- Multi-Account Architecture
- IAM Roles
- Trust Policies
- AssumeRole
- AWS STS
- Enterprise Security Benefits
- AWS CLI Commands Used
- CloudTrail Monitoring
- Lessons Learned
Length: 5β6 Pages
π Lesson Completion Checklist
Section titled βπ Lesson Completion Checklistβ| Task | Status |
|---|---|
| Reviewed AWS Organization | β |
| Reviewed Cross-Account Roles | β |
| Created Trust Policy | β |
| Created IAM Role | β |
| Attached Permissions | β |
| Assumed Cross-Account Role | β |
| Reviewed CloudTrail Events | β |
| Completed Enterprise Design | β |
| Completed Assignment | β |
π‘ Key Takeaways
Section titled βπ‘ Key TakeawaysβAfter completing this lesson, you should understand:
- Cross-Account Access enables secure access between AWS accounts without creating duplicate IAM Users.
- IAM Roles and AWS STS provide temporary credentials that reduce security risks associated with long-term credentials.
- Trust Policies determine which accounts or identities can assume Cross-Account Roles.
- CloudTrail provides complete visibility into Cross-Account authentication and role assumption activities.
- Cross-Account Access is a foundational capability for secure, scalable multi-account AWS enterprise environments.
π Further Reading
Section titled βπ Further Readingβ- AWS Cross-Account Access Documentation
- AWS IAM Roles User Guide
- AWS Security Token Service (STS) User Guide
- AWS Organizations Documentation
- AWS Well-Architected Framework β Security Pillar
π Next Lesson
Section titled βπ Next Lessonββ‘οΈ Lesson 13 β IAM Access Analyzer