Skip to content

Commit cc7fb37

Browse files
committed
Look for High and Critical severities.
1 parent 3328071 commit cc7fb37

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/quayio/scanner/image.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
module Quayio
44
module Scanner
55
class Image < Struct.new(:name, :quayio_token)
6+
RELEVANT_SEVERITIES = %w(High Critical)
7+
68
def vulnerable?
79
quayio? && image_exists? && scanned? && high_vulnerabilities_present?
810
end
@@ -24,7 +26,8 @@ def scanned?
2426
def high_vulnerabilities_present?
2527
raw_scan['data']['Layer']['Features'].detect do |f|
2628
f['Vulnerabilities'] &&
27-
f['Vulnerabilities'].detect { |v| v['Severity'] == 'High' }
29+
f['Vulnerabilities']
30+
.detect { |v| RELEVANT_SEVERITIES.include?(v['Severity']) }
2831
end
2932
end
3033

0 commit comments

Comments
 (0)