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
DOP-C02 · ProfessionalDevOps Engineer - Professional
SCS-C03 · SpecialtySecurity - Specialty
  • Week 1
    • 1.Shared Responsibility Model and SCS-C03's 6 Domains: The Big Picture for Security Engineers
    • 2.IAM Core: Users, Groups, Roles, Policies, and Policy Evaluation Flow
    • 3.Advanced IAM Policies: Identity vs Resource, Condition Keys, and Least-Privilege Design
    • 4.STS and Temporary Credentials: AssumeRole, Federation, Role Chaining, Confused Deputy Prevention
    • 5.Week 1 Synthesis: Integrating IAM and Credentials Through Scenarios
  • Week 2
    • 1.Master IAM Policy Evaluation Logic: Explicit Deny Beats Everything
    • 2.Permission Boundary and Delegation: The Safe Way to Grant Permissions to Developers
    • 3.AWS Organizations and SCP: Account-Level Guardrail Design
    • 4.Day 4
    • 5.Day 5
  • Week 3
    • 1.Enable VPC Flow Logs (detailed in Day 3)
    • 2.Scenario: Web server (443) receiving Internet connection
    • 3.1. CloudWatch Logs — suits real-time alarms (Metric Filter)
    • 4.Gateway Endpoint (S3) — add route to table, free
    • 5.Day 5
  • Week 4
    • 1.Day 1
    • 2.AWS Shield (Standard/Advanced) and DDoS Protection: Layered Defense, CloudFront/Route 53 Integration
    • 3.AWS Network Firewall and DNS Firewall: Stateful Inspection, Domain Filtering, Centralized Inspection VPC
    • 4.Edge Security Integration: CloudFront (OAC, Signed URLs), ACM Certificates, Perimeter Security Architecture
    • 5.Week 4 Synthesis: Integrated Review of Edge and Perimeter Defense Scenarios
  • Week 5
    • 1.AWS KMS Fundamentals: CMK Types, Key Policy vs IAM, Symmetric/Asymmetric Keys
    • 2.Envelope Encryption and Data Keys: GenerateDataKey, Encryption Context
    • 3.Key Policies, Grants, and Cross-Account Sharing: ViaService Condition and Key Governance
    • 4.Encryption at Rest/in Transit: TLS, Service-Specific Encryption, Key Rotation
    • 5.Week 5 Synthesis: Integrated Review of Encryption and Key Management Scenarios
  • Week 6
    • 1.Secrets Manager: Automatic Rotation (Lambda), Parameter Store Comparison, Cross-Account Secrets
    • 2.S3 Data Protection: SSE-S3/SSE-KMS/DSSE, Bucket Keys, Object Lock, Versioning, Block Public Access
    • 3.S3 Access Control Deep Dive: Bucket Policies, ACLs, Access Points, Encryption Enforcement, Exfiltration Prevention
    • 4.ACM and Macie: Certificate Lifecycle and Integration, Macie Sensitive Data (PII) Detection and Classification
    • 5.Week 6 Integration: Secrets, Storage, and Sensitive Data Scenario Review
  • Week 7
    • 1.CloudTrail: Management/Data Events, Organization Trail, Log File Integrity Validation, CloudTrail Lake
    • 2.AWS Config: Configuration Items and Records, Rules (Managed/Custom Lambda), Conformance Pack, Auto-Remediation
    • 3.VPC Flow Logs and Network Logging: Detecting Breaches/Misconfig via Traffic, Route 53 Resolver Query Logs
    • 4.Log Integrity, Retention, and Centralization: S3 Object Lock, Cross-Account Log Aggregation, KMS Encryption of Logs
    • 5.Week 7 Integration: Audit Trail Scenario Review
  • Week 8
    • 1.CloudWatch: Log Groups, Metric Filters, Alarms, Anomaly Detection, Security Event Notifications
    • 2.Security Hub: Security Standards (CIS/FSBP), Consolidated Score, Finding Aggregation and Normalization (ASFF), Automated Response
    • 3.Log Analysis: Query CloudTrail/VPC Flow with Athena, OpenSearch, CloudWatch Logs Insights
    • 4.EventBridge Security Automation: Finding Routing, Alert Pipelines, Security Data Lake Concept
    • 5.Week 8 Integration: Monitoring, Aggregation, Analysis Scenario Comprehensive Review
  • Week 9
    • 1.Amazon GuardDuty: Threat Detection Principles, Finding Types, Threat Intelligence, Multi-Account Delegated Administrator
    • 2.Amazon Detective: Finding Investigation and Root Cause, Behavior Graph, GuardDuty Integration
    • 3.Amazon Inspector: EC2/ECR/Lambda Vulnerability Scanning, CVE, Automated Assessment
    • 4.Detection Integration: GuardDuty + Security Hub + Detective + Inspector One Picture, Multi-Account Detection Baseline
    • 5.Week 9 Synthesis: Integrated Review of Threat Detection Scenarios
  • Week 10
    • 1.Automated Response Pipeline: EventBridge + SSM Automation + Lambda for Auto-Remediation of Findings
    • 2.Incident Response for Compromised EC2: Isolation, Snapshots, Forensics, Credential Revocation
    • 3.Credential Exposure Response: Access Key Exposure, Root Compromise, IAM Neutralization and Rotation Playbook
    • 4.Incident Response Framework: NIST Phases, Runbooks, Automation vs Human Judgment Boundary
    • 5.Week 10 Synthesis: Integrated Incident Response Scenario Review
  • Week 11
    • 1.AWS Organizations Security Governance: SCP Design, Delegated Administrators, Central Security Account Model
    • 2.Control Tower and Landing Zone: Guardrails (Preventive/Detective), Account Factory, Compliance Baseline
    • 3.Audit Manager and Compliance: Automated Evidence Collection, Frameworks (CIS/PCI), Config Integration
    • 4.Multi-Account Security Operations: Firewall Manager, Central Policy Distribution, Cost/Tag Governance, Security Baseline Automation
    • 5.Week 11 Comprehensive Review: Integrated Governance Scenarios
  • Week 12
    • 1.Integrated Review Domains 1 & 2: Threat Detection and Incident Response ↔ Security Logging and Monitoring
    • 2.Integrated Review Domains 3 & 4: Infrastructure Security ↔ Identity and Access Management
    • 3.Integrated Review Domains 5 & 6: Data Protection ↔ Management and Governance
    • 4.Full Practice Exam Pace: Six-Domain Synthesis Scenario Review
    • 5.D-Day Final: Exam Strategy, Keyword Translation, Trap Summary
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
← SCS-C03/Week 1/Day 2
SCS-C03· AssociateWeek 1 · Day 2~23 min read

