lib/ukemi/services/circl.rb in ukemi-0.4.0 vs lib/ukemi/services/circl.rb in ukemi-0.4.1
- old
+ new
@@ -6,11 +6,11 @@
module Services
class CIRCL < Service
private
def config_keys
- %w(CIRCL_PASSIVE_USERNAME CIRCL_PASSIVE_PASSWORD)
+ %w[CIRCL_PASSIVE_USERNAME CIRCL_PASSIVE_PASSWORD]
end
def api
@api ||= PassiveCIRCL::API.new
end
@@ -24,17 +24,17 @@
end
def passive_dns_lookup(data, key = nil)
results = api.dns.query(data)
results = results.select do |result|
- result.dig("rrtype") == "A"
+ result["rrtype"] == "A"
end
results.map do |result|
Record.new(
- data: result.dig(key),
- first_seen: Time.at(result.dig("time_first")).to_date.to_s,
- last_seen: Time.at(result.dig("time_last")).to_date.to_s,
+ data: result[key],
+ first_seen: Time.at(result["time_first"]).to_date.to_s,
+ last_seen: Time.at(result["time_last"]).to_date.to_s,
source: name
)
end
end
end