Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers committed Mar 10, 2021
1 parent ff23638 commit 2d68938
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/cfn-nag/custom_rules/ECRRepositoryScanOnPushRule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ECRRepositoryScanOnPushRule < BaseRule
def rule_text
'ECR Repository should have scanOnPush enabled'
'ECR Repository should have ScanOnPush enabled'
end

def rule_type
Expand All @@ -20,7 +20,7 @@ def rule_id
def audit_impl(cfn_model)
violating_ecr_registries = cfn_model.resources_by_type('AWS::ECR::Repository').select do |registry|
registry.imageScanningConfiguration.nil? ||
!truthy?(registry.imageScanningConfiguration['scanOnPush'].to_s)
!truthy?(registry.imageScanningConfiguration['ScanOnPush'].to_s)
end

violating_ecr_registries.map(&:logical_resource_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Resources:
Properties:
RepositoryName: "test-repository"
ImageScanningConfiguration:
scanOnPush: "false"
ScanOnPush: "false"
MyRepositoryWithNoConfigDefault:
Type: AWS::ECR::Repository
Properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Resources:
Properties:
RepositoryName: "test-repository"
ImageScanningConfiguration:
scanOnPush: "true"
ScanOnPush: "true"

0 comments on commit 2d68938

Please sign in to comment.