Class: Mihari::Analyzers::OTX
Constant Summary
Mixins::Retriable::DEFAULT_ON
Instance Attribute Summary collapse
Instance Method Summary
collapse
#refang
Methods inherited from Base
#class_name, inherited, #normalized_artifacts, #source
#retry_on_error
#configuration_keys?, #configuration_values, #configured?
Constructor Details
#initialize(*args, **kwargs) ⇒ OTX
Returns a new instance of OTX.
19
20
21
22
23
24
25
26
|
# File 'lib/mihari/analyzers/otx.rb', line 19
def initialize(*args, **kwargs)
super
@query = refang(query)
@type = TypeChecker.type(query)
@api_key = kwargs[:api_key] || Mihari.config.otx_api_key
end
|
Instance Attribute Details
#api_key ⇒ String?
14
15
16
|
# File 'lib/mihari/analyzers/otx.rb', line 14
def api_key
@api_key
end
|
#query ⇒ String
17
18
19
|
# File 'lib/mihari/analyzers/otx.rb', line 17
def query
@query
end
|
#type ⇒ String?
11
12
13
|
# File 'lib/mihari/analyzers/otx.rb', line 11
def type
@type
end
|
Instance Method Details
#artifacts ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/mihari/analyzers/otx.rb', line 28
def artifacts
case type
when "domain"
domain_search
when "ip"
ip_search
else
raise InvalidInputError, "#{query}(type: #{type || "unknown"}) is not supported." unless valid_type?
end
end
|