Skip to Content
Cloud Engineering Academy
15. Multi-Account Governance & FinOps

Guardrails with SCPs and RCPs: deny by exception, and test before you attach

Design a small catalogue of organisation guardrails (Region limits, protecting audit and security services, a root-user deny, sandbox limits, a data perimeter), prove them offline with a tested evaluator and linter, and roll them out without locking yourself out.

advanced⏱ 1 h 30 min🟢 FreeSCS-C03SAP-C03SOA-C03

Assumes: .NET 10 LTS · xUnit v3 4.0.3 · AWS CLI v2 · Terraform AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Choose between a deny list and an allow list SCP strategy and explain why most banks use deny lists on top of FullAWSAccess.
  • Write the five guardrails every bank organisation needs: Region restriction, protect audit logging, protect detection services, deny the root user, and block long-lived IAM user keys; plus sandbox limits and a Suspended-OU deny-all.
  • Write a Region restriction that does not break IAM, Organizations, billing or CloudFront, and explain why NotAction is required.
  • Describe what RCPs add (a perimeter around resources, including requests from outside the organisation) and what they cannot do.
  • Test guardrails offline with the lab's evaluator and linter, and in AWS with a staging account, before attaching them to anything that matters.
  • Roll out in stages with a rollback plan, and read an SCP denial in CloudTrail.

Prerequisites

Why this matters in banking

SCPs are the only control that holds even when an administrator in the account wants to break the rule. That makes them the right tool for the handful of things a bank must never lose: the audit trail, the detection services, the organisation membership, and the Regions where its data may live.

But an SCP is also the control that can take a whole business unit offline in one AttachPolicy call, and it fails silently in ways an engineer will blame on their own IAM policy for an hour before suspecting it. The skill is not writing SCP JSON. It is writing few, narrow, tested guardrails and rolling them out like a production change.

The idea in plain language

An SCP is a ceiling on what the IAM users and roles in a member account can do. It grants nothing. If the ceiling says "no", no IAM policy in the account can raise it. An RCP is a ceiling on what can be done to resources in member accounts, whoever is asking, including principals from outside your organisation. Use SCPs to say what your people cannot do. Use RCPs to say who may touch your resources.

Analogy: a bank's rulebook versus a vault door. An SCP is a head-office rule: "no branch may open an account outside the UK and Ireland, whatever the manager says". An RCP is the vault door: "only staff of this bank may enter, whatever a branch manager signed". The rulebook limits staff. The door limits visitors.

Deny list or allow list?

StrategyHow it worksProsCons
Deny list (most common)Keep FullAWSAccess, add Deny statements for what must never happenEasy to start, new services work automatically, small policiesYou must think of everything you want to deny
Allow listRemove FullAWSAccess, attach SCPs that Allow only listed servicesStrong default-deny postureNew AWS features are blocked until added; policies grow large (10,240 character limit); every OU on the path needs the Allow

Banks mostly choose deny lists at the OU level, with an allow list only for narrow OUs where a fixed service set makes sense (a tightly scoped sandbox, a payments production OU later in maturity). Do not mix strategies at random: at every level of the path an Allow must exist, and the lab proves what happens when you forget.

The guardrail catalogue for Harbourline

#GuardrailAttach toPolicy file in the labWhy
G1Deny leaving the organisationAll OUsscp-baseline-protectA compromised account must not walk out with its data
G2Deny the root user of member accountsAll OUsscp-baseline-protectRoot bypasses IAM; deny day-to-day use
G3Protect the audit trailAll OUsscp-baseline-protectNobody switches off CloudTrail
G4Protect detection servicesAll OUsscp-baseline-protectNobody switches off GuardDuty, Security Hub or Config
G5No long-lived IAM user keysAll OUsscp-baseline-protectPeople use Identity Center and roles
G6Approved Regions onlyAll OUsscp-deny-outside-regionsData residency and attack surface
G7Sandbox limitsSandboxscp-sandbox-limitsCost and risk containment
G8Suspended deny-allSuspendedscp-suspended-deny-allFreeze closed accounts and keep the evidence
G9Resource perimeter (RCP)Workloads, Security(inline, below)Nothing outside the bank reads its buckets or keys

All the SCPs are in the lab folder, linted and tested. Read them there rather than trusting the excerpts here.

What problem the AWS service solves

