Class: Mihari::Analyzers::VirusTotalIntelligence

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/analyzers/virustotal_intelligence.rb

Constant Summary

Constants included from Mixins::Retriable

Mixins::Retriable::DEFAULT_ON

Instance Attribute Summary collapse

Attributes inherited from Base

#rule

Instance Method Summary collapse

Methods inherited from Base

inherited, #normalized_artifacts, #run, #run_emitter, #source

Methods included from Mixins::Retriable

#retry_on_error

Methods included from Mixins::Configurable

#configuration_values, #configured?

Methods included from Mixins::AutonomousSystem

#normalize_asn

Constructor Details

#initialize(*args, **kwargs) ⇒ VirusTotalIntelligence

Returns a new instance of VirusTotalIntelligence.



15
16
17
18
19
20
21
# File 'lib/mihari/analyzers/virustotal_intelligence.rb', line 15

def initialize(*args, **kwargs)
  super

  @query = query

  @api_key = kwargs[:api_key] || Mihari.config.virustotal_api_key
end

Instance Attribute Details

#api_keyString? (readonly)

Returns:

  • (String, nil)


13
14
15
# File 'lib/mihari/analyzers/virustotal_intelligence.rb', line 13

def api_key
  @api_key
end

Instance Method Details

#artifactsObject



23
24
25
26
27
28
29
30
# File 'lib/mihari/analyzers/virustotal_intelligence.rb', line 23

def artifacts
  responses = search_witgh_cursor
  responses.map do |response|
    response.data.map do |datum|
      Artifact.new(data: datum.value, source: source, metadata: datum.)
    end
  end.flatten
end