AWS cdk: CDK security guide: add deployment trust boundary guidance
Summary
Adds a new "Deployment to a trusted environment" section explaining that CDK treats the AWS Account as the security boundary, and lists access scenarios CDK cannot guard against (Lambda-backed custom resources invokable by anyone with lambda:InvokeFunction, cross-stack resource policy replacement, StepFunctions custom resources exposing signed S3 URL secrets to stepfunctions:DescribeExecution holders). Also refines the shared-responsibility wording to "external parties" and renames the synthesis section.
Security assessment
The added text is security best-practice documentation: it defines the AWS Account as the trust boundary and warns that identities with lambda:InvokeFunction, stepfunctions:DescribeExecution, or CloudFormation deploy rights can escalate within the same account. It documents risk and guidance rather than fixing a specific vulnerability, so it is security documentation, not an incident/CVE response.
Evidence
+_(Your responsibility)_ CDK treats the [AWS Account as the security boundary](https://docs.aws.amazon.com/accounts/latest/reference/accounts-welcome.html), as is consistent with the [AWS well-architected framework](https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/aws-account-management-and-separation.html). Not all synthesized infrastructure can be guaranteed to be secure against actors with permissions in the same Account. Some unintentional access scenarios that CDK cannot guard against include, but are not limited to: CDK may create [AWS Lambda-based CloudFormation Custom Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) to perform certain actions at deployment time, any identity with `lambda:InvokeFunction` permissions will be able to trigger such a Function and effectively assume the Function’s Execution Role permissions; CloudFormation Stack deployments are able to replace resource policies on resources "owned" by another Stack; AWS StepFunctions-backed Custom Resources hold a signed S3 URL secret in their State Machine State that is readable by anyone with `stepfunctions:DescribeExecution` permissions.
Diff
diff --git a/cdk/v2/guide/security.md b/cdk/v2/guide/security.md index 216a603..6d29139 100644 --- a//cdk/v2/guide/security.md +++ b//cdk/v2/guide/security.md @@ -29 +29 @@ Given a program written in a general purpose programming language that describes -_(AWS' responsibility)_ Constructs in the AWS Construct Library are designed to generate infrastructure that does not allow data disclosure, data manipulation, elevation of privilege or other tampering by unauthorized third parties (unless explicitly configured otherwise, which is in line with the [shared responsibility model](https://aws.amazon.com/compliance/shared-responsibility-model/)). +_(AWS' responsibility)_ Constructs in the AWS Construct Library are designed to generate infrastructure that does not allow data disclosure, data manipulation, elevation of privilege or other tampering by external parties (that is, unauthenticated identities or identities from different AWS Accounts; unless explicitly configured otherwise, which is in line with the [shared responsibility model](https://aws.amazon.com/compliance/shared-responsibility-model/)). @@ -33 +33 @@ Any violation of this expectation can be reported [through the company-wide vuln -### Execution in a trusted environment +### Execution (synthesis) in a trusted environment @@ -40,0 +41,6 @@ Similarly, you should not deploy cloud assemblies from sources that you do not t +### Deployment to a trusted environment + +_(Your responsibility)_ CDK treats the [AWS Account as the security boundary](https://docs.aws.amazon.com/accounts/latest/reference/accounts-welcome.html), as is consistent with the [AWS well-architected framework](https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/aws-account-management-and-separation.html). Not all synthesized infrastructure can be guaranteed to be secure against actors with permissions in the same Account. Some unintentional access scenarios that CDK cannot guard against include, but are not limited to: CDK may create [AWS Lambda-based CloudFormation Custom Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) to perform certain actions at deployment time, any identity with `lambda:InvokeFunction` permissions will be able to trigger such a Function and effectively assume the Function’s Execution Role permissions; CloudFormation Stack deployments are able to replace resource policies on resources "owned" by another Stack; AWS StepFunctions-backed Custom Resources hold a signed S3 URL secret in their State Machine State that is readable by anyone with `stepfunctions:DescribeExecution` permissions. + +You should not use CDK in an environment where untrusted identities may perform AWS CloudFormation deployments, or where untrusted identities have IAM permissions that may touch resources created by CDK. +