You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Placeholder substitution**: Replace `ACCOUNT_ID` with your 12-digit AWS account ID and `REGION` with your deployment region (e.g., `us-east-1`) throughout this document.
29
+
28
30
```bash
29
31
# Create all three policies in your account, then re-bootstrap:
The `--cloudformation-execution-policies` flag can be repeated to attach multiple policies to the CloudFormation execution role.
@@ -684,8 +686,9 @@ These policies are conservative-but-scoped starting points. To tighten further:
684
686
3.**Add region conditions** where possible (e.g., `"aws:RequestedRegion": "us-east-1"`) to prevent cross-region resource creation.
685
687
4.**Restrict `iam:AttachRolePolicy`** with an `iam:PolicyARN` condition to limit which policies can be attached to `backgroundagent-dev-*` roles. This requires enumerating the AWS managed policies CDK attaches (e.g., `service-role/AWSLambdaBasicExecutionRole`) from a synthesized template, so it is deferred to a post-deployment tightening pass.
686
688
5.**Scope `iam:CreateServiceLinkedRole`** with an `iam:AWSServiceName` condition to limit which AWS services can have service-linked roles created. After a first deploy, check CloudTrail for which service-linked roles were actually created and restrict accordingly.
687
-
6.**Use permission boundaries** on the IaC role to set an outer limit even if the policy is too broad.
688
-
7.**Review after each CDK version upgrade** -- new CDK versions may add/remove custom resources that need different permissions.
689
+
6.**Scope KMS actions** with a `kms:ResourceAliases` condition (e.g., `"kms:ResourceAliases": "alias/cdk-hnb659fds-*"`) to limit `CreateGrant`, `Decrypt`, `Encrypt`, and `GenerateDataKey` to the deterministic CDK bootstrap key.
690
+
7.**Use permission boundaries** on the IaC role to set an outer limit even if the policy is too broad.
691
+
8.**Review after each CDK version upgrade** -- new CDK versions may add/remove custom resources that need different permissions.
> **Placeholder substitution**: Replace `ACCOUNT_ID` with your 12-digit AWS account ID and `REGION` with your deployment region (e.g., `us-east-1`) throughout this document.
33
+
32
34
```bash
33
35
# Create all three policies in your account, then re-bootstrap:
The `--cloudformation-execution-policies` flag can be repeated to attach multiple policies to the CloudFormation execution role.
@@ -688,8 +690,9 @@ These policies are conservative-but-scoped starting points. To tighten further:
688
690
3.**Add region conditions** where possible (e.g., `"aws:RequestedRegion": "us-east-1"`) to prevent cross-region resource creation.
689
691
4.**Restrict `iam:AttachRolePolicy`** with an `iam:PolicyARN` condition to limit which policies can be attached to `backgroundagent-dev-*` roles. This requires enumerating the AWS managed policies CDK attaches (e.g., `service-role/AWSLambdaBasicExecutionRole`) from a synthesized template, so it is deferred to a post-deployment tightening pass.
690
692
5.**Scope `iam:CreateServiceLinkedRole`** with an `iam:AWSServiceName` condition to limit which AWS services can have service-linked roles created. After a first deploy, check CloudTrail for which service-linked roles were actually created and restrict accordingly.
691
-
6.**Use permission boundaries** on the IaC role to set an outer limit even if the policy is too broad.
692
-
7.**Review after each CDK version upgrade** -- new CDK versions may add/remove custom resources that need different permissions.
693
+
6.**Scope KMS actions** with a `kms:ResourceAliases` condition (e.g., `"kms:ResourceAliases": "alias/cdk-hnb659fds-*"`) to limit `CreateGrant`, `Decrypt`, `Encrypt`, and `GenerateDataKey` to the deterministic CDK bootstrap key.
694
+
7.**Use permission boundaries** on the IaC role to set an outer limit even if the policy is too broad.
695
+
8.**Review after each CDK version upgrade** -- new CDK versions may add/remove custom resources that need different permissions.
0 commit comments