Class: Stratagem::Scan::Result
Overview
Each security check emits 1 or more result objects based on its findings Payload is an arbitrary piece of data that the check produces. It must be able to be encoded to JSON Unique is a value that identifies the check result within the namespace of the check
Instance Attribute Summary collapse
-
#check ⇒ Object
Returns the value of attribute check.
-
#code ⇒ Object
Returns the value of attribute code.
-
#component ⇒ Object
Returns the value of attribute component.
-
#concern_type ⇒ Object
Returns the value of attribute concern_type.
-
#confirmed ⇒ Object
Returns the value of attribute confirmed.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#passed ⇒ Object
Returns the value of attribute passed.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#solution_payload ⇒ Object
Returns the value of attribute solution_payload.
-
#specialization ⇒ Object
Returns the value of attribute specialization.
-
#unique ⇒ Object
Returns the value of attribute unique.
Instance Method Summary collapse
- #check_name ⇒ Object
- #component_name ⇒ Object
- #export ⇒ Object
- #guid ⇒ Object
-
#initialize(args) ⇒ Result
constructor
passed = true / false.
Constructor Details
#initialize(args) ⇒ Result
passed = true / false
11 12 13 |
# File 'lib/stratagem/scan/result.rb', line 11 def initialize(args) args.each {|key,value| self.send("#{key}=", value) } end |
Instance Attribute Details
#check ⇒ Object
Returns the value of attribute check.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def check @check end |
#code ⇒ Object
Returns the value of attribute code.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def code @code end |
#component ⇒ Object
Returns the value of attribute component.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def component @component end |
#concern_type ⇒ Object
Returns the value of attribute concern_type.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def concern_type @concern_type end |
#confirmed ⇒ Object
Returns the value of attribute confirmed.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def confirmed @confirmed end |
#line_number ⇒ Object
Returns the value of attribute line_number.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def line_number @line_number end |
#passed ⇒ Object
Returns the value of attribute passed.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def passed @passed end |
#payload ⇒ Object
Returns the value of attribute payload.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def payload @payload end |
#solution_payload ⇒ Object
Returns the value of attribute solution_payload.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def solution_payload @solution_payload end |
#specialization ⇒ Object
Returns the value of attribute specialization.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def specialization @specialization end |
#unique ⇒ Object
Returns the value of attribute unique.
8 9 10 |
# File 'lib/stratagem/scan/result.rb', line 8 def unique @unique end |
Instance Method Details
#check_name ⇒ Object
36 37 38 |
# File 'lib/stratagem/scan/result.rb', line 36 def check_name check ? check.name : nil end |
#component_name ⇒ Object
32 33 34 |
# File 'lib/stratagem/scan/result.rb', line 32 def component_name component ? component.name : nil end |
#export ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stratagem/scan/result.rb', line 15 def export h = { :guid => guid, :check_name => check_name, :specialization => specialization, :component => component_name, :payload => payload, :line_number => line_number, :code => code, :concern_type => concern_type, :confirmed => confirmed || false, :solution_payload => solution_payload } h[:path] = component.path.gsub(RAILS_ROOT+'/', '') if component h end |
#guid ⇒ Object
40 41 42 |
# File 'lib/stratagem/scan/result.rb', line 40 def guid "#{check_name.underscore}:#{(component_name || '').underscore}:#{unique.to_s.underscore}" end |