Sha256: a161ca537b53169d4ff9df30b997d9e065c8ea991977c7cf334e61032e4e6b35

Contents?: true

Size: 406 Bytes

Versions: 5

Compression:

Stored size: 406 Bytes

Contents

# frozen_string_literal: true

module Mihari
  class CPE < ActiveRecord::Base
    belongs_to :artifact

    class << self
      #
      # Build CPEs
      #
      # @param [String] ip
      #
      # @return [Array<Mihari::CPE>]
      #
      def build_by_ip(ip)
        res = Enrichers::Shodan.query(ip)
        return if res.nil?

        res.cpes.map { |cpe| new(cpe: cpe) }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mihari-4.6.0 lib/mihari/models/cpe.rb
mihari-4.5.3 lib/mihari/models/cpe.rb
mihari-4.5.2 lib/mihari/models/cpe.rb
mihari-4.5.1 lib/mihari/models/cpe.rb
mihari-4.5.0 lib/mihari/models/cpe.rb