Cert Notes/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
  • Week 1
    • 1.The Map of AWS Infrastructure: Regions, AZs, and the Promise Called Shared Responsibility
    • 2.IAM Fundamentals: Who Gets to Do What
    • 3.IAM Deep Dive: STS, Permissions Boundaries, and the Shadow of the Confused Deputy
    • 4.AWS Organizations, SCP, Control Tower: The Skeleton of Multi-Account Governance
    • 5.Week 1 Wrap-Up: Fundamentals and IAM Hardened Through Scenarios
  • Week 2
    • 1.VPC Subnet Routing: The Path a Packet Takes to Reach the Internet
    • 2.IGW, NAT Gateway, Bastion: The Bridges Between the Internet and a Private Network
    • 3.Security Groups vs NACLs, and What Flow Logs Tell You
    • 4.VPC Peering, Transit Gateway, VPC Endpoint: Connections Beyond the VPC
    • 5.Week 2 Synthesis: Drawing the Path a Packet Travels One More Time
  • Week 3
    • 1.EC2 Instance Types and Purchase Options: Where Hardware Design Meets Economics
    • 2.EBS vs Instance Store: The Trade Between Persistence and Performance, and Choosing a File System
    • 3.ELB: The Design Philosophy of Per-Layer Load Balancing and How to Choose Between ALB, NLB, and GLB
    • 4.Auto Scaling Groups: Control Theory, Predictive Scaling, and the Art of Graceful Shutdown
    • 5.Week 3 Comprehensive Review: Wiring EC2, Storage, ELB, and ASG into a Single Architecture
  • Week 4
    • 1.S3: The Internal Architecture of Object Storage, the Evolution of Its Consistency Model, and Large-Scale Operational Patterns
    • 2.S3 Storage Classes and Lifecycle: The Economics of Managing Data Temperature
    • 3.S3 Security: The Layered Structure of Access Control, Encryption Key Management, and Data Exfiltration Prevention
    • 4.CloudFront and Storage Gateway: The Internal Structure of a CDN and Hybrid Storage Patterns
    • 5.Week 4 Comprehensive Review: Turning S3, CloudFront, and Storage Patterns into a Single Decision System
  • Week 5
    • 1.RDS: What It Means to Run a Relational Database in the Cloud
    • 2.Aurora: The Relational Database AWS Redesigned From Scratch
    • 3.DynamoDB: What It Means to Design in a Schema-less World
    • 4.ElastiCache and In-Memory Data Stores: The Physics of Speed
    • 5.Week 5 Review: The Art of Choosing a Database
  • Week 6
    • 1.Lambda: What It Really Means to Run Code Without a Server
    • 2.API Gateway: The Broker Between Client and Backend
    • 3.Step Functions and AppSync: Orchestration and GraphQL
    • 4.Containers: ECS, EKS, Fargate, ECR
    • 5.Week 6 Review: Serverless + Containers, Put Together
  • Week 7
    • 1.SQS: How a Message Queue Answers the Questions Distributed Systems Ask
    • 2.SNS: Topics, Fanout, and How 1:N Notifications Get Made
    • 3.EventBridge: How an Event Routing Hub Gathers SaaS, AWS, and Internal Apps in One Place
    • 4.Kinesis: How a Real-Time Stream Solves a Different Problem Than a Queue
    • 5.Week 7 Review: The Four Models of Messaging and Distributed-System Decisions
  • Week 8
    • 1.KMS: Why Key Management Is the Root of Cloud Security
    • 2.Secrets Manager, Parameter Store, and CloudHSM: Three Tools for Handling Secrets and Configuration
    • 3.Cognito: Peeling User Authentication Off Into a Cloud Service
    • 4.WAF, Shield, GuardDuty, Inspector, Macie: The 5 Pillars of Cloud Security Operations
    • 5.Week 8 Wrap-Up: 12 Security Domain Scenarios
  • Week 9
    • 1.CloudWatch: Why Observability Split Into the Three Pillars of Metrics, Logs, and Traces
    • 2.CloudTrail: Why an Audit Log Must Be Tamper-Proof
    • 3.Config and Systems Manager: How Do You Enforce a Desired State
    • 4.X-Ray, Trusted Advisor, Health Dashboard: When One Request Crosses Many Services, How Do You Know Who's Slow?
    • 5.Week 9 Synthesis: Threading Observability and Governance Through "Who / When / What / Why"
  • Week 10
    • 1.Why Compute Cost Splits Along Three Axes: Commitment, Market, and Ownership
    • 2.Why Storage Cost Is a Function Not of "Unit Price" but of "Access Pattern"
    • 3.Why Data Transfer Becomes the Hidden 30% of the Bill
    • 4.Why Cost Governance Splits Into Three Stages: Measure, Account, Automate
    • 5.Week 10 Synthesis: Binding Cost Optimization Into a Single Way of Thinking
  • Week 11
    • 1.Why Availability Zones and Regions Split Along the Cost Called "Physical Distance"
    • 2.Why DR Got Organized into a "Four-Stage Spectrum"
    • 3.How DNS Steers Global Traffic with "One Query for a Name"
    • 4.Why Migration Is Decided by "How You Can't Move It" More Than "What You're Moving"
    • 5.Threading Resilience, DR, and Migration Onto a Single Decision Tree
  • Week 12
    • 1.Why the Security Domain Converges on a Single One-Line Algorithm Called "Policy Evaluation Order"
    • 2.Why the Resilience Domain Reduces to Two Variables: "Blast Radius and Replication Mode"
    • 3.Why the High-Performance Domain Reduces to "How Close You Keep Data to the User"
    • 4.Why the Cost Domain Converges on "a Decision at the Design Stage, Not in Operations"
    • 5.What the Exam Asks to the End Is "the Speed of Translating Keywords into Services"
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
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
← SAA-C03/Week 1/Day 2
SAA-C03· AssociateWeek 1 · Day 2~32 min read

