Class: GreyNoise::Clients::Noise

Inherits:
Client
  • Object
show all
Defined in:
lib/greynoise/clients/noise.rb

Constant Summary

Constants inherited from Client

Client::BASE_URL, Client::HOST, Client::VERSION

Instance Attribute Summary

Attributes inherited from Client

#key

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from GreyNoise::Clients::Client

Instance Method Details

#context(ip) ⇒ Hash

Get more information about a given IP address.

Parameters:

  • ip (String)

    an IP address

Returns:

  • (Hash)


13
14
15
# File 'lib/greynoise/clients/noise.rb', line 13

def context(ip)
  _get("/noise/context/#{ip}") { |json| json }
end

#multi_quick(*ips) ⇒ Array

Check whether a set of IP addresses are “Internet background noise”, or have been observed scanning or attacking devices across the Internet.

Parameters:

  • *ips (Array<String>)

    a set of IP address

Returns:

  • (Array)


35
36
37
38
39
40
# File 'lib/greynoise/clients/noise.rb', line 35

def multi_quick(*ips)
  params = {
    ips: ips.join(",")
  }
  _get("/noise/multi/quick", params) { |json| json }
end

#quick(ip) ⇒ Hash

Check whether a given IP address is “Internet background noise”, or has been observed scanning or attacking devices across the Internet.

Parameters:

  • ip (String)

    an IP address

Returns:

  • (Hash)


24
25
26
# File 'lib/greynoise/clients/noise.rb', line 24

def quick(ip)
  _get("/noise/quick/#{ip}") { |json| json }
end