Check for blocking SCPs and IAM permission boundaries, fix them in CodeCommit, and deploy through CloudFormation

Answer Correct answer: D — verify no SCP or permissions boundary blocks access, fix them in CodeCommit, and deploy through CloudFormation.

A company has an organization in AWS Organizations. A DevOps engineer needs to maintain multiple AWS accounts that belong to different OUs in the organization. All resources, including IAM policies and Amazon S3 policies within an account, are deployed through AWS CloudFormation. All templates and code are maintained in an AWS CodeCommit repository. Recently, some developers have not been able to access an S3 bucket from some accounts in the organization. The following policy is attached to the S3 bucket: What should the DevOps engineer do to resolve this access issue? - image

  1. Modify the S3 bucket policy. Turn off the S3 Block Public Access setting on the S3 bucket. In the S3 policy, add the aws:SourceAccount condition. Add the AWS account IDs of all developers who are experiencing the issue.
  2. Verify that no IAM permissions boundaries are denying developers access to the S3 bucket. Make the necessary changes to IAM permissions boundaries. Use an AWS Config recorder in the individual developer accounts that are experiencing the issue to revert any changes that are blocking access. Commit the fix back into the CodeCommit repository. Invoke deployment through CloudFormation to apply the changes.
  3. Configure an SCP that stops anyone from modifying IAM resources in developer OUs. In the S3 policy, add the aws:SourceAccount condition. Add the AWS account IDs of all developers who are experiencing the issue. Commit the fix back into the CodeCommit repository. Invoke deployment through CloudFormation to apply the changes.
  4. Ensure that no SCP is blocking access for developers to the S3 bucket. Ensure that no IAM policy permissions boundaries are denying access to developer IAM users. Make the necessary changes to the SCP and IAM policy permissions boundaries in the CodeCommit repository. Invoke deployment through CloudFormation to apply the changes. Correct Answer

Community Votes

D
100%

100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

A denial can come from either an organization-level guardrail or a permissions boundary, and because only some accounts are affected the fault is very likely account-specific, which is exactly the pattern an SCP on a specific OU or a boundary on specific principals would produce (D). Because the company requires all changes through CloudFormation from CodeCommit, the fix must be committed and deployed the same way (D). Option B checks only boundaries and then uses a Config recorder in the developer accounts to revert changes, which both misses SCPs and introduces an out-of-band rollback mechanism the IaC model excludes. Option C's SCP would affect all developers rather than the affected subset.

Developers in only some accounts are losing S3 access, and everything in the organization including IAM policies and S3 bucket policies is deployed through CloudFormation from CodeCommit. The correct resolution is to identify both possible causes of a denial, an SCP applied at an OU or account and an IAM permissions boundary on the developers, make the necessary changes in the CodeCommit repository, and invoke deployment through CloudFormation so the fix follows the same code path as everything else. This is the only option that covers both denial layers while respecting the IaC requirement.

Verifying only IAM permissions boundaries and using an AWS Config recorder in the affected developer accounts to revert changes (B) — teo2157's objection is decisive, because if an SCP were the cause it would affect every developer under it rather than only some, and teo2157 additionally noted the Config recorder allows tracing of IAM policy changes; in any case this option ignores SCPs entirely and applies changes through a rollback mechanism instead of through CloudFormation. Creating an SCP that stops anyone from modifying IAM resources and adding an aws:SourceAccount condition with the affected account IDs (C) — an SCP applies to every principal in the accounts it is attached to, so it would not isolate the affected accounts the way the scenario describes, and disabling IAM modification is unrelated to an S3 access problem. Turning off S3 Block Public Access in the bucket policy (A) — this loosens the bucket's public-access posture rather than resolving an authorization denial, and adding account IDs to a condition does not restore permissions that an SCP or boundary removed.

Community Discussion (4 comments)

trungtd 👍 5 Selected: D
Option D is the most comprehensive and aligns with the requirements: - It ensures that both SCPs and IAM policies are correctly configured. - It adheres to the use of CloudFormation for all changes. - It addresses the immediate issue while providing a scalable and manageable approach.
teo2157 👍 1 Selected: B
Going with B as if there was an SCP in place, it affects all developers and not some of them. Furthermore, with the config recorded you can trace the changes done in the iam policies for the users that are not able to access the S3 bucket and fix it.
jamesf 👍 4 Selected: D
  • Comprehensive approach: Reviews both SCPs and IAM permissions boundaries that could block access. - Changes are committed to CodeCommit and deployed through CloudFormation, maintaining the required deployment pipeline. - By checking both SCPs and permissions boundaries, this solution covers potential organizational and account-level restrictions that could impact access.
tgv 👍 4 Selected: D
---> D

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The symptom is that some developers in some accounts cannot access the S3 bucket, and there are two independent mechanisms in this organization that can produce exactly that denial. The first is an SCP attached to a specific OU or account, which caps permissions for every principal beneath it regardless of what identity-based policies allow; if such an SCP were attached broadly it would affect everyone under it, but one attached to a narrower OU can affect only a subset of accounts, matching the reported pattern. The second is an IAM permissions boundary attached to the developers, which also caps what they can do. The correct response therefore is to ensure neither an SCP nor a permissions boundary is blocking access, make the necessary changes in the CodeCommit repository, and invoke deployment through CloudFormation so that the fix is applied through the same infrastructure-as-code path as every other change in the organization (D). Only this option covers both denial layers while honoring the stated IaC requirement. D is the correct answer.

Why the Other Options Are Wrong

A modifies the S3 bucket policy, turns off S3 Block Public Access, adds an aws:SourceAccount condition, and adds the account IDs of the affected developers. Turning off Block Public Access weakens the bucket's public-access protection rather than fixing an authorization denial, and listing account IDs in a bucket policy condition does not restore permissions that an SCP or a permissions boundary has removed, since those caps apply regardless of any allow. B verifies that no IAM permissions boundaries are denying access, makes changes to boundaries, and then uses an AWS Config recorder in the affected developer accounts to revert blocking changes before committing the fix and deploying through CloudFormation. teo2157 pointed out two defects: if an SCP were responsible it would affect all developers under it rather than only some, and this option does not check SCPs at all; additionally teo2157 noted that a Config recorder would let the team trace what changed. Introducing a recorder-driven revert also creates a second, out-of-band change mechanism in a company that requires all changes through CloudFormation. C configures an SCP preventing anyone from modifying IAM resources in the developer OUs and adds an aws:SourceAccount condition with the affected account IDs. An SCP applies to every principal in the accounts it is attached to, so it cannot selectively target only the affected accounts, and preventing modification of IAM resources does not address an S3 access denial. D is correct.

Community Comment Notes

Community voted D (93). trungtd described D as the most comprehensive option, noting that it ensures both SCPs and IAM policies are correctly configured and that it adheres to the requirement to use CloudFormation for all changes. jamesf highlighted that D reviews both SCPs and IAM permission boundaries and keeps changes committed to CodeCommit and deployed through CloudFormation, preserving the required model. teo2157 was the sole dissenter, preferring B on the reasoning that an SCP would affect all developers rather than some and that a Config recorder would allow tracing of IAM policy changes; the first point is a valid argument about the symptom pattern but does not excuse B's omission of SCPs or its out-of-band revert mechanism.

Official Reference

Related Analysis

Practice All DOP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full DOP-C02 Practice Test →

← Back to DOP-C02 Study Guide