Sha256: 339c6dc2aa9db29cfa886e4eb11bb24cd1c1e257468e21ef1273542d19a0d878

Contents?: true

Size: 430 Bytes

Versions: 43

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

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

    class << self
      #
      # Build AS
      #
      # @param [String] ip
      #
      # @return [Mihari::AutonomousSystem, nil]
      #
      def build_by_ip(ip)
        res = Enrichers::IPInfo.query(ip)

        return nil if res.nil? || res.asn.nil?

        new(asn: res.asn)
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
mihari-5.4.3 lib/mihari/models/autonomous_system.rb
mihari-5.4.2 lib/mihari/models/autonomous_system.rb
mihari-5.4.1 lib/mihari/models/autonomous_system.rb
mihari-5.4.0 lib/mihari/models/autonomous_system.rb
mihari-5.3.2 lib/mihari/models/autonomous_system.rb
mihari-5.3.1 lib/mihari/models/autonomous_system.rb
mihari-5.3.0 lib/mihari/models/autonomous_system.rb
mihari-5.2.4 lib/mihari/models/autonomous_system.rb
mihari-5.2.3 lib/mihari/models/autonomous_system.rb
mihari-5.2.2 lib/mihari/models/autonomous_system.rb
mihari-5.2.1 lib/mihari/models/autonomous_system.rb
mihari-5.2.0 lib/mihari/models/autonomous_system.rb
mihari-5.1.4 lib/mihari/models/autonomous_system.rb
mihari-5.1.3 lib/mihari/models/autonomous_system.rb
mihari-5.1.2 lib/mihari/models/autonomous_system.rb
mihari-5.1.1 lib/mihari/models/autonomous_system.rb
mihari-5.1.0 lib/mihari/models/autonomous_system.rb
mihari-5.0.1 lib/mihari/models/autonomous_system.rb
mihari-5.0.0 lib/mihari/models/autonomous_system.rb
mihari-4.12.0 lib/mihari/models/autonomous_system.rb