AWS Shared Responsibility & IAM Policy Evaluation Explained
Two concepts show up in almost every AWS certification exam (CLF-C02, SAA-C03, SCS-C03) and cloud security interview: the Shared Responsibility Model and IAM policy evaluation order. Here is a practical breakdown from o
Two concepts show up in almost every AWS certification exam (CLF-C02, SAA-C03, SCS-C03) and cloud security interview: the Shared Responsibility Model and IAM policy evaluation order.
Here is a practical breakdown from our interactive lesson on BytePatterns:
1. Security of the Cloud vs. Security in the Cloud
- AWS secures the cloud itself: physical facilities, hardware, networking, and the virtualization layer.
- You secure what you put in it: your data, guest OS patches, security group / firewall rules, encryption settings, and IAM (who can call which API).
2. IAM Policy Evaluation: Deny Beats Everything
When a principal makes an API request in AWS, IAM evaluates every applicable policy in a strict order:
- Default Deny: Everything is denied unless explicitly allowed.
- Explicit Allow: At least one policy must explicitly allow the action and resource.
-
Explicit Deny: If any applicable policy contains an explicit
Deny, it overrides everyAllow— no exceptions.
3. Use IAM Roles Instead of Static Access Keys
Never embed long-lived AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY pairs in config files on EC2. Instead, attach an IAM Role via an instance profile:
- Credentials are temporary and rotated automatically by AWS.
- Permissions stay scoped to the exact bucket or resource (e.g.,
s3:GetObjecton one bucket):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::photos-bucket/*"
}
]
}
Tip: Least privilege feels slower at first, so use IAM Access Analyzer to generate tight policies from actual CloudTrail activity.
Want to test yourself with the interactive ordering exercise and mini quiz?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.