Class: Mihari::Emitters::TheHive
- Defined in:
- lib/mihari/emitters/the_hive.rb
Instance Method Summary collapse
Methods inherited from Base
Methods included from Retriable
Methods included from Configurable
#configuration_status, #configured?
Instance Method Details
#emit(title:, description:, artifacts:, tags: [], **_options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mihari/emitters/the_hive.rb', line 14 def emit(title:, description:, artifacts:, tags: [], **) return if artifacts.empty? api.alert.create( title: title, description: description, artifacts: artifacts.map { |artifact| { data: artifact.data, data_type: artifact.data_type, message: description } }, tags: , type: "external", source: "mihari" ) end |
#valid? ⇒ true, false
10 11 12 |
# File 'lib/mihari/emitters/the_hive.rb', line 10 def valid? api_endpont? && api_key? && ping? end |