Cert Notes/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
  • Week 1
    • 1.The Game Called the SAP Exam: Hands-On Techniques for Decomposing Scenarios
    • 2.IAM, STS, and Federation: Splitting the Word "Permission" into Six Layers
    • 3.The Anatomy of a VPC: What Route Tables Really Decide
    • 4.Four Compute Pillars in Depth: Revisiting Nitro, EBS, ELB, and Auto Scaling Through a Pro Lens
    • 5.Week 1 Integration: When IAM, VPC, and EC2 Meet in a Single Scenario
  • Week 2
    • 1.AWS Organizations: A New Unit of Thought for Multi-Account Architecture
    • 2.Service Control Policy: The Ceiling as a Thinking Tool
    • 3.Control Tower and Landing Zone: Automating Governance
    • 4.IAM Identity Center, Permission Set, Consolidated Billing: Multi-Account SSO Standard
    • 5.Week 2 Integration: When Organizations·SCP·CT·IDC Meet in One Scenario
  • Week 3
    • 1.Share TGW via RAM from network account
    • 2.Cisco Router Example (BGP route-map)
    • 3.Create Customer Gateway (on-premises router IP and ASN)
    • 4.Interface Endpoint supported service examples
    • 5.Day 5
  • Week 4
    • 1.AWS Outposts, Local Zones, Wavelength: Extending the Cloud at the Boundary
    • 2.Storage Gateway 4 Types Comparison: Extending On-Premises Storage to the Cloud
    • 3.Snow Family and Large-Scale Data Transfer: The Moment Physics Beats the Internet
    • 4.EKS Anywhere, ECS Anywhere, Hybrid Containers: Extending Orchestration Boundaries
    • 5.Week 4 Review: Comprehensive Hybrid Cloud Architecture
  • Week 5
    • 1.Multi-Region Architecture: Why Global Distribution Is Difficult
    • 2.7 Route 53 Routing Policies: DNS Determines Architecture
    • 3.CloudFront Advanced: Why CDN Is More Than Simple Caching
    • 4.Route 53 Advanced: Health Check Algorithms, DNSSEC, Geoproximity Math, Hybrid DNS Resolver
    • 5.Week 5 Review: Global Architecture Integrated Scenarios
  • Week 6
    • 1.7R Migration Strategies: Decision Language for Cloud Migration
    • 2.AWS MGN Deep Dive: Physics of Block-Level Replication, DRS Comparison, Migration Hub Orchestrator
    • 3.AWS DMS + SCT: The Science of Database Migration
    • 4.Migration Acceleration Tools: App2Container, MAP, Migration Hub
    • 5.Week 6 Review: Integrated Migration Strategy Scenarios
  • Week 7
    • 1.Container Orchestration Crossroads: The Real Criteria for Choosing ECS, EKS, Fargate
    • 2.Inside EKS — Node Groups, IRSA, Karpenter Set the Operations Standard
    • 3.Fargate Cost Anatomy — Serverless Container's Real Price Tag
    • 4.Service Mesh Anatomy — App Mesh, Service Connect, Cloud Map Divergence
    • 5.Week 7 Synthesis — Container Scenario Practice 12 Questions
  • Week 8
    • 1.Day 1
    • 2.Day 2
    • 3.EventBridge: Unified Model of Event Bus, Pipes, and Scheduler
    • 4.AppSync GraphQL and the Essence of SQS/SNS/Kinesis Messaging
    • 5.Week 8 Comprehensive — 12 Serverless & Event Architecture Scenarios
  • Week 9
    • 1.Data Lake Architecture: Internal Operations and Cost Models of S3, Glue, Athena
    • 2.Redshift Deep Dive: MPP Internal Operations, RA3 Storage Separation, Spectrum and Zero-ETL
    • 3.EMR, Glue, MWAA: Big Data Orchestration and Distributed Processing Engines
    • 4.Lake Formation, Data Governance, MSK: Fine-Grained Permissions and Real-Time Streams Under the Hood
    • 5.Week 9 Comprehensive Review: Data Architecture as One Picture
  • Week 10
    • 1.SageMaker Deep Dive: ML Lifecycle, 4 Types of Inference Endpoints, Training Cost Math
    • 2.Bedrock Deep Dive: Generative AI Architecture, RAG Internals, Vector Search Math
    • 3.Managed AI Services Deep Dive: Pre-trained AI Selection Logic and Sync/Async Patterns
    • 4.MLOps Deep Dive: Science of Drift, Feature Store, Automated Retraining Pipelines
    • 5.Week 10 Comprehensive Review: ML/AI Architecture Decision-Making + 12 Scenario Problems
  • Week 11
    • 1.Day 1
    • 2.Detection Trinity: Internal Operations of Macie·GuardDuty·Inspector and Threat Detection
    • 3.Integrated Monitoring: Security Hub·Detective·Audit Manager Roles and Responsibilities
    • 4.Edge Security: WAF·Shield·Firewall Manager and Layered DDoS Defense
    • 5.Integrated Security: Encryption·Detection·Unified Monitoring·Edge Defense in One Scenario
  • Week 12
    • 1.Savings Plans·RI Strategy — Commitment Discount Math, Application Order Internal Operations, Organization Sharing
    • 2.Day 2
    • 3.Cost Explorer·Budgets·CUR — Layers of Cost Visibility, Budget Auto-Control, FinOps Data Pipeline
    • 4.Hidden Cost Anatomy — S3 Storage Tiers, Data Transfer Fee Structure, NAT Gateway Traps
    • 5.Integrated Cost Optimization: Commitment Economics and Hidden Cost Trade-Offs
  • Week 13
    • 1.Day 1
    • 2.Operational Excellence & Security Pillars Deep Dive — GitOps Roots, Shared Responsibility Model Boundaries, Three Types of Traceability Internals
    • 3.Reliability & Performance Efficiency Pillars Deep Dive — CAP Theorem, Idempotency and Retry Mathematics, HPC Networking Physics
    • 4.Cost & Sustainability Pillars Deep Dive — Unit Economics, Regulatory Roots of Carbon Accounting, Trade-Offs Between Two Pillars
    • 5.Well-Architected Comprehensive Review: Distilling Six Pillars Into One Scenario
  • Week 14
    • 1.Four DR Strategies and RTO/RPO Mapping — History of Disaster Recovery, Physics of Sync/Async Replication, Cloud DR Economics
    • 2.Backup: AWS Backup & Cross-Region Copy — Legal Origins of WORM, Vault Lock Irreversibility, Multi-Account Backup Governance
    • 3.Resilience Hub & Fault Injection Simulator — Birth of Chaos Engineering, Stop Condition's Safety Engineering, DR Verification Automation
    • 4.RDS, Aurora, DynamoDB Global DR — Sync/Async Replication Internals, Aurora Storage Architecture, Active-Active Conflict Resolution
    • 5.Resilience and DR Comprehensive Review: Four Strategies Honoring RTO/RPO and Validation Tools
  • Week 15
    • 1.Enterprise Global ERP Migration — Multi-Account Governance History, 7R Migration Anatomy, Data Sovereignty Legal & Technical Roots
    • 2.Startup Serverless-First Architecture — Cost-Zero Scaling, No Ops Overhead, Function Composition Limits
    • 3.Financial Services Compliance & Real-Time Settlement — FINRA/SOX/PCI-DSS Audit, Active-Active Multi-Region, Zero Data Loss
    • 4.Media & Entertainment Streaming — PB-Scale Global CDN, Real-Time Analytics, Cost Efficiency
    • 5.Healthcare & Public Sector — HIPAA/GxP/FEDRAMP, Immutable Audit, Highly Regulated Compliance
  • Week 16
    • 1.Well-Architected Framework Synthesis — 6 Pillars Integrated, Trade-offs Across Domains
    • 2.Exam Strategy & Question Patterns — Recognizing Trade-offs, Ruling Out Decoys, Time Management
    • 3.Cost Optimization Deep Dive — Reserved Capacity, Commitment Discounts, Unit Economics
    • 4.Migration & Rehost Strategies — 7Rs in Practice, Time + Data Volume Trade-offs
    • 5.Final Review & Exam Simulation — Full-Stack Scenario, Trade-off Decision Under Constraints
