Sha256: 85041b98b061e5cae4e61fedabccdb812c9469a30ce0205d69a470916351ebae
Contents?: true
Size: 761 Bytes
Versions: 1
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true module Mihari module Models class ReverseDnsName < ActiveRecord::Base belongs_to :artifact class << self include Dry::Monads[:result] # # Build reverse DNS names # # @param [String] ip # @param [Mihari::Enrichers::Shodan] enricher # # @return [Array<Mihari::Models::ReverseDnsName>] # def build_by_ip(ip, enricher: Enrichers::Shodan.new) result = enricher.query_result(ip).bind do |res| if res.nil? Success [] else Success(res.hostnames.map { |name| new(name: name) }) end end result.value_or [] end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mihari-5.6.2 | lib/mihari/models/reverse_dns.rb |