Skip to main content

A Region-Deny SCP Copied From the IAM Example Blocks the us-east-1 ACM Certificate CloudFront Needs

Medium severityAmazon Web Services About 20 minutes to fix

Overview

The IAM region-deny example leaves ACM out, and CloudFront needs its certificates in us-east-1. Exempt ACM there only, without opening the Region.

At a glance

Symptom
The deploy stage that requests or looks up the distribution's certificate fails right after the account move.
Likely cause
The aws:RequestedRegion condition key compares the Region the request was sent to with the Regions in the policy, and it is always in the…
Impact
New custom domains and certificate imports for CloudFront stop until the SCP changes.
Verification signal
The deploy job's certificate stage passes, and aws acm list-certificates --region us-east-1 from the deploy role returns a list instead of the deny.
Safe correction
Add acm:* to the exemptions and put ACM under its own deny that allows only the EU Regions and us-east-1.
Rollback or recovery
Re-attach the old SCP, then detach the new one: aws organizations attach-policy --policy-id p-exampleid --target-id ou-exam-ple12345 followed by aws organizations detach-policy --policy-id p-newexample --target-id ou-exam-ple12345.

A region-deny service control policy (SCP) built from the IAM example “Denies access to AWS based on the requested Region” exempts CloudFront, IAM, Organizations, Route 53 and Support, but not AWS Certificate Manager (ACM). CloudFront only accepts ACM certificates requested or imported in US East (N. Virginia), us-east-1. Move an account that serves a CloudFront site into an OU carrying that SCP, and every ACM call its pipeline makes in us-east-1 is refused with an explicit deny. The fix is to exempt ACM in us-east-1 only, with a second statement, rather than opening us-east-1 to every service.

Symptom

The deploy stage that requests or looks up the distribution’s certificate fails right after the account move. Whether the pipeline runs the AWS CLI or Terraform, the error names the action and ends with the SCP clause. The ARN of the denying policy appears when AWS includes it; the troubleshooting guide shows the message both with and without one:

User: arn:aws:sts::111122223333:assumed-role/web-deploy/... is not authorized to perform: acm:RequestCertificate with an explicit deny in a service control policy: arn:aws:organizations::999988887777:policy/o-exampleorgid/service_control_policy/p-exampleid

Everything that runs in the EU Regions keeps working, and so do the CloudFront and Route 53 steps, which makes the ACM failure look like a broken role rather than a policy change.

Why the copied policy looks safe

The example is AWS’s own, and its NotAction list already carries the global services most people think of. If the policy was tried out from the management account first, it showed no errors at all, because SCPs never apply to users or roles there; our trap on SCPs never restricting the management account covers that gap. The assumption is that a service missing from the list is a regional service you can simply call in an allowed Region. ACM is regional, but CloudFront ties it to one Region you have just denied.

Root cause

The aws:RequestedRegion condition key compares the Region the request was sent to with the Regions in the policy, and it is always in the request context. A deny statement with NotAction and StringNotEquals on that key denies every action not listed whenever the call goes to an unlisted Region. CloudFront’s requirements page says that to use an ACM certificate with a distribution you must request or import it in us-east-1. So every ACM call for those certificates, acm:RequestCertificate, acm:ImportCertificate, acm:DescribeCertificate and the rest, goes to us-east-1 and matches the deny. A deny attached at any level above the account applies to it, whatever FullAWSAccess or identity policy allows.

The AWS Control Tower version of the same control (GRREGIONDENY) lists far more exemptions, acm:* among them. The short IAM example is the one that bites, and its own text tells you to add the other global services you use.

Impact

New custom domains and certificate imports for CloudFront stop until the SCP changes. Any pipeline stage that reads certificate state in us-east-1, such as a Terraform plan refreshing an aws_acm_certificate, fails too, so unrelated changes in the same pipeline cannot ship. The SCP limits API calls by principals in the account; it does not change how CloudFront serves existing distributions.

How to confirm it without changing anything

Run these from the management account or a delegated administrator for Organizations, then one check from the workload account:

  1. aws organizations list-parents --child-id 111122223333 shows the OU the account now sits in.
  2. aws organizations list-policies-for-target --target-id ou-exam-ple12345 --filter SERVICE_CONTROL_POLICY lists the SCPs attached directly to that OU. Repeat for each parent up to the root, because inherited policies are not listed on the child.
  3. aws organizations describe-policy --policy-id p-exampleid --query Policy.Content --output text prints the policy text. Look for the NotAction list without acm:* and a Region list without us-east-1.
  4. From the deploy role in the workload account, aws acm list-certificates --region us-east-1 fails with an explicit deny in a service control policy for acm:ListCertificates, while the same command against an allowed Region succeeds.