DOP-C02 · ProfessionalDevOps Engineer - Professional
SCS-C03 · SpecialtySecurity - Specialty
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
← SAP-C02/Week 1/Day 2
SAP-C02· ProWeek 1 · Day 2~33 min read

Day 2 - IAM, STS, and Federation: Splitting the Word "Permission" into Six Layers

On SAA, IAM could be summarized in four words: "User, Group, Role, Policy." On Pro, that doesn't cut it. A single scenario features an IAM User policy, an IAM Role policy, a resource-based policy, a Permission Boundary, an SCP, and a session policy all at once — and questions asking "can this user call this action" appear frequently. To get the answer right, you must know the 6-level priority order of permission evaluation.

In this article we peel back IAM's surface one more layer and look at the evaluation engine where decisions actually happen underneath. We'll also cover why STS and Federation are "the spine of enterprise multi-account environments," and what broke in incidents like Capital One and Uber.

IAM's 6-Layer Permission Evaluation: The Internals the AWS Console Doesn't Show

When you type aws s3 ls s3://my-bucket, AWS evaluates the following 6 policies simultaneously.

[1. SCP (Service Control Policy)]              ← Organizations level; deny beats everything
       ↓
[2. Permission Boundary]                       ← Maximum permission ceiling for an IAM entity (User/Role)
       ↓
