Sha256: 6fd5c2cde621b512571adbdc5555416ef3139cfc37795fb777aecb61ce8ccbb2
Contents?: true
Size: 794 Bytes
Versions: 14
Compression:
Stored size: 794 Bytes
Contents
# frozen_string_literal: true module Mihari module Emitters class TheHive < Base # @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 config_keys %w(THEHIVE_API_ENDPOINT THEHIVE_API_KEY) end def the_hive @the_hive ||= Mihari::TheHive.new end def cache @cache ||= Cache.new end def save_as_cache(data) cache.save data end end end end
Version data entries
14 entries across 14 versions & 1 rubygems