Class: Mihari::Analyzers::Onyphe
- Defined in:
- lib/mihari/analyzers/onyphe.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#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
Instance Method Summary collapse
- #artifacts ⇒ Object
-
#initialize(query, title: nil, description: nil, tags: []) ⇒ Onyphe
constructor
A new instance of Onyphe.
Methods inherited from Base
Constructor Details
#initialize(query, title: nil, description: nil, tags: []) ⇒ Onyphe
Returns a new instance of Onyphe.
14 15 16 17 18 19 20 21 22 |
# File 'lib/mihari/analyzers/onyphe.rb', line 14 def initialize(query, title: nil, description: nil, tags: []) super() @api = ::Onyphe::API.new @query = query @title = title || "Onyphe lookup" @description = description || "query = #{query}" @tags = end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
8 9 10 |
# File 'lib/mihari/analyzers/onyphe.rb', line 8 def api @api end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/mihari/analyzers/onyphe.rb', line 10 def description @description end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
11 12 13 |
# File 'lib/mihari/analyzers/onyphe.rb', line 11 def query @query end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
12 13 14 |
# File 'lib/mihari/analyzers/onyphe.rb', line 12 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/mihari/analyzers/onyphe.rb', line 9 def title @title end |
Instance Method Details
#artifacts ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/mihari/analyzers/onyphe.rb', line 24 def artifacts result = search return [] unless result results = result.dig("results") || [] results.map { |e| e.dig("ip") }.compact end |