Skip to Content
Cloud Engineering Academy
5. Security for Banking & Finance

Permission boundaries, SCPs, RCPs and resource-based policies

Delegate IAM safely with permission boundaries, set organisation-wide guardrails with SCPs and RCPs, and use resource-based policies to build a data perimeter and controlled cross-account access.

advanced⏱ 2 h 🟢 FreeSCS-C03SAA-C03

Assumes: .NET 10 LTS · AWS SDK for .NET v4 (AWSSDK.IdentityManagement 4.1.1.2) · AWS CLI v2 · Region us-east-1. Verified against official sources on 2026-11-17.

Learning objectives

By the end of this lesson you can:

  • Explain the difference between policies that grant permissions (identity-based and resource-based policies) and policies that only cap them (permission boundaries, SCPs, RCPs, session policies).
  • Build a permission boundary that lets a developer create IAM roles for their own Lambda functions without being able to escalate their own privileges (Lab 5.2).
  • Write service control policies (SCPs) and resource control policies (RCPs), know who and what they do not apply to, and roll them out safely.
  • Write resource-based policies for S3, KMS, SQS, Secrets Manager and Lambda, and configure cross-account access correctly.
  • Describe the three parts of a data perimeter (identity, resource and network) and the condition keys that implement them.

Prerequisites

Why this matters in banking

Harbourline Bank has 40 product teams. The platform team cannot hand-craft every IAM role that every Lambda function needs; that bottleneck turns into weeks of waiting and, eventually, someone asking for AdministratorAccess "just for the pilot". But if developers can create roles freely, any developer can create a role with AdministratorAccess, assume it, and read the payments database. That is a privilege escalation path, and an auditor will find it in minutes.

