Sha256: 12d17b241b0a0f2f4037c112d711d643e20ee94ca1e2e3e5ac72fe0fb0c0c260

Contents?: true

Size: 621 Bytes

Versions: 25

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

module Mihari
  class TheHive
    class Alert < Base
      # @return [Array]
      def list(range: "all", sort: "-date")
        alerts = api.alert.search({ source: "mihari" }, range: range, sort: sort)
        alerts.sort_by { |alert| -alert.dig("createdAt") }
      end

      # @return [Hash]
      def create(title:, description:, artifacts:, tags: [])
        api.alert.create(
          title: title,
          description: description,
          artifacts: artifacts,
          tags: tags,
          type: "external",
          source: "mihari"
        )
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mihari-0.7.0 lib/mihari/the_hive/alert.rb
mihari-0.6.0 lib/mihari/the_hive/alert.rb
mihari-0.5.2 lib/mihari/the_hive/alert.rb
mihari-0.5.1 lib/mihari/the_hive/alert.rb
mihari-0.5.0 lib/mihari/the_hive/alert.rb