Skip to content

Commit 5e6815f

Browse files
committed
chore(cfn): restrict System Key by EC
1 parent 9c0547b commit 5e6815f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

cfn/ESDK-Hierarchy-CI.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,25 @@ Resources:
173173
- Effect: Allow
174174
Principal:
175175
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
176-
Action: "kms:*"
176+
Action: kms:*
177+
Resource: "*"
178+
- Effect: Allow
179+
Principal:
180+
AWS:
181+
# These are hard coded, which means this template will fail to bootstrap.
182+
# To bootstrap, remove this allow block, and then put it back in subsequent deployment
183+
- !Sub "arn:aws:iam::${AWS::AccountId}:role/GitHub-CI-${ProjectName}-Role-${AWS::Region}"
184+
- !Sub "arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment"
185+
Action:
186+
- kms:Encrypt
187+
- kms:Decrypt
177188
Resource: "*"
189+
Condition:
190+
StringEquals:
191+
kms:EncryptionContext:type:
192+
- branch:MUTATION_COMMITMENT
193+
- branch:MUTATION_INDEX
194+
178195
EccP256:
179196
Type: "AWS::KMS::Key"
180197
Properties:

0 commit comments

Comments
 (0)