At the same time, the bank must guarantee things no account administrator can switch off: CloudTrail stays on, data stays in approved Regions, no S3 bucket in the organisation is readable by an AWS account outside Harbourline, and customer data cannot be copied to a personal AWS account. Regulators (and the bank's own risk function) want these to be preventive controls, not just alerts after the fact.

This lesson gives you the three tools for those problems: permission boundaries (safe delegation inside an account), SCPs and RCPs (guardrails across the organisation), and resource-based policies (who may touch a specific resource, including from other accounts).

The idea in plain language

There are two kinds of IAM policies:

  1. Policies that grant. An identity-based policy ("this role may read this table") or a resource-based policy ("this bucket may be read by that role") actually gives access.
  2. Policies that cap. A permission boundary, an SCP, an RCP or a session policy can only remove access. They say "whatever else you have been given, you can never go beyond this line". On their own, they grant nothing.

The effective permission is the overlap: an action must be granted by something and not be outside any cap and not be explicitly denied anywhere.

  • A permission boundary caps one IAM user or role.
  • An SCP caps every IAM user and role (including the root user) in the member accounts it is attached to.
  • An RCP caps what anyone — inside or outside the organisation — can do to resources in the member accounts it is attached to.
  • A resource-based policy lives on a resource (bucket, key, queue, secret, function) and both grants and restricts access to it, including for other accounts.

Analogy: Think of Harbourline's head office building. The keycard (identity policy) says which doors you may open. The vault door has its own list of who may enter (resource policy). Your contract caps your authority — a junior teller's contract says "never more than £5,000 per transaction" whatever keycard you are given (permission boundary). Head office rules cap every branch — "no branch may open on Sundays" (SCP). And a building rule caps every room — "no visitor without a Harbourline badge may enter any vault" (RCP). Nobody can be authorised beyond the strictest of these.

What problem each control solves

ControlAttached toGrants?Caps whomTypical banking useSharp edges
Identity-based policyUser, group, roleYes—"Payments API role may write to the payments table"Easy to over-grant with wildcards
Resource-based policyS3 bucket, KMS key, SQS queue, SNS topic, secret, Lambda function, role trust policy, …YesAnyone named in PrincipalCross-account log delivery, KMS key accessOnly some services support them; KMS key policies are mandatory
Permission boundaryOne user or roleNoThat user or roleDevelopers creating roles for their own functionsMust be attached at creation and protected from removal
SCPOrganisation root, OU, member accountNoIAM users and roles in member accounts, including the member root userRegion restriction, "never stop CloudTrail", "never leave the organisation"Does not affect the management account or service-linked roles; max 10,240 characters; up to 10 attached per target
RCPOrganisation root, OU, member accountNoAny principal acting on resources in member accounts"Only Harbourline principals may access our S3, KMS, SQS and secrets", "TLS only"Only some services; Deny only; Principal must be "*"; max 5,120 characters; up to 5 per target (including the mandatory RCPFullAWSAccess)
Session policyOne STS sessionNoThat sessionA broker issuing narrow, short-lived credentialsPassed by the caller, so it is only as trusted as the caller
Declarative policyOrganisation root, OU, accountn/aService configuration"Block public access for all VPCs", "IMDSv2 by default", allowed AMIsConfigures services rather than filtering API calls; supports a growing list of services

Facts in this table were checked on 2026-11-17 against the AWS Organizations user guide pages for SCPs, RCPs and quotas. The CloudFormation reference for AWS::Organizations::Policy lists 5,120 characters for SCPs, while the Organizations quota page lists 10,240 ⚠ VERIFY which limit applies to SCPs created through CloudFormation; keep SCPs well under 5,120 characters to be safe.

Who SCPs and RCPs do not affect

Memorise this list; it appears in exam questions and real incidents alike:

  • The management account. Neither SCPs nor RCPs restrict principals or resources in the management account. This is why you keep workloads out of it.
  • Service-linked roles. Roles that AWS services create for themselves (AWSServiceRoleFor…) are not restricted by SCPs or RCPs.
  • RCPs and AWS managed KMS keys. RCPs do not apply to AWS managed keys (the aws/s3, aws/secretsmanager style keys), because you cannot change their permissions anyway. Another reason banks use customer managed keys.
  • SCPs and principals outside the organisation. An SCP on account A does not limit an external account B user reading account A's bucket. That gap is exactly what RCPs close.

SCPs do restrict the root user of member accounts. RCPs do restrict root users too, and they apply regardless of whether the caller belongs to your organisation.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
Azure Policy with deny effect at management groupSCP on an OUSCPs filter IAM API permissions; they do not inspect resource properties after creation the way Azure Policy audit/deny can
Azure Policy deny for public network access / storage firewallRCP (plus S3 Block Public Access, declarative policies)RCPs evaluate on every request to the resource, from any caller, including other tenants' principals
Azure RBAC role with NotActions / custom role limits for delegated adminsPermission boundaryA boundary is a separate policy that caps a role; the role's permission policy still has to grant
Entra ID PIM "role assignment eligibility" and admin unitsPermission boundary + session duration + separate permission setsAWS has no built-in admin unit; boundaries and account separation do that job
Storage account access policy, Key Vault access policy / RBAC on the vaultS3 bucket policy, KMS key policy, Secrets Manager resource policyKMS key policy is mandatory and is the root of trust for the key
Azure Lighthouse / cross-tenant accessCross-account role assumption or resource policy naming the other accountBoth sides must allow: the caller's identity policy and the resource's policy (or the role's trust policy)
Private endpoints + Deny public network accessVPC endpoints + aws:SourceVpce conditions in resource policiesNetwork restriction is written into the policy, not only into the network

Architecture

Security-boundary view. Three different lines are drawn:

  1. Organisation line (SCPs and RCPs): nothing inside a member account can exceed the SCPs, and nothing outside the organisation can reach member-account resources that RCPs protect.
  2. Account line: the account is the strongest isolation unit. Crossing it always needs an allow on both sides.
  3. Delegation line (boundaries): inside the payments-dev account, the developer can create roles, but only roles stamped with the application boundary, so nothing they create can do more than the boundary allows.

Part A — Permission boundaries and Lab 5.2

How a boundary works

A permission boundary is a managed policy you attach to a user or role in a special slot (PermissionsBoundary). For a request by that principal, the identity-based policy must allow the action and the boundary must allow it. An explicit deny in either wins.

Two subtleties matter in a bank:

  • Same-account resource policies. If a resource-based policy in the same account names an IAM user ARN directly, an implicit deny in that user's boundary does not block it. If it names an IAM role ARN, the boundary still applies. If it names a role session ARN, the permission goes straight to the session and the boundary's implicit deny does not limit it. Explicit denies always win. In practice: put explicit Deny statements in boundaries for anything that must never happen, and do not grant same-account resource access to session ARNs.
  • A boundary does nothing unless it is mandatory. The whole trick is the iam:PermissionsBoundary condition key: the developer may call iam:CreateRole only if the request attaches your boundary. Without that condition, the developer simply creates a role without a boundary.

The escalation paths you must close

When you let someone manage IAM, list the ways they could escalate and close each one:

Escalation pathHow it worksHow the lab closes it
Create a role with no boundaryiam:CreateRole without PermissionsBoundaryAllow CreateRole only with iam:PermissionsBoundary = app boundary
Remove the boundary lateriam:DeleteRolePermissionsBoundaryExplicit deny on that action
Swap to a weaker boundaryiam:PutRolePermissionsBoundary with another policySame condition key on PutRolePermissionsBoundary
Edit the boundary policy itselfiam:CreatePolicyVersion / SetDefaultPolicyVersion on the boundaryExplicit deny on the boundary policy ARNs
Modify their own roleiam:AttachRolePolicy on hl-m05-developerRole-management actions only on the path /hl-m05-app/
Pass a powerful existing role to a serviceiam:PassRole on *PassRole only for /hl-m05-app/* roles and only to lambda.amazonaws.com
Create access keys for othersiam:CreateAccessKeyNot granted (no IAM users at all)

Architecture of the lab

Step-by-step implementation (Lab 5.2)

Everything in this lab is IAM, which has no charge. Use your sandbox account with the learn-sandbox profile. Replace 111122223333 with your sandbox account ID (aws sts get-caller-identity --profile learn-sandbox).

Write the application boundary

This boundary is what every role a developer creates will carry. It allows only what Harbourline application functions normally need, only on hl-m05-* resources, and explicitly denies dangerous actions.

hl-m05-app-boundary.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowAppDataPlane",
      "Effect": "Allow",
      "Action": [
        "dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:Query", "dynamodb:UpdateItem",
        "sqs:SendMessage", "sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:GetQueueAttributes"
      ],
      "Resource": [
        "arn:aws:dynamodb:us-east-1:111122223333:table/hl-m05-*",
        "arn:aws:sqs:us-east-1:111122223333:hl-m05-*"
      ]
    },
    {
      "Sid": "AllowOwnLogs",
      "Effect": "Allow",
      "Action": ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"],
      "Resource": "arn:aws:logs:us-east-1:111122223333:log-group:/aws/lambda/hl-m05-*"
    },
    {
      "Sid": "NeverIamOrOrgOrAuditTampering",
      "Effect": "Deny",
      "Action": [
        "iam:*", "organizations:*", "sts:AssumeRole",
        "cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "kms:ScheduleKeyDeletion"
      ],
      "Resource": "*"
    }
  ]
}

Write the developer's own boundary and permission policy

The developer role also gets a boundary, so that even if someone later attaches AdministratorAccess to it, it still cannot escape. The permission policy and the boundary are deliberately almost identical here; in production the boundary is broader (the "maximum ever") and the permission policy is narrower (the "today").

hl-m05-developer-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CreateAndChangeAppRolesOnlyWithBoundary",
      "Effect": "Allow",
      "Action": [
        "iam:CreateRole", "iam:PutRolePermissionsBoundary",
        "iam:AttachRolePolicy", "iam:DetachRolePolicy",
        "iam:PutRolePolicy", "iam:DeleteRolePolicy"
      ],
      "Resource": "arn:aws:iam::111122223333:role/hl-m05-app/*",
      "Condition": {
        "StringEquals": {
          "iam:PermissionsBoundary": "arn:aws:iam::111122223333:policy/hl-m05-app-boundary"
        }
      }
    },
    {
      "Sid": "ManageAppRolesNoBoundaryChange",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole", "iam:ListRolePolicies", "iam:ListAttachedRolePolicies",
        "iam:TagRole", "iam:DeleteRole", "iam:UpdateAssumeRolePolicy"
      ],
      "Resource": "arn:aws:iam::111122223333:role/hl-m05-app/*"
    },
    {
      "Sid": "PassAppRolesToLambdaOnly",
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::111122223333:role/hl-m05-app/*",
      "Condition": { "StringEquals": { "iam:PassedToService": "lambda.amazonaws.com" } }
    },
    {
      "Sid": "ReadOnlyIamForConsole",
      "Effect": "Allow",
      "Action": ["iam:GetPolicy", "iam:GetPolicyVersion", "iam:ListPolicies", "iam:ListRoles"],
      "Resource": "*"
    },
    {
      "Sid": "DenyBoundaryRemoval",
      "Effect": "Deny",
      "Action": ["iam:DeleteRolePermissionsBoundary", "iam:DeleteUserPermissionsBoundary"],
      "Resource": "*"
    },
    {
      "Sid": "DenyEditingBoundaryPolicies",
      "Effect": "Deny",
      "Action": [
        "iam:CreatePolicyVersion", "iam:DeletePolicy", "iam:DeletePolicyVersion", "iam:SetDefaultPolicyVersion"
      ],
      "Resource": [
        "arn:aws:iam::111122223333:policy/hl-m05-app-boundary",
        "arn:aws:iam::111122223333:policy/hl-m05-developer-boundary"
      ]
    }
  ]
}

Save the same file as hl-m05-developer-boundary.json for this lab (the boundary for the developer role itself).

Create the policies and the developer role

Run the CLI commands in the AWS CLI section below. The developer role trusts your own account; your SSO admin role can assume it.

Predict, then test

Before running each test, write down "allow" or "deny" and why. Then assume the developer role and run the four tests in the CLI section. Finally, run the C# simulator, which asks IAM's policy simulator for the same answers without creating anything.

Clean up

Run the teardown commands in Cost and cleanup. IAM is free, but unused roles are attack surface.

AWS Console instructions

  1. Console → IAM → Policies → Create policy → JSON. Paste hl-m05-app-boundary.json, name it hl-m05-app-boundary. Repeat for hl-m05-developer-boundary and hl-m05-developer-policy.
  2. IAM → Roles → Create role → Custom trust policy. Use a trust policy that trusts arn:aws:iam::111122223333:root. Name it hl-m05-developer. Attach hl-m05-developer-policy.
  3. On the new role, open Permissions boundary → Set permissions boundary and choose hl-m05-developer-boundary.
  4. Add tags Project=cea-lab, Lab=m05-boundaries, Environment=learn, Owner=<you>.
  5. To test in the console: account menu → Switch role, enter the account ID and hl-m05-developer. Then try IAM → Roles → Create role with and without the boundary under Set permissions boundary.

For SCPs and RCPs (management account only): Console → AWS Organizations → Policies → Service control policies / Resource control policies → Enable (once), then Create policy, then Targets → Attach to an OU.

AWS CLI

# Who am I and which account? Use this ID everywhere below.
ACCOUNT=$(aws sts get-caller-identity --query Account --output text --profile learn-sandbox)
TAGS='Key=Project,Value=cea-lab Key=Lab,Value=m05-boundaries Key=Environment,Value=learn Key=Owner,Value=alex'

# Replace the placeholder account ID inside the JSON files (Git Bash / WSL).
sed -i "s/111122223333/$ACCOUNT/g" hl-m05-app-boundary.json hl-m05-developer-boundary.json hl-m05-developer-policy.json

# Create the three customer managed policies.
for p in hl-m05-app-boundary hl-m05-developer-boundary hl-m05-developer-policy; do
  aws iam create-policy --policy-name "$p" --policy-document "file://$p.json" \
    --tags $TAGS --profile learn-sandbox
done

# Trust policy: principals in this account (with IAM permission to assume) may assume the role.
cat > trust-self.json <<EOF
{ "Version": "2012-10-17",
  "Statement": [{ "Effect": "Allow",
    "Principal": { "AWS": "arn:aws:iam::$ACCOUNT:root" },
    "Action": "sts:AssumeRole" }] }
EOF

# Create the developer role WITH its own boundary in the same call.
aws iam create-role --role-name hl-m05-developer \
  --assume-role-policy-document file://trust-self.json \
  --permissions-boundary "arn:aws:iam::$ACCOUNT:policy/hl-m05-developer-boundary" \
  --max-session-duration 3600 --tags $TAGS --profile learn-sandbox

aws iam attach-role-policy --role-name hl-m05-developer \
  --policy-arn "arn:aws:iam::$ACCOUNT:policy/hl-m05-developer-policy" --profile learn-sandbox

Add a profile that assumes the developer role (in %USERPROFILE%\.aws\config):

[profile hl-m05-developer]
role_arn = arn:aws:iam::111122223333:role/hl-m05-developer
source_profile = learn-sandbox
region = us-east-1

Now the four tests. Lambda trust policy for the roles the developer creates:

cat > trust-lambda.json <<'EOF'
{ "Version": "2012-10-17",
  "Statement": [{ "Effect": "Allow",
    "Principal": { "Service": "lambda.amazonaws.com" },
    "Action": "sts:AssumeRole" }] }
EOF

# Test 1 — create a role WITHOUT the boundary. Expect: AccessDenied.
aws iam create-role --path /hl-m05-app/ --role-name hl-m05-try1 \
  --assume-role-policy-document file://trust-lambda.json --profile hl-m05-developer

# Test 2 — create a role WITH the app boundary. Expect: success.
aws iam create-role --path /hl-m05-app/ --role-name hl-m05-try2 \
  --assume-role-policy-document file://trust-lambda.json \
  --permissions-boundary "arn:aws:iam::$ACCOUNT:policy/hl-m05-app-boundary" \
  --profile hl-m05-developer

# Test 3 — attach AdministratorAccess to it. Expect: success (!) — but read on.
aws iam attach-role-policy --role-name hl-m05-try2 \
  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --profile hl-m05-developer

# Prove the cap: simulate what try2 can actually do (run as the learner, not the developer).
aws iam simulate-principal-policy \
  --policy-source-arn "arn:aws:iam::$ACCOUNT:role/hl-m05-app/hl-m05-try2" \
  --action-names s3:ListAllMyBuckets iam:CreateUser sqs:SendMessage \
  --resource-arns "arn:aws:sqs:us-east-1:$ACCOUNT:hl-m05-payments" \
  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output table --profile learn-sandbox

# Test 4 — try to remove or weaken the boundary. Expect: AccessDenied for both.
aws iam delete-role-permissions-boundary --role-name hl-m05-try2 --profile hl-m05-developer
aws iam create-policy-version --policy-arn "arn:aws:iam::$ACCOUNT:policy/hl-m05-app-boundary" \
  --policy-document file://hl-m05-developer-policy.json --set-as-default --profile hl-m05-developer

What you should see: tests 1 and 4 fail with AccessDenied; the simulator shows sqs:SendMessage allowed (granted by AdministratorAccess and inside the boundary) while s3:ListAllMyBuckets is implicitDeny (outside the boundary) and iam:CreateUser is explicitDeny (denied by the boundary). Attaching AdministratorAccess succeeded, but it is harmless: the boundary decides the ceiling.

SCP and RCP commands (management account)

# Run these with a management-account profile (e.g. learn-mgmt) — SCPs/RCPs are org-level.
ROOT_ID=$(aws organizations list-roots --query 'Roots[0].Id' --output text --profile learn-mgmt)

# Enable RCPs once for the organisation (SCPs were enabled in Module 0).
aws organizations enable-policy-type --root-id "$ROOT_ID" \
  --policy-type RESOURCE_CONTROL_POLICY --profile learn-mgmt

# Create an RCP from a file and attach it to the Sandbox OU only (test before the root!).
aws organizations create-policy --name hl-rcp-perimeter --type RESOURCE_CONTROL_POLICY \
  --description "Identity perimeter + TLS for supported services" \
  --content file://hl-rcp-perimeter.json --profile learn-mgmt
aws organizations attach-policy --policy-id p-examplercp1 --target-id ou-abcd-sandbox1 --profile learn-mgmt

# Which policies apply to an account, including inherited ones?
aws organizations list-policies-for-target --target-id 111122223333 \
  --filter RESOURCE_CONTROL_POLICY --profile learn-mgmt

Part B — SCPs and RCPs in depth

A baseline SCP for Harbourline

SCPs are best used as deny lists on top of the default FullAWSAccess policy. Each statement protects something the bank must never lose. The break-glass exception uses aws:PrincipalArn so that only the security team's emergency role can change these controls.

hl-scp-baseline.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyLeavingOrganisation",
      "Effect": "Deny",
      "Action": "organizations:LeaveOrganization",
      "Resource": "*"
    },
    {
      "Sid": "ProtectAuditTrail",
      "Effect": "Deny",
      "Action": [
        "cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "cloudtrail:UpdateTrail",
        "cloudtrail:PutEventSelectors"
      ],
      "Resource": "*",
      "Condition": {
        "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/hl-security-breakglass" }
      }
    },
    {
      "Sid": "ProtectDetectionServices",
      "Effect": "Deny",
      "Action": [
        "guardduty:DeleteDetector", "guardduty:DisassociateFromAdministratorAccount",
        "securityhub:DisableSecurityHub", "config:StopConfigurationRecorder",
        "config:DeleteConfigurationRecorder"
      ],
      "Resource": "*",
      "Condition": {
        "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/hl-security-breakglass" }
      }
    },
    {
      "Sid": "NoLongLivedIamUserKeys",
      "Effect": "Deny",
      "Action": ["iam:CreateUser", "iam:CreateAccessKey"],
      "Resource": "*",
      "Condition": {
        "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/hl-security-breakglass" }
      }
    }
  ]
}

Notes:

  • ArnNotLike with aws:PrincipalArn matches the role ARN even when the caller is an assumed-role session — that is why you use aws:PrincipalArn rather than aws:userid or the session ARN.
  • SCP Allow statements may only use "Resource": "*"; individual ARNs work only in Deny statements. Conditions and NotAction are allowed in both.
  • Principal and NotPrincipal are not supported in SCPs — the principals are implicitly "every IAM user and role in the account".

An identity-perimeter RCP

The classic RCP says: "no one outside Harbourline may access our resources, unless it is an AWS service acting for us, and every request must use TLS".

hl-rcp-perimeter.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "EnforceOrgIdentityPerimeter",
      "Effect": "Deny",
      "Principal": "*",
      "Action": ["s3:*", "sqs:*", "kms:*", "secretsmanager:*", "sts:AssumeRole"],
      "Resource": "*",
      "Condition": {
        "StringNotEqualsIfExists": { "aws:PrincipalOrgID": "o-a1b2c3d4e5" },
        "BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
      }
    },
    {
      "Sid": "EnforceTls",
      "Effect": "Deny",
      "Principal": "*",
      "Action": ["s3:*", "sqs:*", "kms:*", "secretsmanager:*"],
      "Resource": "*",
      "Condition": { "BoolIfExists": { "aws:SecureTransport": "false" } }
    }
  ]
}

How to read the first statement: deny the action if the caller's organisation is not ours and the caller is not an AWS service principal. …IfExists makes the condition true when the key is missing, so a request from a service principal (which has no aws:PrincipalOrgID) is handled by the second key instead. Real banks then add exceptions for third parties they genuinely trust (a payment processor's account, a SIEM vendor reading a log bucket) using aws:PrincipalAccount lists — each exception is a documented risk decision.

RCP rules (verified 2026-11-17):

  • Custom RCPs may only use "Effect": "Deny"; Allow exists only in the AWS-managed RCPFullAWSAccess, which is attached everywhere automatically and cannot be detached.
  • Principal must be "*"; use conditions to target principals. NotPrincipal and NotAction are not supported.
  • You cannot use "*" as the whole Action; you must name a service, e.g. "s3:*".
  • RCPs apply only to supported services. The list started with S3, STS, KMS, SQS and Secrets Manager in November 2024 and now includes many more (for example DynamoDB, ECR, CloudWatch Logs, SNS, EventBridge, Cognito, AWS WAF). Check the list before relying on an RCP for a service.

Rolling out guardrails without breaking production

AWS itself recommends not attaching SCPs or RCPs to the organisation root without testing. Use service last accessed data (IAM → Organizations activity) to see which services an OU actually uses before you deny others.

Declarative policies

Declarative policies are a newer Organizations policy type that sets a service configuration and keeps it, rather than filtering API calls. For EC2 they can, for example, block public access for VPCs, enforce IMDSv2 defaults, and restrict allowed AMIs. Because they are enforced in the service's control plane, they keep working when the service adds new APIs, and unlike SCPs and RCPs they also govern service-linked roles. They complement SCPs; they do not replace them.

Part C — Resource-based policies and cross-account access

A resource-based policy has a Principal element. When the principal is in the same account, either the identity policy or the resource policy is enough (with the boundary and session caveats above). When the principal is in another account, both sides must allow: the caller's identity policy in account A and the resource policy in account B.

The resource policies you will meet most

ResourcePolicy nameBanking exampleGotcha
S3 bucketBucket policyDeny non-TLS, deny access not via the bank's VPC endpoint, allow CloudTrail deliveryKeep Block Public Access on; use Object Ownership "bucket owner enforced" so ACLs are disabled
KMS keyKey policy (mandatory)Only the payments role may Decrypt; only the key-admin role may administerIf the key policy does not delegate to the account (arn:aws:iam::ACCOUNT:root), IAM policies in that account have no effect on the key
SQS queueQueue policyAllow only the bank's SNS topic to send, using aws:SourceArnWithout aws:SourceArn/aws:SourceAccount, a service principal can be used as a confused deputy
Secrets Manager secretResource policyAllow a role in the DR account to read a replicated secretCross-account access needs a customer managed KMS key; the aws/secretsmanager key cannot be shared
Lambda functionFunction policy (add-permission)Allow API Gateway (one specific API ARN) to invokeAlways set --source-arn; otherwise any API Gateway in any account could try to invoke it
IAM roleTrust policyAllow a partner account to assume a read-only role with an external IDTrust policy is the resource policy of a role; sts:ExternalId prevents confused deputy

Example — a network-restricted, TLS-only bucket policy

hl-m05-statements-bucket-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyNonTls",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::hl-m05-statements-111122223333",
        "arn:aws:s3:::hl-m05-statements-111122223333/*"
      ],
      "Condition": { "Bool": { "aws:SecureTransport": "false" } }
    },
    {
      "Sid": "DenyOutsideBankNetwork",
      "Effect": "Deny",
      "Principal": "*",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::hl-m05-statements-111122223333/*",
      "Condition": {
        "StringNotEqualsIfExists": { "aws:SourceVpce": "vpce-0a1b2c3d4e5f67890" },
        "BoolIfExists": { "aws:ViaAWSService": "false" },
        "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::111122223333:role/hl-security-breakglass" }
      }
    }
  ]
}

The second statement is a network perimeter: object reads and writes must arrive through the bank's VPC endpoint, unless an AWS service is calling on the bank's behalf (aws:ViaAWSService) or it is the break-glass role. Conditions inside one statement are ANDed, so the deny applies only when all three are true.

The data perimeter in one table

PerimeterQuestion it answersWhere to enforceKey condition
IdentityOnly trusted identities can access my resourcesRCP, resource policiesaws:PrincipalOrgID, aws:PrincipalIsAWSService
ResourceMy identities can access only trusted resourcesSCP, VPC endpoint policiesaws:ResourceOrgID
NetworkAccess only from expected networksResource policies, RCP, SCP, endpoint policiesaws:SourceVpce, aws:SourceVpc, aws:SourceIp, aws:ViaAWSService

A resource-perimeter SCP stops a compromised payments role from copying data out to an attacker-owned bucket:

hl-scp-resource-perimeter.json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "OnlyOrgOwnedS3AndSqs",
    "Effect": "Deny",
    "Action": ["s3:PutObject", "s3:GetObject", "sqs:SendMessage"],
    "Resource": "*",
    "Condition": {
      "StringNotEqualsIfExists": { "aws:ResourceOrgID": "o-a1b2c3d4e5" },
      "BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
    }
  }]
}

AWS publishes worked examples in the data perimeter policy examples repository (MIT-0); test every exception against your own service usage before you rely on them.

Infrastructure as Code

BoundaryDelegationStack.cs
using Amazon.CDK;
using Amazon.CDK.AWS.IAM;
using Constructs;

namespace Harbourline.Security.Infra;

public sealed class BoundaryDelegationStack : Stack
{
    public BoundaryDelegationStack(Construct scope, string id, IStackProps? props = null)
        : base(scope, id, props)
    {
        // 1. The boundary every developer-created app role must carry.
        var appBoundary = new ManagedPolicy(this, "AppBoundary", new ManagedPolicyProps
        {
            ManagedPolicyName = "hl-m05-app-boundary",
            Statements = new[]
            {
                new PolicyStatement(new PolicyStatementProps
                {
                    Sid = "AllowAppDataPlane",
                    Actions = new[] { "dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:Query",
                                      "sqs:SendMessage", "sqs:ReceiveMessage", "sqs:DeleteMessage" },
                    Resources = new[]
                    {
                        $"arn:aws:dynamodb:{Region}:{Account}:table/hl-m05-*",
                        $"arn:aws:sqs:{Region}:{Account}:hl-m05-*"
                    }
                }),
                new PolicyStatement(new PolicyStatementProps
                {
                    Sid = "NeverIamOrOrg",
                    Effect = Effect.DENY,
                    Actions = new[] { "iam:*", "organizations:*", "sts:AssumeRole" },
                    Resources = new[] { "*" }
                })
            }
        });

        // 2. The developer role, itself capped by a boundary (reuse for brevity).
        var developer = new Role(this, "Developer", new RoleProps
        {
            RoleName = "hl-m05-developer",
            AssumedBy = new AccountRootPrincipal(),
            MaxSessionDuration = Duration.Hours(1),
            PermissionsBoundary = CreateDeveloperBoundary(appBoundary)
        });

        developer.AddToPolicy(new PolicyStatement(new PolicyStatementProps
        {
            Sid = "CreateAppRolesOnlyWithBoundary",
            Actions = new[] { "iam:CreateRole", "iam:PutRolePermissionsBoundary",
                              "iam:AttachRolePolicy", "iam:PutRolePolicy" },
            Resources = new[] { $"arn:aws:iam::{Account}:role/hl-m05-app/*" },
            Conditions = new Dictionary<string, object>
            {
                ["StringEquals"] = new Dictionary<string, object>
                {
                    ["iam:PermissionsBoundary"] = appBoundary.ManagedPolicyArn
                }
            }
        }));

        developer.AddToPolicy(new PolicyStatement(new PolicyStatementProps
        {
            Sid = "DenyBoundaryTampering",
            Effect = Effect.DENY,
            Actions = new[] { "iam:DeleteRolePermissionsBoundary", "iam:CreatePolicyVersion",
                              "iam:SetDefaultPolicyVersion", "iam:DeletePolicyVersion" },
            Resources = new[] { "*" }
        }));

        foreach (var (k, v) in new[] { ("Project", "cea-lab"), ("Lab", "m05-boundaries"),
                                       ("Environment", "learn"), ("Owner", "alex") })
        {
            Amazon.CDK.Tags.Of(this).Add(k, v);
        }
    }

    // The developer's boundary must allow the IAM actions it delegates, so it is a separate policy.
    private IManagedPolicy CreateDeveloperBoundary(ManagedPolicy appBoundary) =>
        new ManagedPolicy(this, "DeveloperBoundary", new ManagedPolicyProps
        {
            ManagedPolicyName = "hl-m05-developer-boundary",
            Statements = new[]
            {
                new PolicyStatement(new PolicyStatementProps
                {
                    Actions = new[] { "iam:CreateRole", "iam:PutRolePermissionsBoundary",
                                      "iam:AttachRolePolicy", "iam:PutRolePolicy", "iam:GetRole",
                                      "iam:PassRole", "iam:ListRoles", "iam:GetPolicy", "iam:GetPolicyVersion" },
                    Resources = new[] { "*" }
                }),
                new PolicyStatement(new PolicyStatementProps
                {
                    Effect = Effect.DENY,
                    Actions = new[] { "iam:DeleteRolePermissionsBoundary", "iam:CreatePolicyVersion",
                                      "iam:SetDefaultPolicyVersion", "iam:DeletePolicyVersion" },
                    Resources = new[] { appBoundary.ManagedPolicyArn, $"arn:aws:iam::{Account}:role/*" }
                })
            }
        });
}

CDK also offers PermissionsBoundary.Of(scope).Apply(policy), an aspect that stamps a boundary on every role in a stack or app — useful when the platform team gives product teams a CDK template. Organization policies (SCPs/RCPs) are deployed from the management or delegated-admin account with the L1 construct Amazon.CDK.AWS.Organizations.CfnPolicy and Type = "RESOURCE_CONTROL_POLICY" or "SERVICE_CONTROL_POLICY".

Complete code

This console app asks the IAM policy simulator (SimulateCustomPolicy) how a role carrying the app boundary would be treated, without creating any resources. It is free and is a good regression test: put it in CI so a change to the boundary that suddenly allows iam:CreateUser fails the build.

BoundarySimulator.csproj
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <RootNamespace>Harbourline.Security.BoundarySimulator</RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="AWSSDK.IdentityManagement" Version="4.1.1.2" />
    <PackageReference Include="AWSSDK.SSO" Version="4.1.0.2" />
    <PackageReference Include="AWSSDK.SSOOIDC" Version="4.1.0.2" />
  </ItemGroup>
</Project>
Program.cs
using Amazon;
using Amazon.IdentityManagement;
using Amazon.IdentityManagement.Model;
using Amazon.Runtime.CredentialManagement;

namespace Harbourline.Security.BoundarySimulator;

internal static class Program
{
    // Each case: the action, the resource, and the decision we EXPECT.
    private static readonly (string Action, string Resource, string Expected)[] Cases =
    [
        ("sqs:SendMessage",     "arn:aws:sqs:us-east-1:111122223333:hl-m05-payments", "allowed"),
        ("dynamodb:GetItem",    "arn:aws:dynamodb:us-east-1:111122223333:table/hl-m05-accounts", "allowed"),
        ("s3:ListAllMyBuckets", "*", "implicitDeny"),
        ("iam:CreateUser",      "*", "explicitDeny"),
        ("sts:AssumeRole",      "arn:aws:iam::111122223333:role/hl-security-breakglass", "explicitDeny"),
    ];

    private static async Task<int> Main(string[] args)
    {
        var boundaryFile = args.Length > 0 ? args[0] : "hl-m05-app-boundary.json";
        var boundary = await File.ReadAllTextAsync(boundaryFile);

        // The "worst case" identity policy: someone attached AdministratorAccess.
        const string adminPolicy = """
            { "Version": "2012-10-17",
              "Statement": [{ "Effect": "Allow", "Action": "*", "Resource": "*" }] }
            """;

        var chain = new CredentialProfileStoreChain();
        if (!chain.TryGetAWSCredentials("learn-sandbox", out var credentials))
        {
            Console.Error.WriteLine("Profile 'learn-sandbox' not found. Run: aws sso login --profile learn-sandbox");
            return 2;
        }

        using var iam = new AmazonIdentityManagementServiceClient(credentials, RegionEndpoint.USEast1);
        var failures = 0;

        foreach (var (action, resource, expected) in Cases)
        {
            var response = await iam.SimulateCustomPolicyAsync(new SimulateCustomPolicyRequest
            {
                PolicyInputList = [adminPolicy],
                PermissionsBoundaryPolicyInputList = [boundary],
                ActionNames = [action],
                ResourceArns = [resource]
            });

            var result = (response.EvaluationResults ?? []).Single();
            var actual = result.EvalDecision.Value;
            var ok = string.Equals(actual, expected, StringComparison.OrdinalIgnoreCase);
            if (!ok) failures++;

            Console.WriteLine($"{(ok ? "PASS" : "FAIL"),-5} {action,-22} expected {expected,-13} got {actual}");
        }

        Console.WriteLine(failures == 0
            ? "Boundary behaves as designed."
            : $"{failures} case(s) differ — review the boundary before merging.");
        return failures == 0 ? 0 : 1;
    }
}

Run it with dotnet run -- hl-m05-app-boundary.json after aws sso login --profile learn-sandbox. The IAM policy simulator is free to call; it creates nothing. The module's lab project contains a fuller offline linter and simplified evaluator at labs/m05-secure-banking-api/src/Harbourline.Security.PolicyLinter with sample policies in policies/.

Code explained line by line

  1. Cases — a table-driven test: each tuple is an action, a resource ARN, and the decision IAM should return. Writing expectations before calling AWS is the habit you want for guardrails.
  2. boundaryFile / File.ReadAllTextAsync — the boundary JSON is read from disk, the same file you deploy, so the test cannot drift from reality.
  3. adminPolicy — a raw string literal (""") containing Allow * on *. We deliberately simulate the worst-case identity policy to prove the boundary alone is enough.
  4. CredentialProfileStoreChain().TryGetAWSCredentials("learn-sandbox", …) — resolves your SSO profile from ~/.aws/config. The AWSSDK.SSO and AWSSDK.SSOOIDC packages must be referenced, or SSO profiles fail at runtime.
  5. new AmazonIdentityManagementServiceClient(credentials, RegionEndpoint.USEast1) — IAM is a global service; its endpoint lives in us-east-1.
  6. SimulateCustomPolicyAsync — the policy simulator API. PolicyInputList is the identity policy; PermissionsBoundaryPolicyInputList is the boundary; ActionNames and ResourceArns describe the request.
  7. response.EvaluationResults ?? [] — in SDK for .NET v4, collection properties are null when the service returns nothing, so always guard with ?? [].
  8. result.EvalDecision.Value — one of allowed, explicitDeny or implicitDeny. explicitDeny means a Deny statement matched; implicitDeny means nothing allowed it (here: the boundary did not include it).
  9. The return code (0/1) lets a pipeline fail the build when a boundary change weakens the guardrail.

What the simulator does not model

SimulateCustomPolicy evaluates the policies you pass in. It does not include SCPs or RCPs from your organisation; SimulatePrincipalPolicy includes SCPs that apply to the account in some cases ⚠ VERIFY current RCP support in the simulator. Always confirm a guardrail with a real call in a test account, and watch CloudTrail.

Security considerations

⚠ Learning shortcut — not for production

The developer role trusts arn:aws:iam::ACCOUNT:root, so any principal in the sandbox account with sts:AssumeRole permission can use it. In production, developers reach this role through an IAM Identity Center permission set (for example PaymentsDeveloper) and the trust policy names the SSO role pattern with aws:PrincipalArn, plus aws:MultiFactorAuthPresent where applicable.

⚠ Learning shortcut — not for production

The RCP and SCP examples use a single break-glass role and a hard-coded organisation ID. In production, break-glass use triggers an alarm (EventBridge rule on AssumeRole for that role), is time-boxed, and is reviewed by a second person. Organisation IDs and exception account lists live in version control with change approval.

  • Boundaries are not a substitute for review. A boundary caps the blast radius, but anything inside the boundary is still available to every role the developer creates. Keep the boundary as narrow as the platform allows and review it like code.
  • Guard the guardrails. Every policy that implements a control must be protected from modification by the people it constrains: deny CreatePolicyVersion on boundaries, keep SCP/RCP management in the management or a delegated security account.
  • Remember the management account gap. Nothing in this lesson protects the management account. Keep it empty of workloads, and give very few people access.
  • Validate before deploy. Run IAM Access Analyzer validate-policy (and custom policy checks) in the pipeline; see Least privilege in practice.
  • Shared responsibility. AWS guarantees that SCPs, RCPs and boundaries are enforced as documented (security of the cloud). Choosing the right guardrails, testing them and proving to auditors that they work is the bank's job (security in the cloud). These guardrails support, but do not by themselves satisfy, any regulatory requirement — your security architecture and compliance teams decide that.

Banking use case

Harbourline's payments platform team publishes a "golden" CDK library. Every stack it produces applies hl-app-boundary to all roles using PermissionsBoundary.Of(app).Apply(...). Product teams get the PaymentsDeveloper permission set in their dev and test accounts, which lets them create roles only with that boundary — so a new fraud-scoring Lambda gets its own least-privilege role in minutes, without a ticket.

At organisation level, the Workloads OU has hl-scp-baseline (no leaving the org, no stopping CloudTrail, GuardDuty or Config, no IAM users or access keys) and a Region SCP (only eu-west-2 and us-east-1 for global services). The root has hl-rcp-perimeter, with one documented exception: the account of the bank's card processor (fictional "Tidewater Card Services") may read objects under settlement-files/ in one bucket. Production accounts additionally carry a resource-perimeter SCP so a compromised workload cannot write customer data to buckets outside the organisation. The security team reviews AccessDenied events for these guardrails weekly; repeated denials usually mean either an attack or a legitimate need that should become a documented exception.

Common mistakes

  • Boundary without the iam:PermissionsBoundary condition → developers simply create roles without it → always pair delegation permissions with that condition key.
  • Forgetting PutRolePermissionsBoundary and DeleteRolePermissionsBoundary → a developer replaces or removes the boundary after creation → condition on the first, explicit deny on the second.
  • iam:PassRole on * → a developer passes the bank's admin role to an EC2 instance and uses it → limit PassRole by path and iam:PassedToService.
  • Attaching a new SCP to the root first → every account loses access to a service it needed, including pipelines → roll out OU by OU.
  • Expecting SCPs to protect the management account → they do not → keep workloads out of it.
  • Writing an RCP with Effect: Allow or a specific Principal → creation fails → custom RCPs are Deny-only with "Principal": "*".
  • Cross-account access with only one side configured → AccessDenied → both identity policy (caller's account) and resource policy (resource's account) must allow; for SSE-KMS, the key policy too.
  • Sharing a secret encrypted with aws/secretsmanager cross-account → cannot be decrypted by the other account → use a customer managed KMS key.
  • Lambda permission without --source-arn → any API in any account could attempt invocation → always scope service principals with aws:SourceArn/aws:SourceAccount.

Troubleshooting

SymptomLikely causeFix
AccessDenied … with an explicit deny in a service control policyAn SCP blocks the actionFind the SCP with list-policies-for-target; check Region conditions and exceptions
AccessDenied … with an explicit deny in a resource control policyAn RCP blocks access to the resourceCheck aws:PrincipalOrgID/TLS conditions; is the caller an AWS service without aws:PrincipalIsAWSService?
… because no permissions boundary allows the … actionAction not in the boundaryAdd to the boundary (after review) or use a different role
CreateRole denied even with the boundaryWrong boundary ARN, or role path not /hl-m05-app/Compare ARNs exactly; the condition is StringEquals
MalformedPolicyDocument when creating an RCPAllow effect, specific principal, NotAction, or "Action": "*"Use Deny, "Principal": "*", name services
Cross-account S3 PutObject succeeds but readers get AccessDeniedObject owned by writer; or KMS key policy does not allow readerSet Object Ownership to bucket owner enforced; grant kms:Decrypt in key policy
SNS cannot deliver to SQSQueue policy missing or wrong aws:SourceArnAllow sns.amazonaws.com with aws:SourceArn = topic ARN
ConstraintViolationException attaching an SCP10 SCPs already attached to the targetMerge policies; quotas are hard limits

Cost and cleanup

IAM, policy simulation, AWS Organizations, SCPs and RCPs have no charge. The lab creates only IAM objects. Delete them anyway: unused roles and policies are attack surface and clutter your audit evidence.

ACCOUNT=$(aws sts get-caller-identity --query Account --output text --profile learn-sandbox)

# Remove test roles created by the developer.
aws iam detach-role-policy --role-name hl-m05-try2 \
  --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --profile learn-sandbox
aws iam delete-role --role-name hl-m05-try2 --profile learn-sandbox

# Remove the developer role.
aws iam detach-role-policy --role-name hl-m05-developer \
  --policy-arn "arn:aws:iam::$ACCOUNT:policy/hl-m05-developer-policy" --profile learn-sandbox
aws iam delete-role-permissions-boundary --role-name hl-m05-developer --profile learn-sandbox
aws iam delete-role --role-name hl-m05-developer --profile learn-sandbox

# Delete the policies.
for p in hl-m05-developer-policy hl-m05-developer-boundary hl-m05-app-boundary; do
  aws iam delete-policy --policy-arn "arn:aws:iam::$ACCOUNT:policy/$p" --profile learn-sandbox
done

# If you attached an RCP to the Sandbox OU, detach and delete it (management account).
# aws organizations detach-policy --policy-id p-examplercp1 --target-id ou-abcd-sandbox1 --profile learn-mgmt
# aws organizations delete-policy --policy-id p-examplercp1 --profile learn-mgmt

# Confirm nothing tagged for this lab remains.
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
  --query 'ResourceTagMappingList[].ResourceARN' --profile learn-sandbox
aws iam list-roles --path-prefix /hl-m05-app/ --profile learn-sandbox

Exercises

  • 🟢 Guided: Complete Lab 5.2 above. Record the result of each test and which policy statement caused it.
  • 🟡 Challenge: Extend the developer policy so developers may also create inline policies on their app roles, and may create roles for ECS tasks (ecs-tasks.amazonaws.com) as well as Lambda — without opening any new escalation path. Prove it with the C# simulator and two real calls.
  • 🔴 Live problem: A ticket arrives: "Since this morning the data-platform team's nightly Glue job in analytics-prod fails with AccessDenied writing to s3://hl-reporting-exports. Nothing changed on our side." Yesterday the security team attached a new RCP to the Workloads OU. Investigate (using CloudTrail and the policies), decide whether this is a bug in the RCP or a real policy violation, and propose a fix that keeps the perimeter intact.

Assignment

Create a guardrails/ folder in your portfolio repository with: hl-scp-baseline.json, hl-rcp-perimeter.json, the app and developer boundary policies, the C# boundary simulator, and a one-page README.md that lists every escalation path you closed and how. Add a GitHub Actions job that runs aws accessanalyzer validate-policy on each JSON file (with OIDC credentials — see Federation and segregation of duties).

Solutions

Knowledge check

Interview questions

  • "How would you let 40 product teams create their own IAM roles without giving them a path to admin?" — Permission boundaries made mandatory with the iam:PermissionsBoundary condition, delegation limited to a role path, PassRole restricted by path and service, explicit denies on boundary removal and edits, delivered through a permission set and enforced in CDK with an aspect. Plus Access Analyzer validation in CI.
  • "What is the difference between an SCP and an RCP?" — SCPs cap what principals in my member accounts can do anywhere; RCPs cap what anyone can do to resources in my member accounts. Together they form the identity and resource sides of a data perimeter. Neither grants anything and neither affects the management account or service-linked roles.
  • "Explain a data perimeter." — Three checks: only trusted identities access my resources (RCP + aws:PrincipalOrgID), my identities access only trusted resources (SCP + aws:ResourceOrgID), and access only from expected networks (aws:SourceVpce, aws:SourceIp). Exceptions for AWS services acting on my behalf use aws:PrincipalIsAWSService and aws:ViaAWSService.
  • "A colleague wants to attach a new SCP at the organisation root today. What do you say?" — Test it first in a sandbox OU, check service-last-accessed data and CloudTrail AccessDenied events, roll out OU by OU, keep a break-glass exception, and have a rollback plan.

Certification practice

Completion checklist

  • I can explain which policy types grant and which only cap, in two sentences
  • I completed Lab 5.2 and recorded the reason for each allow/deny
  • I can list who SCPs and RCPs do not affect
  • I wrote an identity-perimeter RCP and know why aws:PrincipalIsAWSService is needed
  • I can list every policy needed for a cross-account SSE-KMS read
  • I ran the cleanup and confirmed no hl-m05-* roles or policies remain

Key takeaways

  • Boundaries, SCPs, RCPs and session policies never grant; they only cap. An action needs a grant and must pass every cap.
  • A permission boundary only delivers safe delegation when it is mandatory (iam:PermissionsBoundary condition) and tamper-proof (deny removal and edits).
  • SCPs cap principals in member accounts (including their root users); RCPs cap access to resources in member accounts from anyone. Neither touches the management account or service-linked roles.
  • Cross-account access needs an allow on both sides; KMS key policies are always part of the decision for encrypted data.
  • A data perimeter combines identity (aws:PrincipalOrgID), resource (aws:ResourceOrgID) and network (aws:SourceVpce) controls — roll guardrails out OU by OU, never root-first.

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