Without central guardrails, the only thing stopping an engineer in an account from disabling CloudTrail is that engineer's IAM policy, which an account administrator can edit. An SCP moves that decision to a level the account's own administrators cannot reach.

What SCPs do not do

  • They do not restrict the management account.
  • They do not restrict service-linked roles.
  • They do not grant anything: a Deny is only useful if the action would otherwise be allowed.
  • They apply to principals in your member accounts. They do not stop an outsider from using access that one of your resource-based policies grants; that is what RCPs are for.
  • They do not see inside a request: they cannot enforce the contents of an object or the shape of a template (use tag policies, Config, CloudFormation Hooks or code for that).

What RCPs add, and their limits

RCPs apply to a supported set of services (S3, STS, KMS, SQS and Secrets Manager first, with more added over time) ⚠ VERIFY the current list before relying on one. Rules that bite:

  • Only Effect: Deny. The RCPFullAWSAccess policy is attached automatically and cannot be removed.
  • Principal must be "*"; target principals with conditions. NotPrincipal and NotAction are not supported.
  • You cannot write "Action": "*"; name the service, for example "s3:*".
  • 5,120 characters maximum; up to 5 attached per target, counting the built-in one.
  • They do not restrict the management account's resources and do not apply to service-linked roles acting on a resource ⚠ VERIFY.

An RCP example, a bank-wide TLS and organisation perimeter for S3 only (adapted from the pattern in Boundaries, SCPs, RCPs; replace the organisation ID):

rcp-s3-perimeter.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "S3OrganisationIdentityPerimeter",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": "*",
      "Condition": {
        "StringNotEqualsIfExists": { "aws:PrincipalOrgID": "o-a1b2c3d4e5" },
        "BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
      }
    },
    {
      "Sid": "S3RequireTls",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": "*",
      "Condition": { "BoolIfExists": { "aws:SecureTransport": "false" } }
    }
  ]
}

This one is not in the lab's policies/ folder because the lab evaluator models SCPs only. Test RCPs in a staging account with real requests. Public examples of data-perimeter policies exist in aws-samples/data-perimeter-policy-examples (MIT-0 code), which is a good starting point; adapt and test, never paste into production.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
Azure Policy deny effect at management group scopeSCP Deny on an OUSCPs match API actions and conditions, not resource property values; they cannot "audit"
Azure Policy "allowed locations"Region SCP with aws:RequestedRegion and NotAction for global servicesGlobal services are not tied to a Region; forgetting that is the classic outage
Azure Policy "not allowed resource types"SCP deny on actions (e.g. savingsplans:CreateSavingsPlan)You deny API actions, not resource types
Azure Blueprint resource locksSCP protecting actions, plus S3 Object LockThere is no "lock" resource; deny the action that would delete
Azure Policy exemptionCondition exemption (ArnNotLike aws:PrincipalArn) for a break-glass roleThe exemption is written inside the policy, so reviewing the policy reviews the exceptions
Microsoft Entra "block legacy authentication"SCP: no iam:CreateUser / iam:CreateAccessKeyYou block creation of long-lived credentials rather than a protocol
Azure private endpoints plus "disable public access" policyRCP on S3 with aws:PrincipalOrgIDThe RCP enforces who may call the resource, even if a bucket policy is wrong

Architecture

Where guardrails sit in the evaluation of a request:

The rollout path for a new guardrail:

Step-by-step implementation

Write the policy as a file in Git

One concern per policy file, one statement per rule, every statement with a Sid. Small policies are easier to review and stay below the 10,240 character limit with room to spare. Name files after what they protect: scp-baseline-protect, not scp-1.

Define the break-glass role

Create a role named hl-security-breakglass in every account (baseline stack). Protected statements exempt it with ArnNotLike on aws:PrincipalArn. Because it is the only exemption, the policy review is also the exception review. Protect the role itself: only the security team may assume it, with MFA, and every assumption pages the SOC.

Lint

Run hl-org lint on each file. Fix every error. The linter checks the mistakes that actually hurt: Region deny without NotAction, Principal in an SCP, a non-* resource on an Allow, an exemption wildcard that matches every role, a missing Sid, and size.

Evaluate offline

Write tests that state what must be denied, what must still work and what the exemption allows. The lab ships 50 of them. A guardrail with no "must still work" test is a guardrail you have not tested.

Validate with AWS where you can

