Class: RedmineAudit::Advisory

Inherits:
Struct
  • Object
show all
Defined in:
lib/redmine_audit/advisory.rb

Overview

Redmine advisory

ex) Advisory.new(‘High’, ‘someurl.example.com’,

[Gem::Requirement], [Gem::Requirement])

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailsObject

Returns the value of attribute details



6
7
8
# File 'lib/redmine_audit/advisory.rb', line 6

def details
  @details
end

#external_referencesObject

Returns the value of attribute external_references



6
7
8
# File 'lib/redmine_audit/advisory.rb', line 6

def external_references
  @external_references
end

#fixed_versionsObject

Returns the value of attribute fixed_versions



6
7
8
# File 'lib/redmine_audit/advisory.rb', line 6

def fixed_versions
  @fixed_versions
end

#severityObject

Returns the value of attribute severity



6
7
8
# File 'lib/redmine_audit/advisory.rb', line 6

def severity
  @severity
end

#unaffected_versionsObject

Returns the value of attribute unaffected_versions



6
7
8
# File 'lib/redmine_audit/advisory.rb', line 6

def unaffected_versions
  @unaffected_versions
end

Instance Method Details

#fixed?(version) ⇒ Boolean

Checks whether the version is fixed against the advisory.



31
32
33
34
35
# File 'lib/redmine_audit/advisory.rb', line 31

def fixed?(version)
  fixed_versions.any? do |fixed_version|
    fixed_version === version
  end
end

#unaffected?(version) ⇒ Boolean

Checks whether the version is not affected by the advisory.



18
19
20
21
22
# File 'lib/redmine_audit/advisory.rb', line 18

def unaffected?(version)
  unaffected_versions.any? do |unaffected_version|
    unaffected_version === version
  end
end

#vulnerable?(version) ⇒ Boolean

Checks whether the version is vulnerable to the advisory.



44
45
46
# File 'lib/redmine_audit/advisory.rb', line 44

def vulnerable?(version)
  !fixed?(version) && !unaffected?(version)
end