[3. Identity-based Policy]                     ← Policies attached to Users, Groups, Roles
       ↓
[4. Resource-based Policy]                     ← S3 bucket policies, KMS key policies, etc.
       ↓
[5. Session Policy]                            ← Attached inline during AssumeRole/GetFederationToken
       ↓
[6. VPC Endpoint Policy]                       ← Applies only to traffic through a VPC Endpoint

The evaluation rules are simple but exact.

  1. An explicit Deny beats every Allow (explicit deny wins)
  2. If no relevant policy Allows, the default is Deny (implicit deny)
  3. SCPs and Permission Boundaries grant no permissions — they only set limits (deny-only)
  4. For cross-account access, both sides of the trust must Allow via resource-based policy (within the same account, either one Allowing is sufficient)

🔍 Deeper dive: SCPs and Permission Boundaries are both guardrails that set a "maximum ceiling of permissions," but their scopes differ. An SCP attaches at the OU or Account level in Organizations and applies to every IAM entity inside that account (including root). A Permission Boundary attaches only to a specific IAM User or Role. That is, an SCP enforces "this account can never use regions other than us-east-1," while a Permission Boundary enforces "this developer Role can never call IAM or Organizations APIs." Both are permission ceilings, not Allows.

💡 Related theory: This evaluation structure is a hybrid of Role-Based Access Control (RBAC, NIST RBAC standard INCITS 359-2004) and Attribute-Based Access Control (ABAC, NIST SP 800-162). The Condition clause in IAM Policies implements ABAC (aws:RequestTag/Project=Phoenix), and policy attachment implements RBAC. The reason AWS fully embraced ABAC in 2018 is that when account counts explode, RBAC alone causes policy management to explode. 100 projects × 4 environments (dev/stg/prod/test) = 400 Roles needed, but with ABAC it's done with 1 Role + tag-based conditions.

🎯 Scenario: "A data analyst complains they cannot access an S3 bucket. The IAM policy Allows s3:*, and the bucket policy also Allows. What's the cause?" — The answer is usually that an SCP restricts the region or service, or a Permission Boundary allows only s3:GetObject, or the bucket is KMS-encrypted and the KMS key policy Denies. The Pro exam frequently asks these "why doesn't it work" debugging scenarios.

Cross-Account Access: Both Sides Must Agree

Within the same account, either the Identity Policy OR the Resource Policy Allowing is sufficient, but when accessing from another account, both sides must Allow.

[Account A: user Alice]                  [Account B: S3 Bucket]
    Identity Policy: Allow s3:GetObject       Bucket Policy: Allow Alice from A
              ↓                                          ↓
         Both sides Allow → access granted

