Class: Mihari::Services::ArtifactEnricher
Instance Method Summary
collapse
call, #get_result, get_result
Instance Method Details
#call(id) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/mihari/services/enrichers.rb', line 9
def call(id)
artifact = Mihari::Models::Artifact.includes(
:autonomous_system,
:geolocation,
:whois_record,
:dns_records,
:reverse_dns_names,
:cpes,
:ports
).find(id)
raise UnenrichableError.new, "#{artifact.id} is already enriched or unenrichable" unless artifact.enrichable?
artifact.enrich
artifact.save
end
|