Class: ForemanCveScanner::CveScan

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/foreman_cve_scanner/cve_scan.rb

Overview

Stores a single CVE scan result for a host.

Constant Summary collapse

SEVERITY_LEVELS =
%w[critical high medium low].freeze

Class Method Summary collapse

Class Method Details

.worst_severity(metrics) ⇒ Object



18
19
20
# File 'app/models/foreman_cve_scanner/cve_scan.rb', line 18

def self.worst_severity(metrics)
  SEVERITY_LEVELS.find { |severity| metrics[severity].to_i.positive? } || 'none'
end