This is where incidents frequently happen in fintech and financial-sector multi-account environments. Allow only one side and access is blocked; Allow both sides and the risk of permission leakage grows. That's why IAM Access Analyzer launched in 2019 to automatically check "can an external account access this resource."

STS's Real Role: The Issuer of Temporary Credentials

You saw the word AssumeRole in SAA too, but on Pro you must distinguish all 5 STS APIs.

APICallerCredential validityUse case
AssumeRoleIAM User/Role15 min - 12 hoursCross-account access, EC2 Instance Role
AssumeRoleWithSAMLSAML IdP (AD FS, Okta)15 min - 12 hoursEnterprise SSO
AssumeRoleWithWebIdentityOIDC (Google, Facebook, GitHub Actions)15 min - 12 hoursMobile apps, CI/CD
GetFederationTokenIAM User15 min - 36 hoursTemporary permissions for external users
GetSessionTokenIAM User15 min - 36 hoursMFA-based session hardening

🔍 Deeper dive: The heart of temporary credentials is the session token. Calling with only a regular AccessKeyId + SecretAccessKey gives you indefinitely valid credentials, but adding a SessionToken enforces the expiration STS issued. Temporary credentials are also a JWT-like structure issued internally by STS, transmitted by including the SessionToken as an extra header in the AWS Signature V4 signature. This ties directly into the mechanism by which IMDSv2 blocks SSRF attacks (the EC2 metadata service issues only temporary credentials, and IMDSv2 mandates a PUT token).

📚 Case study: The Capital One incident of July 2019. An attacker exploited an SSRF vulnerability to access http://169.254.169.254/latest/meta-data/iam/security-credentials/ and stole the temporary credentials of an EC2 Instance Role. Those credentials had broad access to S3 buckets, and data of 106 million people was exfiltrated. As a direct result of this incident, AWS launched IMDSv2 (November 2019) and IAM Access Analyzer (December 2019), and since 2024 has enforced IMDSv2 by default on new EC2 instances. DOJ indictment.

AssumeRole's Trust Policy

When creating a Role, you define two policies at once.

// Trust Policy (who can assume this Role)
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {
      "AWS": "arn:aws:iam::123456789012:root"
    },
    "Action": "sts:AssumeRole",
    "Condition": {
      "StringEquals": {
        "sts:ExternalId": "unique-external-id-xyz"
      }
    }
  }]
}
 
