Skip to main content
KBY Technologies Logo

Swapping FullAWSAccess for a Deny-Only SCP Blocks Every Action in the Member Accounts Beneath It

High severityAmazon Web Services About 20 minutes to fix

Overview

The detach is accepted because one SCP remains, but a Deny statement is not an Allow, so everything under the target fails.

At a glance

Symptom
Within moments of the detach, people and pipelines in the affected accounts start getting AccessDenied on everything.
Likely cause
SCP evaluation is deny by default.
Impact
Every user and role in every member account under the target, including each account's root user.
Verification signal
Repeat, with the same principal, an action that failed before.
Safe correction
Restore the Allow first, and leave the guardrail where it is.
Rollback or recovery
The only change in the fix is one attachment, and detach-policy reverses it.

Someone attaches a new SCP made of Deny statements, then detaches FullAWSAccess to keep the target tidy. AWS Organizations accepts it, because every target only has to keep one SCP. But an action needs an explicit Allow at every level, and a Deny statement is not an Allow. Every action from every member account beneath that target now fails, whatever its IAM policies say. Re-attach FullAWSAccess beside the Deny policy, or give your policy an Allow statement.

Symptom

Within moments of the detach, people and pipelines in the affected accounts start getting AccessDenied on everything. Administrators, deployment roles and the account’s root user all fail the same way. The message names the missing allowance rather than a denial:

User: arn:aws:iam::123456789012:user/John is not authorized to perform: codecommit:ListRepositories because no service control policy allows the codecommit:ListRepositories action

That wording is the implicit form. An explicit denial instead ends with with an explicit deny in a service control policy, and may name the policy. The two need different fixes, so read which one you have.

The person who made the change often sees nothing wrong. SCPs do not affect users or roles in the management account, so their own console and CLI keep working.

Why it looks safe

The order is the one AWS describes. The detach-policy reference says every root, OU and account must have at least one SCP attached, and that to replace the default FullAWSAccess you attach the replacement before removing it. A Deny-only policy satisfies that rule, so the detach goes through with no warning.

It also tested well. The deny-list examples in AWS’s SCP repository are Deny statements, and a pilot ran with FullAWSAccess still attached, so the Deny policy blocked exactly what it should. Nothing in that pilot exercised the Allow.

Root cause

SCP evaluation is deny by default. For a permission to be allowed in an account, an explicit Allow statement has to exist at every level from the root through each OU on the path to the account, including the account itself. FullAWSAccess is the managed policy that supplies that Allow, which is why AWS Organizations attaches it to every root, OU and account when SCPs are enabled.

AWS documents the Deny-only case directly. If the root has only a Deny statement and no allowing policy, all member accounts get no service access, and a Deny-only SCP blocks every service unless an explicit Allow covers it. The same page says that if FullAWSAccess is removed and not replaced at any level, everything under that level is blocked. The SCP examples page adds that its deny-list policies need FullAWSAccess or another allowing policy attached beside them.

Impact

Every user and role in every member account under the target, including each account’s root user. The change is immediate. SCPs filter permissions rather than grant them, so an IAM administrator policy cannot restore anything: if the SCPs do not allow an action, the principal cannot perform it.

Service-linked roles are not restricted by SCPs, so some AWS-driven activity may carry on while people are locked out. That makes the outage look partial and odd.

There is a recovery catch. The attach and detach calls run only from the management account or a delegated administrator, and SCPs apply to member accounts designated as delegated administrators. If your delegated administrator sits under the affected target, it is locked out too. Fix it from the management account.

How to confirm it

These checks only read. Run them as a principal in the management account. First list the SCPs attached directly to the target. The output omits inherited policies, so repeat it for each parent:

aws organizations list-policies-for-target --filter SERVICE_CONTROL_POLICY --target-id ou-examplerootid111-exampleouid111

Use aws organizations list-parents --child-id 123456789012 to find the parent of an account or OU, and work up to the root. Then read the document of each SCP you find:

aws organizations describe-policy --policy-id p-examplepolicyid111

In the Content field, look for "Effect": "Allow". If, at any level on the path, every attached policy holds only Deny statements, you have found it. The Allow is missing at every level where FullAWSAccess was detached.

The shortcuts that make it worse

  • Grant more in IAM. It changes nothing, because the SCP caps what IAM can grant.
  • Move the accounts to an OU or root that still has FullAWSAccess. Access returns, but only because the Deny policy no longer sits on their path. The guardrail you were building is gone for those accounts.
  • Detach the Deny policy. If it is the only SCP on the target, AWS refuses, since you can’t remove the last SCP from an entity. If another policy is there, you lose the guardrail.
  • Run the urgent work from the management account. SCPs cannot restrict it, so you would be moving workloads to the one place your guardrails do not reach.

Correction

Restore the Allow first, and leave the guardrail where it is. You need management account credentials and the organizations:AttachPolicy permission.

  1. Save the current state. Keep the output of list-policies-for-target for the target and its parents. Rollback: none needed, as it only reads.
  2. Find the managed policy. Run aws organizations list-policies --filter SERVICE_CONTROL_POLICY --query "Policies[?Name=='FullAWSAccess'].[Id,Name,AwsManaged]". Check NextToken in case a page is empty.
  3. Attach it to the target that lost it. Run aws organizations attach-policy --policy-id <FullAWSAccess id> --target-id <OU or account id>. It takes effect immediately and prints nothing. Rollback: detach-policy with the same two values, which is safe because the Deny policy remains attached.
  4. Decide about the allow-list. If you really want only chosen services allowed, edit your own SCP to add Allow statements for them, and test on one OU first. Detach FullAWSAccess only once that policy covers every service in use. Service last accessed data in IAM and CloudTrail show which ones.

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

Verification

Repeat, with the same principal, an action that failed before. It should now succeed. Then run an action your Deny policy blocks. The message should now say with an explicit deny in a service control policy, which shows the guardrail is working and the missing Allow was the only fault. Run list-policies-for-target again and confirm both policies appear.

Rollback

The only change in the fix is one attachment, and detach-policy reverses it. Do not reverse it while the Deny policy is the sole SCP on the target. AWS will not remove the last SCP, and the earlier state was the broken one anyway. If you edited an SCP, restore the document you saved from describe-policy.

Avoiding the swap by keeping FullAWSAccess attached

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

FullAWSAccess
User: arn:aws:iam::123456789012:user/John is not authorized to perform: codecommit:ListRepositories because no service control policy allows the codecommit:ListRepositories action
with an explicit deny in a service control policy
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.

Found this useful? Follow KBY for more like it.

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