Sha256: e5318a8d242c3a46fce489b3698fae81b2d6ca098bf044824498dc7bd668e39b
Contents?: true
Size: 780 Bytes
Versions: 3
Compression:
Stored size: 780 Bytes
Contents
# frozen_string_literal: true module Mihari 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::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
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mihari-5.6.1 | lib/mihari/models/dns.rb |
mihari-5.6.0 | lib/mihari/models/dns.rb |
mihari-5.5.0 | lib/mihari/models/dns.rb |