Class: Mihari::Analyzers::BinaryEdge
- Defined in:
- lib/mihari/analyzers/binaryedge.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Attributes inherited from Base
#ignore_old_artifacts, #ignore_threshold
Instance Method Summary collapse
- #artifacts ⇒ Object
-
#initialize(query, title: nil, description: nil, tags: []) ⇒ BinaryEdge
constructor
A new instance of BinaryEdge.
Methods inherited from Base
inherited, #run, #run_emitter, #source
Methods included from Retriable
Methods included from Configurable
#configuration_values, #configured?
Constructor Details
#initialize(query, title: nil, description: nil, tags: []) ⇒ BinaryEdge
Returns a new instance of BinaryEdge.
10 11 12 13 14 15 16 17 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 10 def initialize(query, title: nil, description: nil, tags: []) super() @query = query @title = title || "BinaryEdge lookup" @description = description || "query = #{query}" @tags = end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 8 def description @description end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
8 9 10 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 8 def query @query end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 8 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 8 def title @title end |
Instance Method Details
#artifacts ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mihari/analyzers/binaryedge.rb', line 19 def artifacts results = search return [] unless results || results.empty? results.map do |result| events = result["events"] || [] events.map do |event| event.dig "target", "ip" end.compact end.flatten.compact.uniq end |