AWS Organizations · SCP strategy
The account tree, and the maths of the guardrail that hangs off it. IAM already covers what an SCP is; this page is about the two things questions actually test — how Allows combine, and what an SCP physically cannot express.
Cây account, và bài toán của cái trần gắn trên nó. SCP là gì đã có ở trang IAM; trang này lo hai thứ đề thi thật sự hỏi — các Allow cộng lại thế nào, và SCP về bản chất không diễn đạt nổi cái gì.
Two modes — and what unlocks at "All features"Hai chế độ — "All features" mở khoá cái gì
A question that says "create an organization" and offers both "turn on the IAM Identity Center feature" and "turn on all features" is testing exactly this. Anything governance-shaped needs All features. Câu nào nói "tạo organization" rồi cho chọn giữa "bật tính năng IAM Identity Center" và "bật all features" chính là đang hỏi cái này. Hễ dính tới quản trị là cần All features.
| Consolidated billing only | All features | |
|---|---|---|
| One consolidated bill (management account pays)Một hoá đơn gộp (management account trả) | ✓ | ✓ |
| Combined usage → volume / tiered discountsGộp usage → giảm giá theo lượng (tiered) | ✓ | ✓ |
| Reserved Instances + Savings Plans sharingChia sẻ Reserved Instances + Savings Plans | ✓ | ✓ |
| SCP · RCP | ✗ | ✓ |
| Tag · Backup · AI opt-out policiesTag · Backup · AI opt-out policy | ✗ | ✓ |
| Management account governs members (down to their root)Management account quản được member (tới cả root của họ) | ✗ | ✓ |
| Trusted access for other servicesTrusted access cho service khác (StackSets, Config, Backup…) | ✗ | ✓ |
| Delegated administratorDelegated administrator | ✗ | ✓ |
| IAM Identity Center organization instanceorganization instance | ✗ | ✓ |
| Control Tower landing zonelanding zone | ✗ | ✓ |
- Upgrade is one-way. Consolidated billing only → All features, yes; but you can't revert back to billing-only afterward. New organizations default to All features already. Nâng cấp một chiều. Consolidated billing only → All features thì được; nhưng sau đó không revert lại billing-only được. Org tạo mới vốn đã mặc định All features.
- Enabling All features needs member consent. Every invited member account must accept the handshake — because it hands the management account more control (SCPs over their root, etc.). Bật All features cần member đồng ý. Mọi member account được invite phải accept handshake — vì nó trao thêm quyền cho management account (SCP lên cả root của họ…).
- When billing-only is the deliberate pick: independent business units that only want to share a payer + volume/RI-SP discounts and explicitly don't want the management account governing them. Rare — any guardrail need flips it to All features. Khi nào cố ý chọn billing-only: các business unit độc lập chỉ muốn share payer + discount volume/RI-SP và cố ý không muốn bị management account quản. Hiếm — cần bất kỳ guardrail nào là phải chuyển sang All features.
The FullAWSAccess trapBẫy FullAWSAccess
Symptom in the question: "we attached an SCP allowing only EC2, S3 and DynamoDB, but developers can still use other services." That sentence is the clue — something in the chain is still saying Allow *. In Organizations there is exactly one usual suspect.
Triệu chứng trong đề: "đã gắn SCP chỉ allow EC2, S3, DynamoDB, mà dev vẫn dùng được service khác." Câu đó chính là manh mối — trong chuỗi vẫn còn thứ gì đó nói Allow *. Trong Organizations chỉ có đúng một nghi phạm quen thuộc.
Two SCPs on the same OU do not narrow each other — their Allows are added together. Narrowing only happens between levels. So the fix is never "write a better custom SCP", it is "remove the wide one from this node".
Hai SCP trên cùng một OU không thu hẹp lẫn nhau — các Allow của chúng cộng lại. Việc thu hẹp chỉ xảy ra giữa các tầng. Nên cách sửa không bao giờ là "viết custom SCP hay hơn", mà là "gỡ cái rộng ra khỏi node này".
- Don't "edit
FullAWSAccess" — it's an AWS-managed policy, not editable. You detach it.Đừng "sửaFullAWSAccess" — đó là AWS-managed policy, không sửa được. Phải gỡ ra. - Don't replace it with
Deny "*"— an explicit Deny beats every Allow, including the three services you wanted.Đừng thay bằngDeny "*"— Deny tường minh đè mọi Allow, kể cả ba service bạn muốn giữ. - Don't enumerate a Deny for every other service — hundreds of entries, and stale the day AWS ships something new.Đừng liệt kê Deny cho từng service còn lại — hàng trăm dòng, và lỗi thời ngay hôm AWS ra service mới.
- Keep
FullAWSAccesson the Root. Removing it there locks the whole organization out.Vẫn giữFullAWSAccessở Root. Gỡ ở đó là khoá cả tổ chức.
Deny-list vs allow-list — pick one per OUDeny-list vs allow-list — mỗi OU chọn một
Deny-list (the default)Deny-list (mặc định)
- Keep
FullAWSAccess; add SCPs that Deny specific things.GiữFullAWSAccess; thêm SCP Deny vài thứ cụ thể. - Typical rules: regions outside
eu-*,cloudtrail:StopLogging, root-user actions, leaving the organization.Luật điển hình: region ngoàieu-*,cloudtrail:StopLogging, hành động root user, rời organization. - Use when you want a few hard rules over an otherwise-open account.Dùng khi muốn vài luật cứng trên một account vốn mở.
Allow-list
- Detach
FullAWSAccessfrom the OU, then attach an SCP whose Allow list is the whitelist.GỡFullAWSAccesskhỏi OU, rồi gắn SCP mà danh sách Allow chính là whitelist. - Use when the requirement says "engineers may use only these services".Dùng khi yêu cầu nói "kỹ sư chỉ được dùng các service này".
- Costly to maintain — every new service needs an edit.Tốn công duy trì — service mới nào cũng phải sửa.
// deny-list · region lock, giữ nguyên FullAWSAccess bên cạnh
{ "Effect": "Deny", "Action": "*", "Resource": "*",
"Condition": { "StringNotEquals": { "aws:RequestedRegion": ["eu-central-1","eu-west-1"] } } }
// allow-list · CHỈ hoạt động sau khi đã detach FullAWSAccess khỏi OU đó
{ "Effect": "Allow", "Action": ["ec2:*","s3:*","dynamodb:*"], "Resource": "*" }
// miễn trừ theo tên role — luôn phải đi kèm cặp thứ hai
{ "Effect": "Deny", "Action": "aws-marketplace:*", "Resource": "*",
"Condition": { "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/procurement-manager-role" } } }
{ "Effect": "Deny", "Action": "iam:CreateRole", "Resource": "*",
"Condition": { "StringEquals": { "iam:RoleName": "procurement-manager-role" } } }
role/procurement-manager-role", any account administrator can simply create a role with that name and assume it. Every exception-by-name SCP needs a partner SCP denying iam:CreateRole for that name. If an answer option has the exception but not the partner, it's the wrong option.
Nếu SCP nói "trừ khi caller là role/procurement-manager-role", bất kỳ account administrator nào cũng có thể tạo một role trùng tên rồi assume nó. Mọi SCP miễn trừ theo tên phải có SCP đi kèm deny iam:CreateRole với tên đó. Đáp án nào có miễn trừ mà thiếu cặp đi kèm là đáp án sai.
What an SCP physically cannot doNhững gì SCP không tài nào làm được
An SCP is evaluated against the request context: the principal, the account, the region, the service, the action, the resource ARN, and whatever condition keys the service publishes. It is not a validator that reads arbitrary parameters out of the API call body. SCP được đánh giá dựa trên request context: principal, account, region, service, action, resource ARN, và những condition key mà service đó hỗ trợ. Nó không phải bộ kiểm tra đọc tham số tuỳ ý trong thân lệnh API.
| Requirement in the questionYêu cầu trong đề | SCP?SCP? | What actually does itCái thật sự làm được |
|---|---|---|
| Block a region / a service entirelyChặn hẳn một region / một service | ✓ | aws:RequestedRegion · Action |
| Block expensive instance typesChặn các loại instance đắt | ✓ | ec2:InstanceType (a published EC2 key)(key do EC2 hỗ trợ) |
| Require a tag on creationBắt buộc có tag khi tạo | ✓ | aws:RequestTag/* |
Stop a security-group rule whose source is 0.0.0.0/0Chặn rule security group có source là 0.0.0.0/0 |
✗ | EventBridge + Lambda remediation · Firewall Manager SG audit policy · CloudFormation Hooks / policy-as-code in the pipelineEventBridge + Lambda remediation · Firewall Manager SG audit policy · CloudFormation Hooks / policy-as-code trong pipeline |
| Cap monthly spend at a fixed amountChốt trần chi tiêu tháng | ✗ | AWS Budgets + SNS + Lambda (and an SCP that pre-blocks the expensive services)AWS Budgets + SNS + Lambda (và một SCP chặn sẵn các service đắt) |
| Detect existing non-compliant resourcesPhát hiện resource hiện có không tuân thủ | ✗ | AWS Config rule / Control Tower detective controlAWS Config rule / detective control của Control Tower |
| Share a resource with member accountsChia sẻ resource cho member account | ✗ | AWS RAM |
aws:SourceIp ≠ the CIDR in the requestCIDR trong request
When a developer runs authorize-security-group-ingress --cidr 0.0.0.0/0 from the office, the request context holds aws:SourceIp = 203.0.113.10 (the office) and the 0.0.0.0/0 lives in the request body, invisible to the policy. Worse: a condition of IpAddress: {"aws:SourceIp": "0.0.0.0/0"} matches every IPv4 caller on earth — so that "clever" SCP denies the action outright, including safe 10.0.0.0/8 rules.
Khi dev chạy authorize-security-group-ingress --cidr 0.0.0.0/0 từ văn phòng, request context giữ aws:SourceIp = 203.0.113.10 (văn phòng), còn 0.0.0.0/0 nằm trong thân request, policy không nhìn thấy. Tệ hơn: điều kiện IpAddress: {"aws:SourceIp": "0.0.0.0/0"} khớp với mọi caller IPv4 trên đời — nên cái SCP "thông minh" đó deny sạch action, kể cả rule an toàn 10.0.0.0/8.
Doing something in every member accountLàm một việc trong mọi member account
Four different verbs, four different services. Questions mix them deliberately, and the wrong answers are usually a service doing a verb it doesn't have. Bốn động từ khác nhau, bốn service khác nhau. Đề cố tình trộn chúng, và đáp án sai thường là một service làm cái động từ nó không có.
| VerbĐộng từ | ServiceService | ShapeHình dạng |
|---|---|---|
| Block an API actionChặn một API action | SCP / RCP | a ceiling, grants nothingmột cái trần, không cấp quyền |
| Share an existing resourceChia sẻ resource đã có | AWS RAM | TGW · subnet · prefix list · Aurora cluster · License…TGW · subnet · prefix list · Aurora cluster · License… |
| Create resources in each accountTạo resource trong từng account | CloudFormation StackSets | service-managed + auto-deployment ⇒ new accounts get it tooservice-managed + auto-deployment ⇒ account mới cũng tự có |
| Offer an approved catalogueCung cấp catalogue đã duyệt | Service Catalog | self-service products, not a sharing mechanismproduct tự phục vụ, không phải cơ chế share |
- StackSets go in the management (or delegated admin) account, not in the member accounts. "Create a stack set in the member accounts" is always wrong.StackSet nằm ở management (hoặc delegated admin) account, không nằm trong member account. "Tạo stack set trong member accounts" luôn sai.
- Service-managed permissions = CloudFormation creates the execution roles for you (needs trusted access). Self-managed = you create the admin/execution roles in every account by hand.Service-managed = CloudFormation tự tạo execution role (cần trusted access). Self-managed = bạn tự tạo admin/execution role trong từng account.
- Automatic deployment is what covers future accounts. "Drift detection" only reports changes — it never deploys, so any answer offering it for onboarding is wrong.Automatic deployment mới là thứ phủ các account tương lai. "Drift detection" chỉ báo cáo thay đổi — không deploy, nên đáp án nào dùng nó để onboarding là sai.
- A service-managed StackSet targeting the org root does not deploy into the management account itself — "all accounts" here means all member accounts.StackSet service-managed nhắm vào org root không deploy vào chính management account — "all accounts" ở đây là mọi member account.
- Resources created in a member account must reference the shared resource by ID passed as a StackSet parameter —
!Refonly resolves inside the same stack, so e.g. a TGW attachment needs theTransitGatewayIdhanded in.Resource tạo trong member account phải tham chiếu resource được share bằng ID truyền vào qua StackSet parameter —!Refchỉ giải trong cùng stack, nên ví dụ TGW attachment phải được truyềnTransitGatewayId.
Delegated administratorDelegated administrator
Best practice is to keep the management account empty. So most org-wide services let you nominate one member account to run them: Config aggregator, Security Hub, GuardDuty, Firewall Manager, IAM Access Analyzer, StackSets, Backup, IAM Identity Center, Private Marketplace. Best practice là để management account trống, nên hầu hết service phạm vi toàn org cho phép chỉ định một member account đứng ra vận hành: Config aggregator, Security Hub, GuardDuty, Firewall Manager, IAM Access Analyzer, StackSets, Backup, IAM Identity Center, Private Marketplace.
- Delegation is per service and set from the management account. There is no single global "admin account" switch.Uỷ quyền là theo từng service và đặt từ management account. Không có một công tắc "admin account" toàn cục.
- SCPs still don't apply to the management account, so keep workloads out of it — that's the actual reason to delegate.SCP vẫn không áp lên management account, nên đừng để workload ở đó — đó mới là lý do thật để uỷ quyền.
- If the question doesn't mention a delegated admin, answer with the management account. Don't invent one.Nếu đề không nhắc delegated admin, cứ trả lời management account. Đừng tự bịa ra.
Exam reflexesPhản xạ thi
- "Custom SCP attached but users can still use other services" → detach
FullAWSAccessfrom that OU."Đã gắn custom SCP mà user vẫn dùng được service khác" → gỡFullAWSAccesskhỏi OU đó. - "Only role X may do Y, everyone else denied" → SCP at the root + second SCP denying
iam:CreateRolefor that name."Chỉ role X được làm Y, còn lại deny" → SCP ở root + SCP thứ hai denyiam:CreateRolevới tên đó. - "Fixed monthly budget per developer account" → Budgets per account + SCP denying costly services + Budget alert → SNS → Lambda to clean up. Not an SCP spend cap; not a single "terminate everything" budget action."Ngân sách tháng cố định cho mỗi developer account" → Budgets từng account + SCP chặn service đắt + Budget alert → SNS → Lambda để dọn. Không phải SCP chốt chi tiêu; cũng không có budget action "terminate hết".
- "Deploy X to all accounts including future ones" → StackSet in the management account, service-managed, target the org/OU, automatic deployment on."Deploy X vào mọi account kể cả account tương lai" → StackSet ở management account, service-managed, target org/OU, bật automatic deployment.
- "Prevent creating
0.0.0.0/0ingress" → not an SCP. Reactive: EventBridge → Lambda revoke. Org-wide with less ops: Firewall Manager SG content-audit policy with auto-remediation. Truly preventive: pipeline + CloudFormation Hooks/cfn-guard, plus an SCP that only lets a deployment role touch ingress at all."Ngăn tạo ingress0.0.0.0/0" → không phải SCP. Phản ứng: EventBridge → Lambda revoke. Toàn org, ít vận hành: Firewall Manager SG content-audit policy + auto remediation. Thật sự phòng ngừa: pipeline + CloudFormation Hooks/cfn-guard, kèm SCP chỉ cho một deployment role được đụng ingress.