Apply a permissions boundary through the CDK bootstrap default so both deployment and Lambda roles are capped
A company uses an AWS Cloud Development Kit (AWS CDK) application for its infrastructure. The AWS CDK application creates AWS Lambda functions and the IAM roles that are attached to the functions. The company also uses AWS Organizations. The company's developers can assume the AWS CDK application deployment role. The company's security team discovered that the developers and the role used to deploy the AWS CDK application have more permissions than necessary. The security team also discovered that the roles attached to the Lambda functions that the CDK application creates have more permissions than necessary. The developers must not have the ability to grant additional permissions. Which solution will meet these requirements with the LEAST operational overhead?
Community Votes
62% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
A permissions boundary caps the maximum permissions a principal can hold and cannot be exceeded by any allow, which is what satisfies both the over-permission problem and the requirement that developers must not be able to grant additional permissions (B). Option B is also the only choice that fixes both roles in one mechanism: updating the CDK bootstrapping default and the application's default boundary means the deployment roles and the generated Lambda roles are both capped without anyone editing IAM by hand (B). Option C relies on developers remembering to pass the boundary name in their code, which they could simply omit. Option A denies the very actions the CDK application needs in order to create roles at all.
Both the role developers assume to deploy the CDK application and the roles the CDK application attaches to the Lambda functions it creates carry more permissions than necessary, and developers must not be able to grant themselves more. An IAM permissions boundary policy defining the maximum actions the CDK application requires can be applied at two points in a single configuration change: the account's CDK bootstrapping can set it as the default permissions boundary for roles the CDK tooling creates, and the CDK application configuration can set the default permissions boundary so the generated Lambda roles inherit it. Because the boundary is enforced by IAM rather than by denying actions, no principal can exceed it.
Instructing developers to use the permissions boundary policy name when they create a role in the CDK application code (C) — teo2157 identified this precisely, that this constrains nothing automatically because it depends on developers supplying the boundary name in their code, and a developer can simply omit it; it also does nothing about the deployment role itself. Creating an SCP that denies iam:CreateRole and iam:UpdateRole and centrally creating roles for developers to use (A) — an SCP can only subtract permissions, so denying role creation prevents the CDK application from creating any Lambda roles at all rather than constraining what those roles may do, and it removes the developers' ability to make legitimate changes. Using IAM Access Analyzer to verify the Lambda function role after the fact (D) in option V — Access Analyzer is a validation and reporting tool, so it identifies over-permissive roles but does not prevent or cap them.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Two separate roles are over-permissioned: the role developers assume to deploy the AWS CDK application, and the roles the CDK application creates and attaches to its Lambda functions. An IAM permissions boundary is the right control because it defines the maximum permissions a principal can hold, and because an explicit deny anywhere in the evaluation wins, a principal can never exceed its boundary no matter what identity-based policies allow; that is what satisfies both the excess-permission problem and the requirement that developers must not be able to grant additional permissions. Option B applies the boundary in the two places that matter and is the least operational overhead because it changes configuration rather than adding a separate enforcement system. Updating the account's AWS CDK bootstrapping to use the permissions boundary means the deployment roles the CDK tooling assumes are bounded as soon as bootstrapping runs. Updating the CDK application configuration to use the same policy as the default permissions boundary means every role the application generates for its Lambda functions is bounded automatically, with no per-role editing. Srikantha summarized this as enforcing least privilege at the CDK bootstrap level so that both the developer permissions and the Lambda function roles are restricted, and phu0298 highlighted that placing the boundary directly in the CDK workflow makes the created roles inherently compliant rather than relying on a later validation pass. B is the correct answer.Why the Other Options Are Wrong
A creates an SCP that denies iam:CreateRole and iam:UpdateRole for the developer role and the CDK application deployment role, and centrally creates new IAM roles for the developers to attach to the Lambda functions. An SCP can only subtract permissions, so denying role creation prevents the CDK application from creating any roles for its Lambda functions at all, rather than constraining what those roles may do once created. That breaks the deployment rather than securing it, and centralizing role creation for the developers adds a process they must go through. phu0298's objection to the competing options noted that the boundary approach removes the need for a separate IAM Access Analyzer validation step because the roles are compliant by construction, which this option lacks. C creates a permissions boundary policy and instructs developers to use the boundary policy name when they create a role in the CDK application code. As teo2157 pointed out, this restricts nothing automatically, because it depends on developers supplying the boundary name and a developer can simply omit it; it also does nothing to bound the deployment role itself, so developers could still exceed the intended permissions. D creates an SCP denying iam:CreateRole and iam:UpdateRole for the developer role, gives the CDK deployment role permission to create the Lambda function roles, and runs IAM Access Analyzer to verify the Lambda function role. Access Analyzer is a validation and reporting capability: it can tell the team that a role is over-permissive, but it does not cap the role or prevent anyone from attaching broader permissions later, so it detects the problem without solving it. B is correct.Community Comment Notes
Community was split, B (63) against A (38). Srikantha supported B, describing it as using a permission boundary at the AWS CDK bootstrap level to restrict both developer permissions and Lambda function roles, enforcing least privilege with no manual IAM role management. phu0298 supported B on the grounds that placing the permission boundary directly in the CDK workflow makes the created roles inherently compliant, removing the need for a reactive IAM Access Analyzer validation step, which is precisely what option D relies on. teo2157 preferred A on the reasoning that B does not restrict the developer's permissions and only constrains the CDK role; this is a fair reading of the narrow mechanism, but the boundary in B is what caps both the deployment role and the generated roles without denying the actions the application needs. The community did not reach a clear majority on which role is bounded more completely.Official Reference
Related Analysis
Practice All DOP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full DOP-C02 Practice Test →