Day 2 - IAM Core: Users, Groups, Roles, Policies, and Policy Evaluation Flow

IAM is the spine of AWS security. Wherever you go in the 6 domains we saw yesterday, you eventually reduce to one question: "Can this principal do this action on this resource?" KMS decryption, S3 GetObject, cross-account deployment — all use the same IAM evaluation engine to decide. That's why IAM must be approached not as "memorizing policy JSON" but as understanding the evaluation algorithm to solve SCS-C03's subtle scenarios.

Today we go through the four building blocks of IAM (users, groups, roles, policies) and step-by-step how AWS decides Allow/Deny when a request arrives. Let me throw ahead the key one-liner: "Explicit Deny defeats everything else. After that, explicit Allow beats the default. With neither, implicit Deny applies."

IAM Building Blocks: Users, Groups, Roles, Policies

ElementDefinitionCredentialsCore Use
UserPermanent identity, corresponds to one person or appLong-term access key, passwordAvoid when possible (key exposure risk)
GroupCollection of users, container for attaching policiesNone (no credentials)Grant policies to users in bulk
RoleIdentity anyone can temporarily "assume"STS temporary credentials (expiring)EC2/Lambda, cross-account, federation
PolicyJSON document describing permissionsN/AAttached to above elements to define permissions

Here's the insight the exam repeatedly targets: Long-term credentials (IAM User access key) should be avoided; use Role's temporary credentials instead. When an EC2 needs S3 access, don't put User access keys in the instance — use an instance profile (IAM Role). When Lambda accesses DynamoDB, use its execution role. Even people should prefer IAM Identity Center (SSO) over IAM User, receiving temporary credentials after login.

💡 Related Theory: A Group is just a "container" and has no credentials itself, so you can't designate a Group as a Principal. Common mistake for newcomers — writing "Principal": {"AWS": "arn:...:group/Devs"} in a Role's trust policy won't work. Groups are just channels to deliver policies to users; they can't be AssumeRole targets.

