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.17.5 lib/mihari/the_hive/alert.rb
mihari-0.17.4 lib/mihari/the_hive/alert.rb
mihari-0.17.3 lib/mihari/the_hive/alert.rb
mihari-0.17.2 lib/mihari/the_hive/alert.rb
mihari-0.17.1 lib/mihari/the_hive/alert.rb
mihari-0.17.0 lib/mihari/the_hive/alert.rb
mihari-0.16.0 lib/mihari/the_hive/alert.rb
mihari-0.15.0 lib/mihari/the_hive/alert.rb
mihari-0.14.0 lib/mihari/the_hive/alert.rb
mihari-0.13.2 lib/mihari/the_hive/alert.rb
mihari-0.13.1 lib/mihari/the_hive/alert.rb
mihari-0.13.0 lib/mihari/the_hive/alert.rb
mihari-0.12.0 lib/mihari/the_hive/alert.rb
mihari-0.11.0 lib/mihari/the_hive/alert.rb
mihari-0.10.0 lib/mihari/the_hive/alert.rb
mihari-0.9.1 lib/mihari/the_hive/alert.rb
mihari-0.9.0 lib/mihari/the_hive/alert.rb
mihari-0.8.2 lib/mihari/the_hive/alert.rb
mihari-0.8.1 lib/mihari/the_hive/alert.rb
mihari-0.8.0 lib/mihari/the_hive/alert.rb