BM: Baca dalam Bahasa Melayu
World A2: Keys & Guards
Permission boundaries and SCPs
You will learn: the two fences that limit keys, and why a fence never opens a door by itself.
Checked with AWS 2026-11 on 1 Nov 2026
The problem
The site bucket’s own policy says the CI role may upload. But the role has a fence that only allows ECR. Predict.
Read the request and its policies. Will AWS say Allow or Deny?
The request
- Who
- ci-deployer (role session)
arn:aws:sts::111122223333:assumed-role/ci-deployer/run-42 - Wants to
s3:PutObject- On
arn:aws:s3:::kedai-site/index.html
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/ci-deployer" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::kedai-site/*" } ]}{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "ecr:*", "Resource": "*" } ]}Watch
That fence is a permissions boundary: A fence around one user or role. They can never do more than it allows, whatever else says yes.: the most one user or role may ever do. An SCP (service control policy): A fence around whole accounts in an organization. It never grants keys; it only limits them. is a fence around whole accounts. Sort the facts.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Fences limit. Keys open. True, or needs work?
Swipe right for good, left for needs work. Or use the buttons.
A boundary alone lets a role read S3.
Predict
Your organization’s SCP allows s3:*. Aina has no IAM policy for S3. Can she read the menu bucket?
Pick one answer.
Check
The shop’s accounts must stay in the Malaysia Region. An SCP at the root enforces it. Aina uploads to a bucket in us-east-1. Predict.
Read the request and its policies. Will AWS say Allow or Deny?
The request
- Who
- Aina (IAM user)
arn:aws:iam::111122223333:user/aina - Wants to
s3:PutObject- On
arn:aws:s3:::kedai-backup/today.json- Request facts
aws:RequestedRegion = us-east-1
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::kedai-*" } ]}{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "*", "Resource": "*" } ]}{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "*", "Resource": "*", "Condition": { "StringNotEquals": { "aws:RequestedRegion": "ap-southeast-5" } } } ]}You did it!
You can now tell keys from fences, and predict when a fence says no.
Go deeper (optional)
Where the story breaks: a metal key opens its lock forever. AWS checks every request fresh, against every key and fence at once. And a robot can borrow a key for just minutes.
Real SCPs often exempt global services from a Region rule. Read the SCP examples in the Organizations guide before you write one.
Bahasa Melayu
Polisi bucket laman itu sendiri kata role CI boleh muat naik. Tetapi role itu ada pagar yang benarkan ECR sahaja. Ramalkan.
Pagar itu ialah permissions boundary: had paling tinggi untuk satu pengguna atau role. SCP pula pagar sekeliling seluruh akaun. Susun fakta ini.
Pagar menghadkan. Kunci membuka. Betul, atau perlu dibaiki?
SCP organisasi anda benarkan s3:*. Aina tiada polisi IAM untuk S3. Boleh dia baca bucket menu?
Akaun kedai mesti kekal di Region Malaysia. Satu SCP di root menguatkuasakannya. Aina muat naik ke bucket di us-east-1. Ramalkan.
Kini anda boleh bezakan kunci dan pagar, dan ramal bila pagar kata tidak.
You finished this before. Practice is always welcome!
Official docs: Permissions boundaries · Service control policies (SCPs) · SCP evaluation · Policy evaluation logic
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?