Day 2 - IAM Fundamentals: Who Gets to Do What

The first wall you hit when starting with AWS is permissions. Code that ran fine locally spits out AccessDenied the moment you put it on EC2, and an S3 bucket clearly visible in your console is invisible to another user. As this keeps happening, you naturally become curious about what IAM really is.

This article unpacks how IAM works, centered on its 4 entities — User / Group / Role / Policy. It's the most fundamental yet most trap-laden area of the exam, and in practice, 90% of "why doesn't this work?" starts here. IAM launched in 2010; before that, AWS did everything with a single set of root credentials. If you recall how dangerous that state was, you can see why IAM became the foundation of all AWS security.

Authentication, Authorization, and Where IAM Sits

IAM is a system that answers two questions. First, "who is this requester?" (Authentication, AuthN); second, "is that person allowed to do this?" (Authorization, AuthZ). The former is solved with credentials (passwords, Access Keys, STS temporary tokens), the latter with policies. Every AWS API call is an HTTP request signed with the SigV4 signing algorithm; AWS verifies that signature to confirm identity, then evaluates policies to decide allow/deny.

💡 Related theory: Authentication and authorization are the foundation of the 8 security principles presented by Saltzer & Schroeder in their 1975 paper "The Protection of Information in Computer Systems." The core among them are the Principle of Least Privilege and Fail-safe Defaults (deny by default). AWS IAM's "Implicit Deny + Explicit Allow" model implements exactly these two principles. Permission models split along two axes — RBAC (Role-Based, NIST RBAC standard INCITS 359-2012) and ABAC (Attribute-Based, NIST SP 800-162) — and IAM supports both; tag-based ABAC was officially added in 2018.

🔍 Going deeper: A SigV4 signature is created by chaining the request body, headers, timestamp, credential ID, and secret key through HMAC-SHA256. The key point is that the secret never travels over the network. The AWS server recomputes the same signature with the same secret and compares. Also, requests with timestamps outside ±15 minutes are rejected, blocking replay attacks. The reason IMDSv2 issues temporary credentials inside EC2 is ultimately to safely deliver the key used for this SigV4 signing.

IAM's 4 Entities

