lib/mihari/analyzers/censys.rb in mihari-0.2.2 vs lib/mihari/analyzers/censys.rb in mihari-0.2.3
- old
+ new
@@ -7,22 +7,24 @@
class Censys < Base
attr_reader :api
attr_reader :title
attr_reader :description
attr_reader :query
+ attr_reader :tags
CENSYS_ID_KEY = "CENSYS_ID"
CENSYS_SECRET_KEY = "CENSYS_SECRET"
- def initialize(query)
+ def initialize(query, tags: [])
super()
raise ArgumentError, "#{CENSYS_ID_KEY} and #{CENSYS_SECRET_KEY} are required" unless valid?
@api = ::Censys::API.new
@query = query
@title = "Censys lookup"
@description = "Query: #{query}"
+ @tags = tags
end
def artifacts
ipv4s = []
res = api.ipv4.search(query: query)