Sha256: c422ec64d3bc81495fe4317eba7781362953721f8d49922396351e59c6a726cb
Contents?: true
Size: 862 Bytes
Versions: 1
Compression:
Stored size: 862 Bytes
Contents
# frozen_string_literal: true module Mihari module Models class DnsRecord < ActiveRecord::Base belongs_to :artifact class << self include Dry::Monads[:result] # # Build DNS records # # @param [String] domain # @param [Mihari::Enrichers::Shodan] enricher # # @return [Array<Mihari::Models::DnsRecord>] # def build_by_domain(domain, enricher: Enrichers::GooglePublicDNS.new) result = enricher.query_result(domain).bind do |responses| Success( responses.map do |res| res.answers.map do |answer| new(resource: answer.resource_type, value: answer.data) end end.flatten ) 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/dns.rb |