EntityDefinitionCredentialsLifetime
UserPermanent identity for a person/appPassword, Access KeyPermanent (rotation required)
GroupA bundle of Users. Unit for attaching policiesNone (container)-
RoleAn identity that can be temporarily borrowedSTS Temp Credential15 minutes ~ 12 hours
PolicyJSON permission document--

The commonly misunderstood one here is Group. A Group is not a person. It can't log in and has no credentials of its own. It's merely a container for bundling Users to attach policies all at once. And a Group cannot be a member of another Group — no nesting. This is the biggest difference from the Unix group model in operating systems (Unix allows users to belong to multiple groups but has no groups-of-groups; IAM is the same).

The most interesting one is Role. A Role is a "borrowed identity." An EC2 instance, a Lambda function, a user in another account, an external IdP — anyone specified as a principal in the trust policy can temporarily borrow this Role and act with its permissions. Borrowing invokes the sts:AssumeRole API, which returns a 3-piece set: AccessKey + SecretKey + SessionToken. These tokens expire, and when they do, you borrow again. This is the core of the security model that "keeps no long-lived credentials."

[ IAM entity relationships ]

   +-------+      attach      +--------+
   | User  | <-------------- | Policy |
   +-------+                 +--------+
       |                        ^
   member of                    |
       v                    attach
   +-------+                    |
   | Group | <------------------+
   +-------+
                                |
   +-------+    AssumeRole      |
   | Role  | <---- via STS  ----+
   +-------+
       ^
       |   trust policy
   +-------+
   | EC2 / Lambda / another account / OIDC

📚 Case study: The 2017 OneLogin breach. An attacker stole AWS API keys and exfiltrated customer data over several days. The post-mortem revealed the root cause: a long-lived IAM User Access Key had been committed to a code repository (Git) and exposed, and that key carried broad permissions. Had this key been Role-based temporary credentials, it would likely have already expired at the time of exposure. This incident was one of the decisive moments that cemented the best practice: "whether human or app, use Roles wherever possible."

Policy: A Single JSON Document Decides Everything

IAM policies are written as JSON documents, with 5 core fields.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AllowS3ReadOnSpecificBucket",
    "Effect": "Allow",
    "Action": ["s3:GetObject", "s3:ListBucket"],
    "Resource": [
      "arn:aws:s3:::my-bucket",
      "arn:aws:s3:::my-bucket/*"
    ],
    "Condition": {
      "StringEquals": {"aws:SourceVpc": "vpc-0abc123"},
      "Bool": {"aws:MultiFactorAuthPresent": "true"}
    }
  }]
}
  • Effect: Allow or Deny. If neither, implicit deny.
  • Action: APIs to allow. Wildcards like s3:* are possible but dangerous.
  • Resource: Target ARNs. * means all resources.
  • Condition: Additional constraints by IP, MFA, time, tags, SourceVpc, etc.
  • Principal: Appears only in resource policies. Whom the access is granted to.

⚠️ Pitfall: Using "Resource": "*" and "Action": "*" together makes it equivalent to AdministratorAccess. On the exam it appears as questions like "an audit found excessive permissions," and the answer is almost always "trim unused permissions with IAM Access Analyzer" or "set a Permissions Boundary."

There are 6 kinds of policies, and distinguishing them is the crux of the exam.

KindAttached ToPurpose
Identity-based (Managed/Inline)User, Group, Role"What can this identity do"
Resource-basedS3 bucket, KMS key, Lambda, SQS, SNS"Who can access this resource"
Permissions BoundaryUser, RoleThe upper bound on permissions an identity can have
Service Control Policy (SCP)Organizations OU/AccountPermission ceiling for an entire account
Session PolicyPassed inline on AssumeRoleNarrows permissions only for that temporary session
Access Control List (ACL)S3, VPC (legacy)Object-level permissions (avoid if possible)

Policy Evaluation Logic: One Explicit Deny and It's Over

When multiple policies apply simultaneously, AWS evaluates in the following order.

