summaryrefslogtreecommitdiff
path: root/app/models/concerns/enums/vulnerability.rb
blob: 55360eb92e6b24ebfd6f0686d99127c29af4ee7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# frozen_string_literal: true

module Enums
  module Vulnerability
    CONFIDENCE_LEVELS = {
      # undefined: 0, no longer applicable
      ignore: 1,
      unknown: 2,
      experimental: 3,
      low: 4,
      medium: 5,
      high: 6,
      confirmed: 7
    }.with_indifferent_access.freeze

    REPORT_TYPES = {
      sast: 0,
      secret_detection: 4
    }.with_indifferent_access.freeze

    SEVERITY_LEVELS = {
      # undefined: 0, no longer applicable
      info: 1,
      unknown: 2,
      # experimental: 3, formerly used by confidence, no longer applicable
      low: 4,
      medium: 5,
      high: 6,
      critical: 7
    }.with_indifferent_access.freeze

    def self.confidence_levels
      CONFIDENCE_LEVELS
    end

    def self.report_types
      REPORT_TYPES
    end

    def self.severity_levels
      SEVERITY_LEVELS
    end
  end
end

Enums::Vulnerability.prepend_mod_with('Enums::Vulnerability')