Class: ProjectReportFinding

Inherits:
Domain::Model show all
Defined in:
lib/domain/project/model.rb

Constant Summary collapse

SEVERITIES =
%w[Critical High Medium Low Info].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::Model

columns, from_csv, from_json, headers, table_name, #to_csv, #to_hash, #to_s, view

Constructor Details

#initialize(attributes = {}) ⇒ ProjectReportFinding



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/domain/project/model.rb', line 188

def initialize(attributes = {})
  remapped_attributes = attributes.transform_keys do |key|
    case key
    when 'ID' then 'id'
    when 'Name' then 'name'
    when 'Description' then 'description'
    when 'Recommendation' then 'recommendation'
    when 'CVE/CWE' then 'cve_or_cwe'
    when 'CVSS Score' then 'cvss_score'
    when 'Total Count' then 'total_count'
    when 'Unique Instance List' then 'assets'
    when 'Teams' then 'teams'
    when 'Exploit Available' then 'exploit_available'
    when 'IAVA' then 'iava'
    when 'Mitigation' then 'mitigation'
    when 'Exploit in Wild' then 'exploit_in_wild'
    when 'Mandiant Ease of Attack' then 'mandiant_ease_of_attack'
    when 'Zero Day' then 'zero_day'
    when 'Associated Malware' then 'associated_malware'
    when 'Associated Malware Types' then 'associated_malware_types'
    when 'Threat actors' then 'threat actors'
    when 'EPSS score' then 'epss_score'
    when 'CISA BOD 22-01 Vulnerability' then 'is_cisa_bod_22_01_vulnerability'
    else key # For all other keys that do not need remapping
    end
  end
  super(remapped_attributes) # Call the superclass's initialize method
end

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def assets
  @assets
end

#associated_malwareObject

Returns the value of attribute associated_malware.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def associated_malware
  @associated_malware
end

#associated_malware_typesObject

Returns the value of attribute associated_malware_types.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def associated_malware_types
  @associated_malware_types
end

#cve_or_cweObject

Returns the value of attribute cve_or_cwe.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def cve_or_cwe
  @cve_or_cwe
end

#cvss_scoreObject

Returns the value of attribute cvss_score.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def cvss_score
  @cvss_score
end

#descriptionObject

Returns the value of attribute description.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def description
  @description
end

#epss_scoreObject

Returns the value of attribute epss_score.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def epss_score
  @epss_score
end

#exploit_availableObject

Returns the value of attribute exploit_available.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def exploit_available
  @exploit_available
end

#exploit_consequenceObject

Returns the value of attribute exploit_consequence.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def exploit_consequence
  @exploit_consequence
end

#exploit_in_wildObject

Returns the value of attribute exploit_in_wild.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def exploit_in_wild
  @exploit_in_wild
end

#exploit_ratingObject

Returns the value of attribute exploit_rating.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def exploit_rating
  @exploit_rating
end

#iavaObject

Returns the value of attribute iava.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def iava
  @iava
end

#idObject

Returns the value of attribute id.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def id
  @id
end

#is_cisa_bod_22_01_vulnerabilityObject

Returns the value of attribute is_cisa_bod_22_01_vulnerability.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def is_cisa_bod_22_01_vulnerability
  @is_cisa_bod_22_01_vulnerability
end

#mandiant_ease_of_attackObject

Returns the value of attribute mandiant_ease_of_attack.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def mandiant_ease_of_attack
  @mandiant_ease_of_attack
end

#mandiant_risk_ratingObject

Returns the value of attribute mandiant_risk_rating.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def mandiant_risk_rating
  @mandiant_risk_rating
end

#mitigationObject

Returns the value of attribute mitigation.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def mitigation
  @mitigation
end

#mitigationsObject

Returns the value of attribute mitigations.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def mitigations
  @mitigations
end

#nameObject

Returns the value of attribute name.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def name
  @name
end

#recommendationObject

Returns the value of attribute recommendation.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def recommendation
  @recommendation
end

#report_idObject

Returns the value of attribute report_id.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def report_id
  @report_id
end

#severityObject

Returns the value of attribute severity.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def severity
  @severity
end

#teamsObject

Returns the value of attribute teams.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def teams
  @teams
end

#threat_actorsObject

Returns the value of attribute threat_actors.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def threat_actors
  @threat_actors
end

#total_countObject

Returns the value of attribute total_count.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def total_count
  @total_count
end

#zero_dayObject

Returns the value of attribute zero_day.



153
154
155
# File 'lib/domain/project/model.rb', line 153

def zero_day
  @zero_day
end

Class Method Details

.primary_keyObject



184
185
186
# File 'lib/domain/project/model.rb', line 184

def self.primary_key
  %w[id report_id]
end

Instance Method Details

#table_nameObject



180
181
182
# File 'lib/domain/project/model.rb', line 180

def table_name
  'project_report_finding'
end