Run IAM Access Analyzer validate-policy for the SCP policy type ⚠ VERIFY that your CLI version supports SERVICE_CONTROL_POLICY. It catches syntax and some logic errors that your own linter does not.

Attach to a staging OU and watch

Attach to a real test account. Run a script that exercises both the denied and the still-working actions. Watch CloudTrail for AccessDenied that mentions a service control policy. One to two weeks is normal for a production guardrail.

Promote in stages, with a rollback

Sandbox, then NonProd, then Prod in a change window. The rollback is DetachPolicy, which takes effect quickly. Practise it. Record the policy version and the person who approved.

Monitor denials

EventBridge or a CloudWatch Logs metric filter on CloudTrail for errorCode containing AccessDenied and a message about a service control policy. A sudden spike after a deploy means a guardrail is breaking a pipeline.

AWS Console instructions

  1. Console → AWS Organizations → Policies → Service control policies → Create policy. Paste the JSON, add tags (Owner, Lab), save.
  2. Open the policy, choose Targets → Attach, and pick the OU (Sandbox first).
  3. To roll back: the same page, Targets, select the OU, Detach.
  4. Resource control policies is a sibling entry under Policies; Enable resource control policies first if you have never used them.
  5. In CloudTrail → Event history (member account), filter Event name or Error code to find the denial.

AWS CLI

# One-off: make sure SCPs are enabled on the root
ROOT_ID=$(aws organizations list-roots --profile learn-management --query "Roots[0].Id" --output text)
aws organizations enable-policy-type --root-id "$ROOT_ID" --policy-type SERVICE_CONTROL_POLICY --profile learn-management

# Validate the SCP with IAM Access Analyzer (⚠ VERIFY policy-type support in your CLI version)
aws accessanalyzer validate-policy --policy-type SERVICE_CONTROL_POLICY \
  --policy-document file://policies/scp-baseline-protect.json --profile learn-management

# Create the policy and attach it to the SANDBOX OU only
POLICY_ID=$(aws organizations create-policy --name scp-baseline-protect --type SERVICE_CONTROL_POLICY \
  --description "Harbourline baseline guardrails (lab m15)" \
  --content file://policies/scp-baseline-protect.json \
  --tags Key=Project,Value=cea-lab Key=Lab,Value=m15-l1 \
  --profile learn-management --query "Policy.PolicySummary.Id" --output text)
aws organizations attach-policy --policy-id "$POLICY_ID" --target-id ou-xxxx-sandboxid --profile learn-management

# Update in place after a review (creates no new ID; effect is immediate)
aws organizations update-policy --policy-id "$POLICY_ID" --content file://policies/scp-baseline-protect.json --profile learn-management

# Who is it attached to?
aws organizations list-targets-for-policy --policy-id "$POLICY_ID" --profile learn-management

# Roll back
aws organizations detach-policy --policy-id "$POLICY_ID" --target-id ou-xxxx-sandboxid --profile learn-management

# Find denials in CloudTrail (run in the member account; the message wording is ⚠ VERIFY)
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=StopLogging \
  --profile learn-sandbox --max-results 5 \
  --query "Events[].CloudTrailEvent" --output text

Infrastructure as Code

using System.Text.Json;
using Amazon.CDK;
using Amazon.CDK.AWS.Organizations;
using Constructs;

// Creates an SCP from a JSON file in Git and attaches it to one OU.
// Compiled against Amazon.CDK.Lib 2.277.0, not deployed. ⚠ VERIFY: JsonSerializer yields JsonElement values for
// nested objects; if synthesis rejects them, convert to plain dictionaries and lists first.
public class GuardrailStack : Stack
{
    public GuardrailStack(Construct scope, string id, string sandboxOuId, string policyJsonPath) : base(scope, id)
    {
        var content = JsonSerializer.Deserialize<Dictionary<string, object>>(File.ReadAllText(policyJsonPath))!;

        _ = new CfnPolicy(this, "BaselineProtect", new CfnPolicyProps
        {
            Name = "scp-baseline-protect",
            Type = "SERVICE_CONTROL_POLICY",
            Description = "Harbourline baseline guardrails",
            Content = content,
            TargetIds = new[] { sandboxOuId }   // Sandbox first; widen only after testing
        });
    }
}

Complete code

Everything is in labs/m15-org-guardrails. The core of the evaluator is short enough to read in full, which is the point: you can explain it to an auditor.

