File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ def collect
23
23
struct . policy = @client
24
24
. get_repository_policy ( { repository_name : repo . repository_name } ) . policy_text . parse_policy
25
25
26
+ struct . images = [ ]
27
+ #
28
+ # describe images
29
+ #
30
+ @client . list_images ( { repository_name : repo . repository_name } ) . image_ids . each_with_index do | image , page |
31
+ log ( response . context . operation_name , 'list_images' , page )
32
+ image_hash = image . to_h
33
+ #
34
+ # describe image scan results
35
+ #
36
+ result = @client . describe_image_scan_findings ( { repository_name : repo . repository_name , image_id : { image_digest : image . image_digest , image_tag : image . image_tag } } )
37
+ image_hash [ "image_scan_status" ] = result . image_scan_status . to_h
38
+ image_hash [ "image_scan_findings" ] = result . image_scan_findings . to_h
39
+
40
+ rescue Aws ::ECR ::Errors ::ScanNotFoundException => e
41
+ # No scan result for this image. No action needed
42
+ ensure
43
+ struct . images << image_hash
44
+ end
26
45
rescue Aws ::ECR ::Errors ::ServiceError => e
27
46
log_error ( e . code )
28
47
@@ -40,7 +59,8 @@ def collect
40
59
# not an error
41
60
def suppressed_errors
42
61
%w[
43
- RepositoryPolicyNotFoundException
44
- ]
62
+ RepositoryPolicyNotFoundException,
63
+ ScanNotFoundException
64
+ ]
45
65
end
46
66
end
Original file line number Diff line number Diff line change 1
1
module AwsRecon
2
- VERSION = "0.5.25 "
2
+ VERSION = "0.5.26 "
3
3
end
You can’t perform that action at this time.
0 commit comments