Sha256: fcd08d51c0d80c78058da5a31c08bab3d01e752b79aad885fbaa232853011a2f
Contents?: true
Size: 740 Bytes
Versions: 12
Compression:
Stored size: 740 Bytes
Contents
# frozen_string_literal: true module Mihari module Analyzers module Clients class OTX attr_reader :api_key def initialize(api_key) @api_key = api_key end def query_by_ip(ip) get "https://otx.alienvault.com/api/v1/indicators/IPv4/#{ip}/passive_dns" end def query_by_domain(domain) get "https://otx.alienvault.com/api/v1/indicators/domain/#{domain}/passive_dns" end private def headers { "x-otx-api-key": api_key } end def get(url) res = HTTP.get(url, headers: headers) JSON.parse(res.body.to_s) rescue HTTPError nil end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems