Class: Mihari::Emitters::MISP
Instance Method Summary collapse
- #emit(title:, artifacts:, tags: [], **_options) ⇒ Object
-
#initialize ⇒ MISP
constructor
A new instance of MISP.
- #valid? ⇒ true, false
Methods inherited from Base
Methods included from Retriable
Methods included from Configurable
#configuration_status, #configured?
Constructor Details
Instance Method Details
#emit(title:, artifacts:, tags: [], **_options) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mihari/emitters/misp.rb', line 21 def emit(title:, artifacts:, tags: [], **) event = ::MISP::Event.new(info: title) artifacts.each do |artifact| event.attributes << build_attribute(artifact) end .each do |tag| event.add_tag name: tag end event.create end |
#valid? ⇒ true, false
17 18 19 |
# File 'lib/mihari/emitters/misp.rb', line 17 def valid? api_endpoint? && api_key? && ping? end |