Skip to content

Commit b7ce61c

Browse files
committed
additional persmissions for inspector
1 parent 3c70713 commit b7ce61c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ SPDX-License-Identifier: MIT-0
55

66
## [Unreleased]
77

8+
### Fixed
9+
10+
- **Pattern-2 ECR Enhanced Scanning Support** - Added required IAM permissions (inspector2:ListCoverage, inspector2:ListFindings) to Pattern2DockerBuildRole to support AWS accounts with Amazon Inspector Enhanced Scanning enabled. Also added KMS permissions (kms:Decrypt, kms:CreateGrant) for customer-managed encryption keys. This resolves AccessDenied errors and CodeBuild timeouts when deploying Pattern-2 in accounts with enhanced scanning enabled.
11+
812
## [0.4.1]
913

1014
### Changed

patterns/pattern-2/template.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Resources:
156156
rules_to_suppress:
157157
- id: W11
158158
reason: "Wildcard permissions required for CloudWatch Logs creation"
159+
- id: W12
160+
reason: "Amazon Inspector ListCoverage and ListFindings require wildcard resource per AWS documentation"
159161
Properties:
160162
Path: /
161163
AssumeRolePolicyDocument:
@@ -201,6 +203,20 @@ Resources:
201203
Action:
202204
- ecr:DescribeImageScanFindings
203205
- ecr:StartImageScan
206+
# Required for Amazon Inspector Enhanced Scanning
207+
# https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning-enhanced-iam.html
208+
- Resource: "*"
209+
Effect: Allow
210+
Action:
211+
- inspector2:ListCoverage
212+
- inspector2:ListFindings
213+
# Required when ECR repository uses customer-managed KMS key encryption
214+
- Resource:
215+
- !Ref CustomerManagedEncryptionKeyArn
216+
Effect: Allow
217+
Action:
218+
- kms:Decrypt
219+
- kms:CreateGrant
204220

205221
Pattern2ECRRepository:
206222
Type: AWS::ECR::Repository

0 commit comments

Comments
 (0)