Following along? Tap a step’s number to tick it off.

The workaround that costs you the control

Under pressure, people add us-east-1 to the allowed Regions list. That makes the error go away and quietly allows every regional service in us-east-1: EC2, S3 buckets, RDS, the lot. The two other quick fixes are no better. Moving the account back to its old OU removes the region control entirely, and adding an aws:PrincipalArn exception for the CI role exempts the identity that creates most of the account’s resources from the Region rule.

Correction

Add acm:* to the exemptions and put ACM under its own deny that allows only the EU Regions and us-east-1. ACM stays blocked everywhere else, and no other service gains us-east-1:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyOutsideEuRegions",
      "Effect": "Deny",
      "NotAction": [
        "acm:*",
        "cloudfront:*",
        "iam:*",
        "organizations:*",
        "route53:*",
        "support:*"
      ],
      "Resource": "*",
      "Condition": {
        "StringNotEquals": {
          "aws:RequestedRegion": ["eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3"]
        }
      }
    },
    {
      "Sid": "DenyAcmOutsideEuAndUsEast1",
      "Effect": "Deny",
      "Action": "acm:*",
      "Resource": "*",
      "Condition": {
        "StringNotEquals": {
          "aws:RequestedRegion": ["eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "us-east-1"]
        }
      }
    }
  ]
}

Precondition: you work from the management account or a delegated administrator, and the OU has fewer than 10 SCPs attached directly, since you will briefly attach one more. The SCP size limit is 10,240 characters.

  1. Back up the current policy: aws organizations describe-policy --policy-id p-exampleid > region-deny-backup.json.
  2. Create the corrected policy as a new SCP: aws organizations create-policy --type SERVICE_CONTROL_POLICY --name region-deny-eu-v2 --description "EU region deny with ACM in us-east-1" --content file://region-deny-v2.json. Nothing is attached yet, so nothing changes.
  3. Attach it to a test OU holding a non-production account, run the deploy job there, and check that EC2 calls in us-east-1 are still denied.
  4. Attach the new SCP to the production OU: aws organizations attach-policy --policy-id p-newexample --target-id ou-exam-ple12345. Both policies now apply, so the account is no less restricted than before; ACM is still blocked by the old one.
  5. Detach the old SCP: aws organizations detach-policy --policy-id p-exampleid --target-id ou-exam-ple12345. SCP changes take effect immediately. Stop and roll back if anything other than ACM in us-east-1 starts succeeding there.

Validation

The deploy job’s certificate stage passes, and aws acm list-certificates --region us-east-1 from the deploy role returns a list instead of the deny. aws ec2 describe-instances --region us-east-1 from the same role must still be denied by the SCP; if it succeeds, the Region rule has been opened too far.

Rollback

Re-attach the old SCP, then detach the new one: aws organizations attach-policy --policy-id p-exampleid --target-id ou-exam-ple12345 followed by aws organizations detach-policy --policy-id p-newexample --target-id ou-exam-ple12345. Attaching first means the OU is never left without a region deny, and the saved JSON lets you recreate the original if it was deleted.

Stop it happening on the next OU move

  • Before moving an account under a region-deny SCP, list the Regions its pipelines call, including the ones fixed by another service such as CloudFront’s us-east-1 certificates.
  • Test new SCPs from a member account in a test OU, never from the management account.
  • Compare your exemptions with the Control Tower region deny list, and keep Region-pinned dependencies in their own narrow statements, as with ACM above. Our page on the other gaps in SCP coverage lists what SCPs never reach.
3

Apply the safer control

Before you change production

Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.

Fix commands and configuration

us-east-1
User: arn:aws:sts::111122223333:assumed-role/web-deploy/... is not authorized to perform: acm:RequestCertificate with an explicit deny in a service control policy: arn:aws:organizations::999988887777:policy/o-exampleorgid/service_control_policy/p-exampleid
aws:RequestedRegion
4

When to escalate

Validation and rollback are covered in the sections above.

Escalate

Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.

The KBY Brief

Fixed? Get the next one before it hits you: The KBY Brief

Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

After remediation

Further reading stays below the corrective workflow and is selected by platform, category and shared technical keywords.

More from KBY that goes with this config trap.

Discover more

Connected KBY resources