1. Default: deny (Implicit Deny)
2. Evaluate SCP → explicit Deny in SCP → DENY (done)
3. Evaluate Resource-based policies
4. Evaluate Identity-based policies
5. Evaluate Permissions Boundary
6. Evaluate Session Policy
7. Explicit Deny anywhere → DENY (done)
8. Allow somewhere → ALLOW
9. Nothing at all → DENY (Implicit Deny)

Remember two key things. First, an explicit Deny wins unconditionally, no matter where it lives. Second, an allow must be granted at every layer simultaneously. If the SCP denies, no amount of Allow in IAM policies helps. If the Permissions Boundary doesn't include the permission, you can't do it.

🔍 Going deeper: Within the same account, when both a Resource Policy and an Identity Policy exist, the union applies. That is, an Allow on either side is enough to pass. But cross-account is different. Both sides must Allow (the owning account's Resource Policy + the calling account's Identity Policy). This is a staple exam trap. For the question "I allowed the other account's User in the S3 bucket policy — why doesn't it work?" the answer is "you must also Allow via an Identity Policy inside that account."

💡 Related theory: Formally, this evaluation logic is an explicit priority system over a decision tree. XACML (eXtensible Access Control Markup Language, an OASIS standard) defines similar policy-combining algorithms (deny-overrides, permit-overrides, etc.), and IAM adopts deny-overrides as its default. This is the most conservative choice, guaranteeing "fail-safe" behavior in security.

Root vs IAM User: Never Live as Root

When you create an AWS account, the first identity created is root. Root has all permissions, and some operations (e.g., closing the account, changing billing information, enabling S3 MFA Delete) can only be done by root. But using root for daily work is like always logging in as root on Linux.

The practical standard is this.

  1. Enable hardware MFA on root
  2. Delete root Access Keys
  3. Use an IAM User or IAM Identity Center (SSO) for daily work
  4. Put root in a vault and take it out only a few times a year

📚 Case study: In 2020, a startup accidentally pushed a root Access Key to a public GitHub repo. Within minutes, bots scanned the key, spun up dozens of EC2 P3 instances to mine cryptocurrency, and within 24 hours the bill exceeded $50,000. AWS usually deactivates the key automatically and waives the charges once it detects such incidents, but not every case goes that way. The lesson is simple: a root key is dangerous by its mere existence. GitHub has since introduced its own secret scanning, detecting key patterns from AWS, GCP, Stripe, and others at push time.

IAM Identity Center (formerly AWS SSO): The Real Standard

The standard for modern AWS operations is IAM Identity Center. You SSO in from your company's IdP (Okta, Azure AD, Google Workspace) via SAML 2.0 or OIDC, and receive temporary credentials across multiple accounts through Permission Sets. On the exam too, if the scenario is "managing permissions for many users across multiple accounts," the answer is almost always IAM Identity Center.

ComparisonIAM UserIAM Identity Center
CredentialsPermanentTemporary (1-12 hours)
Multi-account managementHardEasy (Organizations integration)
External IdP federationSeparate setupSupported natively
Rotation burdenUser's responsibilityAutomatic
Exam recommendationIndividual users not recommended✅

MFA: The Real Meaning of a Second Factor

MFA is the combination of "something I know (password) + something I have (token generator)." AWS supports 4 kinds of MFA.

  • Virtual MFA: Authy, Google Authenticator (TOTP, RFC 6238)
  • Hardware MFA: YubiKey and other FIDO U2F/WebAuthn devices
  • SMS MFA: No longer recommended (vulnerable to SIM swap attacks)
  • U2F security keys: The safest. Phishing-resistant

TOTP is a 6-digit code that changes every 30 seconds, and its algorithm is defined in RFC 6238. It combines the shared secret (the seed registered when scanning the QR code) with the current 30-second time window via HMAC-SHA1, then truncates part of the result into 6 digits. On the exam, "how do you enforce MFA?" comes up often, and the answer is adding aws:MultiFactorAuthPresent: true to a policy's Condition.

"Condition": {
  "BoolIfExists": {"aws:MultiFactorAuthPresent": "false"}
}

