Class: Cymon::Endpoint::Search

Inherits:
Base
  • Object
show all
Defined in:
lib/cymon/endpoint/search.rb

Constant Summary collapse

PATH =
'ioc/search'

Instance Attribute Summary

Attributes inherited from Base

#api, #api_version_path, #client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Cymon::Endpoint::Base

Instance Method Details

#by_domain(value, params = {}) ⇒ Object

Search threat reports by domain name. docs.cymon.io/#search-search-by-domain-get



30
31
32
33
34
# File 'lib/cymon/endpoint/search.rb', line 30

def by_domain(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/domain/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_feed(value, params = {}) ⇒ Object

Search threat reports by feed. docs.cymon.io/#search-search-by-feed-get



78
79
80
81
82
# File 'lib/cymon/endpoint/search.rb', line 78

def by_feed(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/feed/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_hostname(value, params = {}) ⇒ Object

Search threat reports by hostname. docs.cymon.io/#search-search-by-hostname-get



38
39
40
41
42
# File 'lib/cymon/endpoint/search.rb', line 38

def by_hostname(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/hostname/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_ip(value, params = {}) ⇒ Object

Search threat reports by IP address (IPv4 and IPv6). docs.cymon.io/#search-search-by-ip-get

Parameters:

  • value (String)

    The query value to search for. Example: 209.90.88.140.

  • params (Hash) (defaults to: {})

    startDate The start date for searching. Example: 2017-03-25 endDate The end date for searching. Example: 2017-03-29 from The offset to use for pagination. Example: 0 size The limit to use for pagination. Example: 3



22
23
24
25
26
# File 'lib/cymon/endpoint/search.rb', line 22

def by_ip(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/ip/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_md5(value, params = {}) ⇒ Object

Search threat reports by md5. docs.cymon.io/#search-search-by-md5-get



46
47
48
49
50
# File 'lib/cymon/endpoint/search.rb', line 46

def by_md5(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/md5/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_sha1(value, params = {}) ⇒ Object

Search threat reports by sha1. docs.cymon.io/#search-search-by-sha1-get



54
55
56
57
58
# File 'lib/cymon/endpoint/search.rb', line 54

def by_sha1(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/sha1/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_sha256(value, params = {}) ⇒ Object

Search threat reports by sha256. docs.cymon.io/#search-search-by-sha256-get



62
63
64
65
66
# File 'lib/cymon/endpoint/search.rb', line 62

def by_sha256(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/sha256/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#by_term(value, params = {}) ⇒ Object

Search threat reports by term. docs.cymon.io/#search-search-by-term-get



70
71
72
73
74
# File 'lib/cymon/endpoint/search.rb', line 70

def by_term(value, params = {})
  params = default_params(params)
  response = @api.get("#{url_path}/term/#{value}", params)
  Cymon::Responses::Search.new(response)
end

#url_pathObject



9
10
11
# File 'lib/cymon/endpoint/search.rb', line 9

def url_path
  "#{api_version_path}/#{PATH}"
end