src/Harbourline.Governance.Org/ScpEvaluator.cs (core method)
public Decision Evaluate(OrgNode account, AuthRequest request)
{
    if (account.Kind != NodeKind.Account)
        throw new ArgumentException("SCPs are evaluated for an account.", nameof(account));

    // SCPs and RCPs never restrict the management account.
    if (account.Purpose == "management")
        return new Decision(true, "SCPs do not apply to the management account.");

    // Service-linked roles are not restricted by SCPs.
    if (request.PrincipalArn.Contains(":role/aws-service-role/", StringComparison.Ordinal))
        return new Decision(true, "SCPs do not restrict service-linked roles.");

    var context = BuildContext(request);
    var path = account.PathFromRoot();

    // 1. An explicit Deny anywhere wins.
    foreach (var node in path)
    {
        foreach (var (policy, statement) in Statements(node))
        {
            if (!statement.IsAllow && Matches(statement, request, context))
                return new Decision(false,
                    $"Explicit deny in '{policy.Name}' ({statement.Sid ?? "no Sid"}) attached to {node.Name}.",
                    policy.Name, statement.Sid);
        }
    }

    // 2. Every level must offer an Allow.
    foreach (var node in path)
    {
        var allowed = Statements(node).Any(x => x.Statement.IsAllow && Matches(x.Statement, request, context));
        if (!allowed)
            return new Decision(false,
                $"No SCP attached to {node.Name} allows {request.Action}: the ceiling is not high enough.",
                MissingAllowAt: node.Name);
    }

    return new Decision(true, "Allowed by an SCP at every level and denied by none.");
}

The Region guardrail (policies/scp-deny-outside-regions.json), trimmed:

policies/scp-deny-outside-regions.json (trimmed)
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyOutsideApprovedRegions",
      "Effect": "Deny",
      "NotAction": [
        "account:*", "budgets:*", "ce:*", "cloudfront:*", "cur:*", "iam:*",
        "organizations:*", "route53:*", "route53domains:*", "sts:*", "support:*"
      ],
      "Resource": "*",
      "Condition": {
        "StringNotEquals": { "aws:RequestedRegion": ["eu-west-2", "eu-west-1", "us-east-1"] },
        "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/hl-security-breakglass" }
      }
    }
  ]
}

The shipped file has a longer exemption list. The exemption list of global services is ⚠ VERIFY against AWS's current guidance and the public sample policies before production use, because AWS adds and changes services.

Tests that state intent, from EvaluatorTests.cs:

tests/Harbourline.Governance.Tests/EvaluatorTests.cs (excerpt)
[Theory]
[InlineData("eu-west-2", true)]
[InlineData("eu-west-1", true)]
[InlineData("us-east-1", true)]
[InlineData("ap-southeast-1", false)]
[InlineData("us-west-2", false)]
public void Region_guardrail_allows_only_approved_regions(string region, bool allowed)
{
    var d = Run("payments-dev", "ec2:RunInstances", Fixtures.Developer("888888888888"), region,
        "arn:aws:ec2:" + region + ":888888888888:instance/i-1");
    Assert.Equal(allowed, d.Allowed);
}

[Fact]
public void Global_services_survive_the_region_guardrail()
{
    // IAM is a global service: requests are made against us-east-1, and NotAction exempts it anyway.
    var d = Run("payments-prod", "iam:ListRoles", Fixtures.Developer("666666666666"), "ap-southeast-1");
    Assert.True(d.Allowed, d.Reason);
}

[Fact]
public void Breakglass_role_still_cannot_leave_the_organisation()
{
    var d = Run("payments-prod", "organizations:LeaveOrganization", Fixtures.Breakglass("666666666666"));
    Assert.False(d.Allowed);
    Assert.Equal("DenyLeavingOrganisation", d.DenyingSid);
}

Run all 50:

dotnet test --solution OrgGuardrails.slnx

And a CI job (GitHub Actions) that validates every pull request touching the policies or the organisation file:

.github/workflows/guardrails.yml
name: guardrails
on:
  pull_request:
    paths: ["labs/m15-org-guardrails/**"]
permissions:
  contents: read
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: "10.0.x"
      - name: Unit tests
        run: dotnet test --solution OrgGuardrails.slnx
        working-directory: labs/m15-org-guardrails
      - name: Validate organisation design and policies
        run: >
          dotnet run --project src/Harbourline.Governance.Tool --
          validate org/harbourline-org.json policies
        working-directory: labs/m15-org-guardrails

