Class: Mihari::Analyzers::Base
Direct Known Subclasses
Basic, BinaryEdge, CIRCL, Censys, Crtsh, DNPedia, Onyphe, PassiveDNS, PassiveSSL, PassiveTotal, ReveseWhois, SHA256, SecurityTrails, SecurityTrailsDomainFeed, Shodan, Urlscan, VirusTotal, ZoomEye
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Retriable
#retry_on_error
#config_keys, #configuration_status, #configured?
Class Method Details
.inherited(child) ⇒ Object
45
46
47
|
# File 'lib/mihari/analyzers/base.rb', line 45
def self.inherited(child)
Mihari.analyzers << child
end
|
Instance Method Details
#artifacts ⇒ Array<String>, Array<Mihari::Artifact>
12
13
14
|
# File 'lib/mihari/analyzers/base.rb', line 12
def artifacts
raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end
|
#description ⇒ String
22
23
24
|
# File 'lib/mihari/analyzers/base.rb', line 22
def description
raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end
|
#run ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/mihari/analyzers/base.rb', line 31
def run
set_unique_artifacts
Parallel.each(valid_emitters) do |emitter|
run_emitter emitter
end
end
|
#run_emitter(emitter) ⇒ Object
39
40
41
42
43
|
# File 'lib/mihari/analyzers/base.rb', line 39
def run_emitter(emitter)
emitter.run(title: title, description: description, artifacts: unique_artifacts, tags: tags)
rescue StandardError => e
puts "Emission by #{emitter.class} is failed: #{e}"
end
|
27
28
29
|
# File 'lib/mihari/analyzers/base.rb', line 27
def tags
[]
end
|
#title ⇒ String
17
18
19
|
# File 'lib/mihari/analyzers/base.rb', line 17
def title
self.class.to_s.split("::").last
end
|