🔍 Deep Dive: What "assuming" a Role means is that STS (Security Token Service) issues temporary credentials of 3 types: AccessKeyId, SecretAccessKey, SessionToken. These credentials have an expiration time (1 hour default, 12 hours max), so even if exposed, the damage is time-limited. This fundamental time-limit is why temporary creds are safer than long-term keys, covered deeply on Day 4.

Two Types of Policies: Identity-based vs Resource-based

Policies split into two types by "where they're attached." Today we just grasp the concept; Day 3 digs deeper.

  • Identity-based policy: Attached to User, Group, Role. Describes "what this principal can do." No Principal element (who it attaches to is the principal itself).
  • Resource-based policy: Attached directly to resources (S3 buckets, KMS keys, SQS queues, etc.). Principal element is required — describes "who can access this resource."

The decisive utility of resource-based policies is enabling cross-account access. To let another account's principal access my S3 bucket, I specify that account in the bucket's resource-based policy.

IAM Policy JSON Structure

Every policy is an array of Statements; each Statement has these elements:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowReadSpecificBucket",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:ListBucket"],
      "Resource": [
        "arn:aws:s3:::my-secure-bucket",
        "arn:aws:s3:::my-secure-bucket/*"
      ],
      "Condition": {
        "Bool": {"aws:SecureTransport": "true"}
      }
    }
  ]
}
  • Effect: Allow or Deny
  • Action: API action to allow/deny (s3:GetObject). Wildcards (s3:*) allowed
  • Resource: Target ARN. Required in identity-based, usually * in resource-based (policy already on that resource)
  • Principal: Who (resource-based and trust policy only)
  • Condition: Additional constraints (IP, MFA, time, encryption, etc.)