// Permission Policy (what the holder of this Role can do)
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::data-bucket/*"
  }]
}

ExternalId is a mechanism to prevent the "confused deputy" attack. If Company A allows Company B to assume a Role in A's account, a malicious third party C could impersonate B's ID to assume A's Role. ExternalId is a secret A shared only with B, so without knowing it, C's assume fails.

⚠️ Pitfall: On the Pro exam, when a scenario says "we need to let a third-party SaaS access our AWS account," the answer is almost always Cross-Account Role + ExternalId. Creating an IAM User and handing out access keys is a wrong answer (access keys are static and hard to revoke). SaaS providers like Datadog, Snowflake, and Splunk all use this pattern.

The Two Branches of Federation: SAML and OIDC

Enterprises have their own identity systems (Active Directory, Okta, Azure AD). Rather than recreating these in AWS each time, you federate them.

SAML 2.0-Based Federation

SAML (Security Assertion Markup Language) 2.0 is an XML-based authentication and authorization protocol adopted as an OASIS standard in 2005.

[User] → [AD FS / Okta]
              ↓ SAMLResponse (XML, signed)
         [AWS Sign-in Endpoint]
              ↓ AssumeRoleWithSAML
         [STS: issues temporary credentials]
              ↓
         [Use AWS Console / API]

💡 Related theory: SAML 2.0 is based on XML Digital Signature (W3C XMLDSIG) and XML Encryption (W3C XMLENC). The IdP signs the SAMLResponse with the private key of an X.509 certificate, and the SP (AWS) verifies with the public key. However, due to the complexity of XML parsing, SAML has a security issue unique to it called the XML Signature Wrapping attack. At USENIX in 2012, this vulnerability was found in 11 SaaS/SAML implementations, and AWS was one of them. AWS subsequently patched it with strict XML schema validation.

OIDC (OpenID Connect)-Based Federation

OIDC is a standard that layers authentication on top of OAuth 2.0. Being JSON-based, it's lighter than SAML and well-suited for mobile and SPAs.

[User] → [Google / GitHub / Cognito]
                  ↓ id_token (JWT)
            [AssumeRoleWithWebIdentity]
                  ↓
            [STS: temporary credentials]

GitHub Actions uses this method to deploy to AWS. Once you configure the OIDC trust, GitHub Actions workflows obtain a temporary token each time and deploy without any long-lived AWS credentials. Since GitHub launched OIDC in 2021, the practice of "storing AWS Access Keys in GitHub Secrets" has rapidly disappeared.

📚 Case study: The 2017 Uber data breach was caused by an employee pushing an AWS Access Key to a public GitHub repository. Data of 57 million users was leaked. GitHub subsequently introduced secret scanning, and AWS automatically detects exposed keys with IAM Access Analyzer. Today, using OIDC with GitHub Actions makes this kind of incident outright impossible (there are no static credentials at all).

IAM Identity Center (formerly AWS SSO)

AWS Identity Center is a SAML-based multi-account SSO solution. Integrated with Organizations, one login lets you freely switch among multiple accounts and multiple Roles in the console.

[Employee] → [Identity Center login]
              ↓
        [Select Permission Set]
              ↓
        [AssumeRole into target account with temporary credentials]
              ↓
        [Use Console / CLI]

A Permission Set is a concept unique to Identity Center — a template that "deploys the same IAM Role to multiple accounts in bulk." For example, define a "Developer Permission Set" and Identity Center automatically creates and maintains the identical Role in every dev account.

🔍 Deeper dive: Internally, Identity Center supports two identity sources: ① Identity Center's own directory (small scale) ② an external IdP (AD/Okta/Azure AD via SAML or SCIM). SCIM (System for Cross-domain Identity Management, RFC 7644) is a standard protocol that automatically synchronizes user additions and deletions from an external IdP like Azure AD into AWS. Without it, you get the ghost-user problem where an employee leaves the company but their permissions stay alive in AWS.

Permission Boundary: The Safety Valve of Delegation

A scenario large organizations frequently face: "We want developers to create their own Lambda Roles directly. But granting developers IAM Admin permissions is dangerous."

The answer is Permission Boundary. The administrator attaches a constraint alongside: "you may create IAM Roles, but you can never grant permissions beyond this boundary."

// Policy granted to developers
{
  "Effect": "Allow",
  "Action": "iam:CreateRole",
  "Resource": "*",
  "Condition": {
    "StringEquals": {
      "iam:PermissionsBoundary": "arn:aws:iam::123456789012:policy/DevBoundary"
    }
  }
}

This forces developers to attach DevBoundary whenever they create an IAM Role, and permissions beyond that boundary are automatically blocked.

🎯 Scenario: A game company wants to give 100 developers a free-form Lambda development environment. Developers create Roles and grant permissions themselves, but IAM Admin, Organizations, and Billing permissions are absolutely off-limits. — The answer is to force-attach a Permission Boundary that denies IAM, Organizations, and Billing APIs. SCP alone is insufficient because a developer might grant admin permissions to their own Role. The orthodox approach is the dual guardrail of SCP + Permission Boundary.

6-Layer Permission Evaluation in Practice: The Debugging Matrix

SymptomPolicy to suspectDiagnosis method
All API calls blockedSCPCheck SCPs in the Organizations console
Only a specific service blockedPermission Boundary, SCPIAM simulator, Access Analyzer
Only a specific region blockedSCP's Condition: aws:RequestedRegionInspect the SCP JSON directly
Cross-account access blockedBoth sides' policiesCloudTrail's errorMessage
Cannot read KMS-encrypted objectsKMS Key PolicyKMS console, kms:Decrypt policy
AssumeRole failsTrust Policy, ExternalIdCloudTrail's sts:AssumeRole events

You can simulate policies from the CLI.

# Simulate whether a specific user can call a specific action
aws iam simulate-principal-policy \
  --policy-source-arn arn:aws:iam::123456789012:user/Alice \
  --action-names s3:GetObject \
  --resource-arns arn:aws:s3:::data-bucket/file.txt

ABAC vs RBAC: Choosing by Organization Size

ItemRBACABAC
DefinitionGrant policies per RoleGrant policies per attribute (tag)
Suitable scaleSmall (< 50 Roles)Large
Policy countExplodes with roles × environmentsSingle policy + tags
Permission leakage riskMistakes when duplicating policiesWhen tags are missing
AWS adoptionFrom the beginningABAC capability added in 2018

🔍 Deeper dive: The core Condition Keys of AWS ABAC are aws:RequestTag/key (tags of the resource the requester is about to create), aws:ResourceTag/key (tags of an already-existing resource), and aws:PrincipalTag/key (tags of the requester themselves). Combining these three, you can express "a user tagged Project=Phoenix can start/stop only EC2 instances tagged Project=Phoenix" in a single policy. Even with 100 projects, the policy stays the same. However, a missing tag means blocked permissions, so it must be enforced together with Tag Policies (an Organizations feature).

Wrapping Up

IAM was roughly "policy = JSON" on SAA, but on Pro you must handle it at the depth of a 6-layer evaluation engine. SCP, Permission Boundary, Identity Policy, Resource Policy, Session Policy, and VPC Endpoint Policy operate simultaneously; an explicit deny beats every allow; and cross-account requires consent from both sides.

STS is the issuer of temporary credentials, and you must distinguish the five variants of AssumeRole (AssumeRole, WithSAML, WithWebIdentity, GetFederationToken, GetSessionToken) by scenario keywords. Federation splits into SAML (enterprise) and OIDC (mobile/CI-CD), and Identity Center is the standard answer for multi-account SSO. Finally, Permission Boundary is the safety valve of delegation, providing developers "freedom and safety at the same time."

In the next article we look at the channels where traffic flows on top of the permissions IAM decided — VPC, subnets, routing, and security groups — at Pro depth.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A company operates 50 accounts in Organizations. In one developer account, IAM User Alice was granted a policy with `s3:GetObject` permission but cannot retrieve objects. CloudTrail records `AccessDenied`. What is the most likely cause?

Question 2

A SaaS company needs to collect data from its customers' AWS accounts. What is the safest and most standard method?

Question 3

A company wants to let developers "freely create their team's Lambda Roles but never be able to grant IAM or Organizations permissions." What is the most suitable method?

Question 4

A company deploys to AWS Lambda from GitHub Actions. The security team demands "do not store long-lived AWS Access Keys in GitHub Secrets." What should they do?

Question 5

A company operates 200 accounts in Organizations, and employees must access multiple accounts via SSO. Active Directory is the identity source. What is the most appropriate solution?

Question 6

A company wants to find every external Principal that can access its S3 buckets cross-account. What is the most efficient method?

Question 7

In a system, a user cannot retrieve an S3 object. Identity Policy is `s3:*`, the bucket policy Allows, and the KMS key policy is missing. CloudTrail shows `KMS.NotFoundException`. What is the problem?

PreviousThe Game Called the SAP Exam: Hands-On Techniques for Decomposing ScenariosWeek 1 · Day 1Next The Anatomy of a VPC: What Route Tables Really DecideWeek 1 · Day 3

On this page

  • IAM's 6-Layer Permission Evaluation: The Internals the AWS Console Doesn't Show
  • Cross-Account Access: Both Sides Must Agree
  • STS's Real Role: The Issuer of Temporary Credentials
  • AssumeRole's Trust Policy
  • The Two Branches of Federation: SAML and OIDC
  • SAML 2.0-Based Federation
  • OIDC (OpenID Connect)-Based Federation
  • IAM Identity Center (formerly AWS SSO)
  • Permission Boundary: The Safety Valve of Delegation
  • 6-Layer Permission Evaluation in Practice: The Debugging Matrix
  • ABAC vs RBAC: Choosing by Organization Size
  • Wrapping Up
  • Practice Questions