A Deny statement with this condition means "unconditionally deny any session that didn't go through MFA." The reason for BoolIfExists is that in some services (e.g., service-to-service calls via an IAM Role) this key may not exist at all.

🔍 Going deeper: WebAuthn/FIDO2 is asymmetric-key based, making it inherently strong against phishing. At registration, the device generates a key pair and only the public key is stored on the server. At login, the device signs the server's challenge with its private key, and that signature includes the origin (the domain being accessed). So the attack of relaying a challenge received on a phishing site back to the legitimate service is automatically blocked. SAA doesn't probe this deeply, but for "which MFA is the most secure" type questions, the answer is FIDO/WebAuthn.

EC2 Instance Profiles and IAM Roles: Getting Permissions Without Keys

When you want to access S3 from inside EC2, the thing you must never do is hardcode Access Keys in your code. Instead, attach an IAM Role to the EC2 instance. EC2 retrieves the Role's temporary credentials via the IMDS (Instance Metadata Service, 169.254.169.254), and the AWS SDK automatically signs with those keys.

# Inside EC2 (using IMDSv2)
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" \
  -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
 
curl -H "X-aws-ec2-metadata-token: $TOKEN" \
  http://169.254.169.254/latest/meta-data/iam/security-credentials/MyRole

The credentials returned here typically refresh automatically every hour. The SDK pre-fetches new tokens starting 5 minutes before expiry, so application code doesn't need to care.

📚 Case study: The direct cause of the Capital One incident (seen on Day 1) was precisely the IMDSv1 version of this IMDS. IMDSv1 was a simple GET, so an external attacker could reach it via SSRF. IMDSv2 requires obtaining a token via PUT first before GET works, neutralizing nearly all SSRF. Since 2022, all new EC2 AMIs are recommended to require IMDSv2 by default.

Practical Best Practices Summary

  1. Seal root away. MFA mandatory.
  2. Use IAM Identity Center instead of individual IAM Users.
  3. For both humans and apps, use Roles + temporary credentials wherever possible.
  4. If an Access Key is truly necessary, rotate every 90 days.
  5. Start policies with least privilege and expand as needed.
  6. Regularly prune unused permissions with IAM Access Analyzer.
  7. Audit all IAM activity with CloudTrail.
  8. Enforce permission ceilings on developer-created Roles with Permissions Boundaries.

Wrapping Up

Today's two pictures are IAM's 4 entities (User/Group/Role/Policy) and the policy evaluation logic (explicit Deny > explicit Allow > implicit Deny). With just these two lodged in your head, 70% of the exam's IAM domain is solvable. In the next article, we'll go deeper into STS and policy evaluation internals — Permissions Boundaries, ABAC tags, and the Confused Deputy problem.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A company operates multiple AWS accounts and wants single sign-on through its corporate Okta. What is the most suitable solution?

Question 2

An EC2 instance needs to access S3. What is the most secure method?

Question 3

Which of the following is correct regarding IAM policy evaluation?

Question 4

Which statement about Groups is correct?

Question 5

You want to grant a user in another account cross-account access to an S3 bucket. What is required?

Question 6

What is the most appropriate way to enforce MFA?

Question 7

A new junior developer should be able to create new IAM Roles, but you want to prevent attaching broad permissions like `iam:*` or `*:*` to those Roles. What is the most appropriate method?

PreviousThe Map of AWS Infrastructure: Regions, AZs, and the Promise Called Shared ResponsibilityWeek 1 · Day 1Next IAM Deep Dive: STS, Permissions Boundaries, and the Shadow of the Confused DeputyWeek 1 · Day 3

On this page

  • Authentication, Authorization, and Where IAM Sits
  • IAM's 4 Entities
  • Policy: A Single JSON Document Decides Everything
  • Policy Evaluation Logic: One Explicit Deny and It's Over
  • Root vs IAM User: Never Live as Root
  • IAM Identity Center (formerly AWS SSO): The Real Standard
  • MFA: The Real Meaning of a Second Factor
  • EC2 Instance Profiles and IAM Roles: Getting Permissions Without Keys
  • Practical Best Practices Summary
  • Wrapping Up
  • Practice Questions