Code explained line by line

The evaluator

  1. The first two if blocks encode the two exemptions from SCPs. Having them as code, with a test each, stops a future reader assuming SCPs are universal.
  2. PathFromRoot() gives the root-to-account chain. SCPs inherit down, so all of them matter.
  3. Step 1 loops over every statement on the path. A matching Deny returns immediately, naming the policy and the Sid. That is the information you want in an incident ("which statement blocked this?"), and why every statement needs a Sid.
  4. Step 2 requires an Allow that matches the request at every level. With only FullAWSAccess it always does. If someone has removed it and attached a narrow allow list, an action outside the list fails here with MissingAllowAt, and the reason names the level.
  5. Matches checks action (with wildcard, case-insensitive), resource (wildcard, case-sensitive) and all conditions (AND).
  6. Conditions treat a missing key the way IAM does: ...IfExists makes it true; a negated operator (StringNotEquals, ArnNotLike) is true; a positive operator is false. A test proves each.
  7. An operator the evaluator does not model throws NotSupportedException. A test double that silently returns "allowed" for things it does not understand is worse than none.

The Region guardrail

  • NotAction means "deny everything except these", so the list contains the global-service actions that must keep working.
  • StringNotEquals on aws:RequestedRegion triggers the deny when the Region is not in the list.
  • ArnNotLike on aws:PrincipalArn lets the break-glass role through.
  • The two conditions are AND-ed: deny when the Region is wrong and the caller is not break-glass.

Security considerations

⚠ Learning shortcut — not for production

