Class: Mihari::Emitters::MISP

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/emitters/misp.rb

Instance Method Summary collapse

Methods inherited from Base

inherited, #run

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#configuration_status, #configured?

Instance Method Details

#emit(title:, artifacts:, tags: [], **_options) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mihari/emitters/misp.rb', line 14

def emit(title:, artifacts:, tags: [], **_options)
  event = ::MISP::Event.new(info: title)

  artifacts.each do |artifact|
    event.attributes << build_attribute(artifact)
  end

  tags.each do |tag|
    event.add_tag name: tag
  end

  event.create
end

#valid?true, false

Returns:

  • (true, false)


10
11
12
# File 'lib/mihari/emitters/misp.rb', line 10

def valid?
  api_endpoint? && api_key? && ping?
end