Class: PassiveTotal::Client::Action

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/action.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#add_tags(query:, tags:) ⇒ Hash

Parameters:

  • query (String)

    artifact for which to add tags

  • tags (Array<String>)

    tags to add to artifact

Returns:

  • (Hash)


15
16
17
18
19
20
21
22
# File 'lib/passivetotal/clients/action.rb', line 15

def add_tags(query:, tags:)
  params = {
    query: query,
    tags: tags,
  }.compact

  _post("/actions/tags", params) { |json| json }
end

#bulk_classification(*query) ⇒ Hash

Retrieve classification statuses for given domains. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsBulkClassification

Parameters:

  • query (Array<String>)

    domains for which to retrieve classification statuses

Returns:

  • (Hash)


50
51
52
53
54
55
56
# File 'lib/passivetotal/clients/action.rb', line 50

def bulk_classification(*query)
  params = {
    query: query,
  }.compact

  _get("/actions/bulk/classification", params) { |json| json }
end

#classification(query) ⇒ Hash

Retrieve classification status for a given domain. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsClassification

Parameters:

  • query (String)

    domain for which to retrieve classification status

Returns:

  • (Hash)


66
67
68
69
70
71
72
# File 'lib/passivetotal/clients/action.rb', line 66

def classification(query)
  params = {
    query: query,
  }.compact

  _get("/actions/classification", params) { |json| json }
end

#delete_tags(query:, tags:) ⇒ Hash

Parameters:

  • query (String)

    artifact from which to remove tags

  • tags (Array<String>)

    tags to remove from artifact

Returns:

  • (Hash)


33
34
35
36
37
38
39
40
# File 'lib/passivetotal/clients/action.rb', line 33

def delete_tags(query:, tags:)
  params = {
    query: query,
    tags: tags,
  }.compact

  _delete("/actions/tags", params) { |json| json }
end

#dynamic_dns(query) ⇒ Hash

Indicates whether or not a domain’s DNS records are updated via dynamic DNS. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsDynamicDns

Parameters:

  • query (String)

    domain for which to retrieve dynamic DNS status

Returns:

  • (Hash)


98
99
100
101
102
103
104
# File 'lib/passivetotal/clients/action.rb', line 98

def dynamic_dns(query)
  params = {
    query: query,
  }.compact

  _get("/actions/dynamic-dns", params) { |json| json }
end

#ever_compromised(query) ⇒ Hash

Indicates whether or not a given domain has ever been compromised. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsEverCompromised

Parameters:

  • query (String)

    domain to check for compromised status

Returns:

  • (Hash)


82
83
84
85
86
87
88
# File 'lib/passivetotal/clients/action.rb', line 82

def ever_compromised(query)
  params = {
    query: query,
  }.compact

  _get("/actions/ever-compromised", params) { |json| json }
end

#monitor(query) ⇒ Hash

Indicates whether or not a domain is monitored. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsMonitor

Parameters:

  • query (String)

    domain for which to check for monitoring

Returns:

  • (Hash)


114
115
116
117
118
119
120
# File 'lib/passivetotal/clients/action.rb', line 114

def monitor(query)
  params = {
    query: query,
  }.compact

  _get("/actions/monitor", params) { |json| json }
end

#search_by_tags(query) ⇒ Hash

Parameters:

  • query (String)

    tag for which to retrieve artifacts

Returns:

  • (Hash)


162
163
164
165
166
167
168
# File 'lib/passivetotal/clients/action.rb', line 162

def search_by_tags(query)
  params = {
    query: query,
  }.compact

  _get("/actions/tags/search", params) { |json| json }
end

#set_bulk_classification(queries:, classification:) ⇒ Hash

Parameters:

  • queries (Arra<String>)

    domain for which to set classification status

  • classification (String)

    classification status to set for domain

Returns:

  • (Hash)


179
180
181
182
183
184
185
186
# File 'lib/passivetotal/clients/action.rb', line 179