⚠️ Trap: Using "Resource": "*" and "Action": "*" together is basically admin. When the exam asks "least privilege," the answer is the option with narrowed wildcards. Specifically, s3:ListBucket applies to bucket ARN (arn:aws:s3:::bucket), while s3:GetObject applies to object ARN (.../*) — mixing these ARN levels is a common mistake.

Policy Evaluation Flow: The Algorithm That Decides Allow/Deny

This is today's core. When a request arrives in a single account, AWS's decision sequence is:

[ IAM Policy Evaluation Flow (Single Account) ]

  Request(Principal + Action + Resource + Context)
        |
   1. Collect all applicable policies
      (Identity-based, Resource-based, SCP, Permissions Boundary, Session policy)
        |
   2. Any explicit Deny?                   ── Yes ──▶  DENY (absolute priority)
        | No
   3. Does SCP allow the Action?           ── No ──▶ DENY
        | Yes
   4. Does Permissions Boundary allow?     ── No ──▶ DENY
        | Yes
   5. Any explicit Allow?                  ── No ──▶ DENY (implicit)
        | Yes
        ▼
      ALLOW

Compressed to three principles:

  1. Default is implicit Deny: With no policies allowing, access is denied. Permissions must be granted explicitly.
  2. Explicit Allow overrides implicit Deny: Somewhere explicitly allowing reverses the default denial.
  3. Explicit Deny overrides everything (explicit deny overrides): No matter what allows it, if any policy explicitly Denies, it's denied.

💡 Related Theory: When memorizing this order, the key is "Guardrails (SCP, Permissions Boundary) don't grant permissions; they only draw upper limits." Even if SCP allows s3:*, that alone doesn't create any actual permissions — there must be explicit Allow in an identity-based policy. SCP defines "maximum allowed range." That's why SCP patterns commonly use Deny guardrails rather than Allow.

🔍 Deep Dive: For cross-account, evaluation happens separately in each account. For a principal in account A to access a resource in account B, ① A's identity-based policy must Allow AND ② B's resource-based policy must Allow A — both required. Within the same account, either one is enough. This "both needed" rule is a common trap in cross-account scenarios.

Evaluation Flow Read as Scenarios

Let's apply the abstract algorithm to concrete situations.

Situation 1: Developer has admin permissions but we want to block only one specific S3 bucket. Identity-based policy is AdministratorAccess allowing everything. Add an explicit Deny statement (e.g., specific bucket ARN with "Effect": "Deny") and the Deny beats the Allow for just that bucket. Adding the same Deny to SCP enforces it account-wide.

{
  "Effect": "Deny",
  "Action": "s3:*",
  "Resource": [
    "arn:aws:s3:::sensitive-prod-bucket",
    "arn:aws:s3:::sensitive-prod-bucket/*"
  ]
}

Situation 2: SCP explicitly Denies ec2:*, but a user has AmazonEC2FullAccess. Result is Deny. SCP's explicit Deny overrides everything. The user's Allow becomes powerless. This is why SCP is used as a governance guardrail.

🎯 Scenario: "Security team wants to prevent anyone (including admin, root) from disabling CloudTrail across all member accounts." Answer isn't editing user policies individually — it's SCP with Deny on cloudtrail:StopLogging and cloudtrail:DeleteTrail applied to the OU. Then even that account's admin or root can't disable CloudTrail (management account root is SCP-exempt). This applies the principle that explicit Deny beats all Allow.

Policy Debugging Tools: Verifying Who Can Do What

Tracing evaluation logic mentally causes mistakes. AWS provides validation tools.

# IAM Policy Simulator: Check if a principal can do an action
aws iam simulate-principal-policy \
  --policy-source-arn arn:aws:iam::111122223333:user/alice \
  --action-names s3:GetObject s3:DeleteObject \
  --resource-arns arn:aws:s3:::my-bucket/secret.txt
 
# Find out who the current caller is (start of role debugging)
aws sts get-caller-identity
 
# List policies attached to a user
aws iam list-attached-user-policies --user-name alice
aws iam list-user-policies --user-name alice  # inline policies

📚 Case Study: 80% of "why is access denied" in production comes down to ① implicit Deny (no one Allow'd) ② hidden Deny in SCP ③ exceeding Permissions Boundary ④ cross-account with only one side allowing. Developing the habit of first running aws sts get-caller-identity to confirm "what role am I under right now" cuts debugging time in half. CloudTrail's AccessDenied events leave clues about which policy denied it.

IAM Access Analyzer: Detecting Unintended External Exposure

IAM Access Analyzer analyzes resource policies to automatically find resources allowing access beyond account or organization boundaries. S3 buckets, IAM roles, KMS keys, Lambda functions — if opened to external principals, it creates findings.

This is the intersection of Domain 2 (detective) and Domain 4 (IAM). You can't manually review hundreds of buckets and roles, so it automatically detects "access crossing trust boundaries." Its policy generation feature even creates least-privilege policies from CloudTrail logs of actual use.

💡 Related Theory: Access Analyzer's core is external vs trusted distinction. Access within the same account or organization is treated as normal; only crossing that boundary creates findings. "Set organization boundary as zone of trust" treats cross-account within organization as normal and catches only real external exposure.

Summary — IAM is an Algorithm

Three essentials from today. First, among IAM building blocks, use Role (temporary credentials) by default; avoid User (long-term keys) — this is the starting point of all best practices. Second, policy evaluation is implicit Deny → explicit Allow overrides it → explicit Deny beats everything — the algorithm of 3 principles — and SCP·Permissions Boundary don't grant permissions, only draw upper limits. Third, cross-account requires both accounts to allow.

Tomorrow we dig deeper into policies. The subtle interplay between Identity vs Resource policies, precision controls using Condition keys, and practical patterns for designing least privilege with Permissions Boundary. The evaluation algorithm you learned today is the foundation for all of it.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

An IAM user has the `AdministratorAccess` managed policy. At the same time, the SCP applied to that user's account contains an explicit `Deny` on `s3:*`. What happens when the user tries to read an S3 object?

Question 2

An IAM role in Account A wants to write an object to an S3 bucket in Account B. Which condition must be met for the access to succeed?

Question 3

Which statement about IAM Groups is correct?

Question 4

A developer has been granted `AmazonS3FullAccess` but tries to call `dynamodb:GetItem`, which no policy explicitly allows. Which outcome and reason are correct?

Question 5

A security team wants to enforce that nobody — including admins and root — can disable CloudTrail in any member account. Which approach is most appropriate?

PreviousShared Responsibility Model and SCS-C03's 6 Domains: The Big Picture for Security EngineersWeek 1 · Day 1Next Advanced IAM Policies: Identity vs Resource, Condition Keys, and Least-Privilege DesignWeek 1 · Day 3

On this page

  • IAM Building Blocks: Users, Groups, Roles, Policies
  • Two Types of Policies: Identity-based vs Resource-based
  • IAM Policy JSON Structure
  • Policy Evaluation Flow: The Algorithm That Decides Allow/Deny
  • Evaluation Flow Read as Scenarios
  • Policy Debugging Tools: Verifying Who Can Do What
  • IAM Access Analyzer: Detecting Unintended External Exposure
  • Summary — IAM is an Algorithm
  • Practice Questions