Skip to content

Commit cb95946

Browse files
docs: add KMS decrypt permissions for S3 artifact encryption
The artifact bucket uses SSEAlgorithm: aws:kms, so both the GitHub Actions OIDC role (step 2) and the CodeBuild service role (step 3) need kms:Decrypt and kms:GenerateDataKey scoped via kms:ViaService to the S3 endpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2c88fae commit cb95946

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

docs/ADMINISTRATORS_GUIDE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ Resources:
178178
- !Sub 'arn:${AWS::Partition}:s3:::${ArtifactBucketName}'
179179
- !Sub 'arn:${AWS::Partition}:s3:::${ArtifactBucketName}/*'
180180
- !Ref AWS::NoValue
181+
- !If
182+
- HasArtifactBucket
183+
- Sid: AllowDecryptArtifacts
184+
Effect: Allow
185+
Action:
186+
- kms:Decrypt
187+
- kms:GenerateDataKey
188+
Resource: '*'
189+
Condition:
190+
StringEquals:
191+
kms:ViaService: !Sub 's3.${AWS::Region}.amazonaws.com'
192+
- !Ref AWS::NoValue
181193

182194
Outputs:
183195
RoleArn:
@@ -352,6 +364,15 @@ Resources:
352364
Resource:
353365
- !GetAtt ArtifactBucket.Arn
354366
- !Sub '${ArtifactBucket.Arn}/*'
367+
- Sid: AllowKMSForArtifacts
368+
Effect: Allow
369+
Action:
370+
- kms:Decrypt
371+
- kms:GenerateDataKey
372+
Resource: '*'
373+
Condition:
374+
StringEquals:
375+
kms:ViaService: !Sub 's3.${AWS::Region}.amazonaws.com'
355376
356377
Project:
357378
Type: AWS::CodeBuild::Project

0 commit comments

Comments
 (0)