mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
38 lines
975 B
Ruby
38 lines
975 B
Ruby
require_relative('../constants.rb')
|
|
|
|
class Vulnerability
|
|
attr_accessor :type, :privilege, :access ,:puppets, :details, :ports, :name, :cve, :files, :scripts, :platform
|
|
|
|
def initialize(type='', privilege='', access='', puppets=[], details='', ports=[], platform ='', name='', cve='', files=[], scripts=[])
|
|
@type = type
|
|
@privilege = privilege
|
|
@access = access
|
|
@puppets = puppets
|
|
@details = details
|
|
@ports = ports
|
|
@platform = platform
|
|
@name = name
|
|
@cve = cve
|
|
@files = files
|
|
@scripts = scripts
|
|
end
|
|
|
|
def eql? other
|
|
# checks if type matches vulns.xml from scenario.xml
|
|
other.kind_of?(self.class) && @type == other.type
|
|
end
|
|
|
|
def id
|
|
return @type + @privilege + @access
|
|
end
|
|
|
|
def vulnerability_path
|
|
return "#{ROOT_DIR}/modules/vulnerabilities/#{@platform}/#{@type}/#{@name}"
|
|
end
|
|
|
|
def puppet_path
|
|
return vulnerability_path + '/puppet'
|
|
end
|
|
|
|
end
|