The lab's evaluator is a small model of SCP behaviour for learning and for catching mistakes early. It does not replace testing in a real staging account, and it does not model RCPs, ForAnyValue/ForAllValues, numeric or date operators, policy variables, or the interaction with IAM policies and resource policies. Production guardrails need both: offline unit tests (fast, in CI) and a staging account (real AWS behaviour).

  • Your SCP is only as safe as its exemption. A wide ArnNotLike (like role/*) protects nothing; the linter flags it as HL-SCP-006.
  • Do not lock out the people who fix SCPs. The management account is exempt, so keep one tested path (a management-account role) that can detach any policy, and test it before you attach anything.
  • Guardrails are not data protection. An SCP does not encrypt, classify or log. It limits actions. Pair it with KMS, Object Lock, Macie and logging.
  • Region limits protect residency only for data you control. Replication and DR design decide where data actually lives. Involve legal and compliance on what "approved Regions" means for UK GDPR transfers; do not state it as a legal conclusion.
  • Change control. CreatePolicy, UpdatePolicy, AttachPolicy and DetachPolicy are among the most sensitive API calls in the organisation. Alert on all of them and allow only a pipeline role.
  • Do not claim compliance. "We have an SCP that denies disabling GuardDuty" is a design control that can support evidence. It does not by itself satisfy any framework requirement.

Banking use case

A new fraud analytics team asks for an account that may use only a few services and must never leave the UK Regions. Harbourline places the account in a dedicated child OU of NonProd, attaches the standard baseline and Region SCPs (inherited), and adds a narrow allow list for that OU only: S3, Athena, Glue, KMS, CloudWatch and the Identity Center service-linked roles. The platform team then runs the offline tests (Removing_FullAWSAccess_leaves_an_allow_list_that_blocks_everything_else is the pattern), attaches the policy to a staging account, and promotes after two weeks of no unexpected denials. When the team later needs Bedrock for a model experiment, the request is a one-line pull request to the allow list with a data-protection review, not an exception hidden in an account.

Common mistakes

  • Region deny on Action: "*". Blocks global services; the linter's HL-SCP-005 exists for this.
  • Attaching to the root first. One bug then affects the entire bank.
  • Removing FullAWSAccess and forgetting that a narrow allow list denies everything else, including new services.
  • Writing Principal in an SCP. Not supported. Use conditions.
  • Non-* resource on an Allow statement. Not allowed for SCP Allows; narrow only in Denies.
  • Testing with an administrator in the management account. SCPs do not apply there, so the test proves nothing. Test in a member account.
  • No Sid. Then a denial in CloudTrail says nothing about which statement fired.
  • Assuming an exemption by session name. Match on the role ARN with aws:PrincipalArn; session names are caller-chosen.
  • One giant policy. It exceeds the character limit and nobody can review it. Split by concern.

Troubleshooting

SymptomLikely causeFix
AccessDenied ... with an explicit deny in a service control policy ⚠ VERIFY wordingAn SCP Deny matchedFind which policy and statement: list targets and policies along the path, then read the statements. In the lab, hl-org check names the Sid
An action that was allowed yesterday fails after a moveThe account's new OU inherits an SCP with an Allow list lacking that actionCompare effective policies of old and new OU; add to the allow list or choose another OU
IAM Identity Center or a pipeline breaks after the Region SCPA global-service action is not in NotActionAdd the action prefix to the exemption list (after review) and re-test
Admin in the management account cannot reproduce the denialSCPs do not apply to the management accountReproduce from a member account
ConstraintViolationException when attachingMore than 10 SCPs on the target, or policy too largeMerge or trim; the lab's validator flags both
PolicyTypeNotEnabledExceptionSCPs or RCPs not enabled on the rootenable-policy-type
Lab test throws NotSupportedExceptionA condition operator the evaluator does not modelAdd support or test it in a staging account

Cost and cleanup

Cost: free. SCPs and RCPs have no charge; the lab tests run locally. Attaching guardrails to the Sandbox OU changes real behaviour, so clean up:

# Detach and delete what you created (policy must be detached from every target before deletion)
aws organizations detach-policy --policy-id "$POLICY_ID" --target-id ou-xxxx-sandboxid --profile learn-management
aws organizations delete-policy --policy-id "$POLICY_ID" --profile learn-management

# Or, if you used Terraform
cd labs/m15-org-guardrails/infra/terraform
terraform destroy -var owner=you -var root_id=r-xxxx

# Local build output
find labs/m15-org-guardrails -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} +

Exercises

  • 🟢 Guided: Run hl-org check for payments-dev and ec2:RunInstances in ap-southeast-1, then in eu-west-2. Then run lint on policies/bad/bad-region-deny.json and fix the file until the linter is quiet.
  • 🟡 Challenge: Add a guardrail G10 that stops anyone except break-glass from changing S3 Block Public Access settings (bucket level and account level). Write the policy, two tests (denied for developer, allowed for break-glass) and attach it in harbourline-org.json to Workloads.
  • 🔴 Live problem: "Since Tuesday's SCP rollout, the nightly data load fails at 02:00 in dataplatform-prod but works in dev." You have CloudTrail and the policy files. Write the investigation plan and the three most likely causes.

Assignment

Add a guardrails/ folder to your portfolio repository with: the policy JSON files, tests that state what must be denied and what must still work, the CI workflow, and a one-page rollout plan (order of OUs, time in each, rollback command, who approves). Include the output of hl-org validate.

Solutions

Knowledge check

Interview questions

  • How do you roll out an SCP to a production organisation safely? Lint, unit test, validate with Access Analyzer, attach to a staging account, watch CloudTrail, promote OU by OU with a change window and a rehearsed rollback (DetachPolicy). Alert on policy changes.
  • What is the difference between an SCP and a permission boundary? An SCP caps every principal in an account or OU, set centrally by the organisation. A permission boundary caps one IAM user or role, set within an account. Both are ceilings; effective permission is the intersection with the identity policy.
  • What does an RCP do that an SCP cannot? It restricts access to resources even from principals outside the organisation, for supported services, for example enforcing an organisation identity perimeter on S3 whatever a bucket policy says.
  • What are the limits of SCPs for compliance? They enforce a rule on API actions but do not prove the rule holds in all cases, do not cover the management account or service-linked roles, and do not inspect content. They are one control among several.

Certification practice

Completion checklist

  • I can state deny list versus allow list and why banks usually choose deny list
  • I can explain why a Region SCP needs NotAction
  • I ran hl-org lint on a bad policy and fixed it
  • I ran the 50 tests and read one test that proves a "must still work" case
  • I can describe the rollout path and the rollback command
  • I ran the cleanup

Key takeaways

  • SCPs are ceilings set where account admins cannot reach: use them for the few things that must never happen.
  • Write few, narrow, Sid-labelled policies; exempt one named break-glass role.
  • Test offline for speed and in a staging account for truth.
  • Roll out OU by OU and practise the rollback. The root is the last place.
  • RCPs protect resources from outsiders; SCPs limit your own principals.

Further reading

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page