def set_bulk_classification(queries:, classification:)
  params = {
    queries: queries,
    classification: classification,
  }.compact

  _post("/actions/bulk/classification", params) { |json| json }
end

#set_classification(query:, classification:) ⇒ Hash

Sets the classification status for a given domain. api.passivetotal.org/api/docs/#api-Actions-PostV2ActionsClassification

Parameters:

  • query (String)

    domain for which to set classification status

  • classification (String)

    classification status to set for domain

Returns:

  • (Hash)


197
198
199
200
201
202
203
204
# File 'lib/passivetotal/clients/action.rb', line 197

def set_classification(query:, classification:)
  params = {
    query: query,
    classification: classification,
  }.compact

  _post("/actions/classification", params) { |json| json }
end

#set_dynamic_dns(query:, status:) ⇒ Hash

Sets a domain’s status to indicate whether or not its DNS records are updated via dynamic DNS. api.passivetotal.org/api/docs/#api-Actions-PostV2ActionsDynamicDns

Parameters:

  • query (String)

    domain for which to set dynamic DNS status

  • status (Boolean)

    if the domain’s DNS records are updated via dynamic DNS

Returns:

  • (Hash)


233
234
235
236
237
238
239
240
# File 'lib/passivetotal/clients/action.rb', line 233

def set_dynamic_dns(query:, status:)
  params = {
    query: query,
    status: status,
  }.compact

  _post("/actions/dynamic-dns", params) { |json| json }
end

#set_ever_compromised(query:, status:) ⇒ Hash

Sets status for a domain to indicate if it has ever been compromised. api.passivetotal.org/api/docs/#api-Actions-PostV2ActionsEverCompromised

Parameters:

  • query (String)

    domain for which to set compromised status

  • status (Boolean)

    if the domain has ever been compromised

Returns:

  • (Hash)


215
216
217
218
219
220
221
222
# File 'lib/passivetotal/clients/action.rb', line 215

def set_ever_compromised(query:, status:)
  params = {
    query: query,
    status: status,
  }.compact

  _post("/actions/ever-compromised", params) { |json| json }
end

#set_sinkhole(query:, status:) ⇒ Hash

Sets status for an IP address to indicate whether or not it is a sinkhole. api.passivetotal.org/api/docs/#api-Actions-PostV2ActionsSinkhole

Parameters:

  • query (String)

    IP address for which to set sinkhole status

  • status (Boolean)

    if the IP address is a sinkhole

Returns:

  • (Hash)


251
252
253
254
255
256
257
258
# File 'lib/passivetotal/clients/action.rb', line 251

def set_sinkhole(query:, status:)
  params = {
    query: query,
    status: status,
  }.compact

  _post("/actions/sinkhole", params) { |json| json }
end

#set_tags(query:, tags:) ⇒ Hash

Parameters:

  • query (String)

    artifact for which to set tags

  • tags (Array<String>)

    tags to set for artifact

Returns:

  • (Hash)


269
270
271
272
273
274
275
276
# File 'lib/passivetotal/clients/action.rb', line 269

def set_tags(query:, tags:)
  params = {
    query: query,
    tags: tags,
  }.compact

  _put("/actions/tags", params) { |json| json }
end

#sinkhole(query) ⇒ Hash

Indicates whether or not an IP address is a sinkhole. api.passivetotal.org/api/docs/#api-Actions-GetV2ActionsSinkhole

Parameters:

  • query (String)

    IP address to check for sinkhole status

Returns:

  • (Hash)


130
131
132
133
134
135
136
# File 'lib/passivetotal/clients/action.rb', line 130

def sinkhole(query)
  params = {
    query: query,
  }.compact

  _get("/actions/sinkhole", params) { |json| json }
end

#tags(query) ⇒ Hash

Parameters:

  • query (String)

    artifact for which to retrieve tags

Returns:

  • (Hash)


146
147
148
149
150
151
152
# File 'lib/passivetotal/clients/action.rb', line 146

def tags(query)
  params = {
    query: query,
  }.compact

  _get("/actions/tags", params) { |json| json }
end