Sha256: ec73934b742182b0eea8b5c40007cfc06fa1a7afe9a6eca39dfa8995c0bc860f
Contents?: true
Size: 713 Bytes
Versions: 4
Compression:
Stored size: 713 Bytes
Contents
# frozen_string_literal: true module Mihari module Emitters class TheHive < Base attr_reader :the_hive def initialize @the_hive = Mihari::TheHive.new @cache = Cache.new end # @return [true, false] def valid? the_hive.valid? end def emit(title:, description:, artifacts:, tags: []) return if artifacts.empty? the_hive.alert.create( title: title, description: description, artifacts: artifacts.map(&:to_h), tags: tags ) save_as_cache artifacts.map(&:data) end private def save_as_cache(data) @cache.save data end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
mihari-0.10.0 | lib/mihari/emitters/the_hive.rb |
mihari-0.9.1 | lib/mihari/emitters/the_hive.rb |
mihari-0.9.0 | lib/mihari/emitters/the_hive.rb |
mihari-0.8.2 | lib/mihari/emitters/the_hive.rb |